Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FPrime support #77

Closed
ivanperez-keera opened this issue Mar 21, 2023 · 6 comments
Closed

Add FPrime support #77

ivanperez-keera opened this issue Mar 21, 2023 · 6 comments
Assignees
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Feature Admin only: Change request pertaining to new features requested
Milestone

Comments

@ivanperez-keera
Copy link
Member

Description

We have determined that supporting FPrime would generally be useful for Ogma and related projects (e.g., FRET). a backend for FPrime should be officially added.

Type

  • New feature.

Additional context

None.

Requester

  • Ivan Perez

Method to check presence of bug

A sample FRET file can be compiled into a FPrime monitoring node and package, and compilation in a FPrime docker image succeeds.

Expected result

Ogma provides a new command to generate a FPrime monitoring package, akin to the one provided for cFS.

Desired result

Ogma provides a new command to generate a FPrime monitoring package, akin to the one provided for cFS.

Proposed solution

Update ogma-core with the new command to generate FPrime package. Expose command via ogma-cli.

Further notes

None.

@ivanperez-keera ivanperez-keera added CR:Status:Initiated Admin only: Change request that has been initiated CR:Type:Feature Admin only: Change request pertaining to new features requested labels Mar 21, 2023
@ivanperez-keera
Copy link
Member Author

Change Manager: Confirmed that the issue exists.

@ivanperez-keera ivanperez-keera added CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager and removed CR:Status:Initiated Admin only: Change request that has been initiated labels Mar 21, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Confirmed that the issue should be addressed.

@ivanperez-keera ivanperez-keera added CR:Status:Accepted Admin only: Change request accepted by technical lead and removed CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager labels Mar 21, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Issue scheduled for Ogma 1.(0+X).(7+Y).

Fix assigned to: @ivanperez-keera.

@ivanperez-keera ivanperez-keera added CR:Status:Scheduled Admin only: Change requested scheduled and removed CR:Status:Accepted Admin only: Change request accepted by technical lead labels Mar 21, 2023
@ivanperez-keera ivanperez-keera self-assigned this Mar 21, 2023
@ivanperez-keera ivanperez-keera added this to the Release 1.(0+X).(7+Y) milestone Mar 21, 2023
@ivanperez-keera ivanperez-keera added CR:Status:Implementation Admin only: Change request that is currently being implemented and removed CR:Status:Scheduled Admin only: Change requested scheduled labels Mar 21, 2023
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

[ci skip]
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…. Refs #77.

This commit adds a new command the ogma's core that generates an FPrime
monitoring component that exposes ports for input data, as well as one a
command to execute the monitors when desired, reports any violations.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Expose the new FPrime backend via the command-line interface.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…77.

Mention the existence of the new FPrime backend in the top-level documentation
of the main module.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
.

Mention the existence of the FPrime backend in the documentation of the cabal
file for the CLI, which will be used for hackage.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…. Refs #77.

This commit adds a new command the ogma's core that generates an FPrime
monitoring component that exposes ports for input data, as well as one a
command to execute the monitors when desired, reports any violations.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Expose the new FPrime backend via the command-line interface.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…77.

Mention the existence of the new FPrime backend in the top-level documentation
of the main module.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
.

Mention the existence of the FPrime backend in the documentation of the cabal
file for the CLI, which will be used for hackage.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

Describe existing limitations for the command.
@ivanperez-keera
Copy link
Member Author

Implementor: Solution implemented, review requested.

@ivanperez-keera ivanperez-keera added CR:Status:Verification Admin only: Change request that is currently being verified and removed CR:Status:Implementation Admin only: Change request that is currently being implemented labels Mar 21, 2023
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…. Refs #77.

This commit adds a new command the ogma's core that generates an FPrime
monitoring component that exposes ports for input data, as well as one a
command to execute the monitors when desired, reports any violations.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Expose the new FPrime backend via the command-line interface.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
…77.

Mention the existence of the new FPrime backend in the top-level documentation
of the main module.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
.

Mention the existence of the FPrime backend in the documentation of the cabal
file for the CLI, which will be used for hackage.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

Describe existing limitations for the command.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

Describe existing limitations for the command.
ivanperez-keera added a commit that referenced this issue Mar 21, 2023
Add instructions of how the `fprime` command works.

Add entry in list of features documenting the new F' (FPrime) support.

Describe existing limitations for the command.
@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles passes the tests. Details:
      Docker image:

      FROM ubuntu:trusty
      
      RUN apt-get update
      
      RUN apt-get install --yes software-properties-common
      RUN add-apt-repository ppa:hvr/ghc
      RUN apt-get update
      
      RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
      RUN apt-get install --yes libz-dev
      
      ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN apt-get install --yes git
      
      # We install the application first and then test it, in case any tests need to
      # run the tool.
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd .. && \
          cabal v1-install $NAME/$PAT**/ --enable-tests && \
          cabal v1-install $NAME/$PAT**/ --enable-tests --run-tests -j1

      Command:

      $ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=76fc7b0bce982619f30376ebf6ac6b4260e91224" -it ogma-test
    • The solution proposed fixes the issues described. Details:
      The following following Dockerfile uses the accompanying FRET component specification containing inequalities in the TL formulas to generate the FPrime monitoring component and the Copilot monitors. The output produces a second Dockerfile that can be used to compile the generated monitoring component as part of FPrime's reference application. The fprime-variables-db file added contains an extra variable just to add some noise to the test:

      --- Dockerfile-verify-77
      FROM ubuntu:trusty
      
      RUN apt-get update
      
      RUN apt-get install --yes software-properties-common
      RUN add-apt-repository ppa:hvr/ghc
      RUN apt-get update
      
      RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
      RUN apt-get install --yes libz-dev
      
      ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN cabal v1-install copilot
      RUN apt-get install --yes git
      
      ADD file.json .
      ADD fprime-variable-db .
      
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd .. && \
          cabal v1-install $NAME/$PAT**/ --enable-tests && \
          ogma fprime --app-target-dir fprime_demo --fret-file-name file.json --variable-db fprime-variable-db && \
          ogma fret-component-spec --fret-file-name file.json > Spec.hs && \
          sed -i -e 's/"fret/"copilot/g' Spec.hs && \
          cabal v1-exec -- runhaskell Spec.hs && \
          mv copilot.c copilot.h copilot_types.h fprime_demo/
      
      --- fprime-variable-db
      ("pullup", "bool")
      ("input", "float")
      
      --- file.json
      {
        "mySpec": {
          "Internal_variables": [ ],
          "Other_variables": [ {"name":"input", "type":"real"} ],
          "Functions": [ ],
          "Requirements": [
            { "name": "REQ",
              "ptLTL": "(H (input != 30.0))",
              "CoCoSpecCode": "(H( input <> 30.0 ))",
              "fretish": "Irrelevant for the example"
            }
          ]
        }
      }

      Command:

      $ docker run -v $PWD/output:/fprime_demo -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=76fc7b0bce982619f30376ebf6ac6b4260e91224" -it ogma-verify-77
      $ cd output/
      $ docker build -t ogma-verify-77-fprime .
  • Implementation is documented. Details:
    • New module is documented.
    • Cabal files are documented.
    • README is documented.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No examples affected.
  • Required version bumps are evaluated. Details:
    No bump needed (new feature introduced).

@ivanperez-keera
Copy link
Member Author

Change Manager: Implementation ready to be merged.

@ivanperez-keera ivanperez-keera added CR:Status:Closed Admin only: Change request that has been completed and removed CR:Status:Verification Admin only: Change request that is currently being verified labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Feature Admin only: Change request pertaining to new features requested
Projects
None yet
Development

No branches or pull requests

1 participant