Skip to content

ogma-core: Add dockerfile to cFS template. Refs #353.#354

Merged
ivanperez-keera merged 12 commits intonasa:developfrom
ivanperez-keera:develop-cfs-dockerfile
Feb 11, 2026
Merged

ogma-core: Add dockerfile to cFS template. Refs #353.#354
ivanperez-keera merged 12 commits intonasa:developfrom
ivanperez-keera:develop-cfs-dockerfile

Conversation

@ivanperez-keera
Copy link
Member

Add Dockerfile to cFS template, adjusting the locations of files in the template, the Cabal files, the backend and the documentation, as prescribed in the solution proposed for #353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

To make room for the Dockerfile, we need the cFS application files to be
generated in a subdirectory, so that the Dockerfile is not mixed with
the contents of the generated monitoring application.

This commit moves the files in the existing template to a subdirectory
that holds only the monitoring application.
…#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit moved all files in the existing template to a
subdirectory, so that the Dockerfile to be added is not mixed with the
existing template.

This commit adjusts the cFS backend so that it looks for the template in
the directory `cfs`, which is where files are now located after the
renaming.
…#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit moved all files in the existing template to a
subdirectory, so that the Dockerfile to be added is not mixed with the
existing template.

This commit modifies the Cabal file so that the files in the cFS
template are installed from their new locations.
@ivanperez-keera
Copy link
Member Author

Change Manager: Several of the changes fell in the ogma-cli directory. They have the wrong summary line, and the changelog for ogma-cli should be updated.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit moved all files in the existing template to a
subdirectory, so that the Dockerfile to be added is not mixed with the
existing template.

This commit adjusts the CI job that tests the cFS backend to account for
the change in path for the generated files relative to the top-level
target dir.
…. Refs nasa#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit moved all files in the existing template to a
subdirectory, so that the Dockerfile to be added is not mixed with the
existing template.

This commit updates the cFS tutorial account for the new expected path
for the generated monitoring application.
…Refs nasa#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit moved all files in the existing template to a
subdirectory, so that the Dockerfile to be added is not mixed with the
existing template.

This commit updates the README to list the files produced by the cFS
backend using their new location.
@ivanperez-keera
Copy link
Member Author

Implementor: Fix implemented, review requested.

@ivanperez-keera
Copy link
Member Author

Change Manager: The Dockerfile included in the template is missing a backslash after git, causing happy to be interpreted as an instruction.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

This commit adds a Dockerfile to the cFS template.
…. Refs nasa#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit added a Dockerfile at the top level in the cFS template.

This commit modifies the Cabal file to add the new cFS Dockerfile to the
list of data files installed with the cFS template when `ogma-core` is
installed.
…. Refs nasa#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit added a Dockerfile to the top-level of the cFS template.

This commit updates the cFS tutorial to include the Dockerfile in the
list of files generated by the cFS backend.
…Refs nasa#353.

Ogma doesn't currently generate a Dockerfile with the cFS applications.
That makes it harder for users to know how to use the generated
applications.

A prior commit added a Dockerfile to the top-level of the cFS template.

This commit updates the README to include the Dockerfile in the list of
files generated by the cFS backend by default, and to explain how the
file can be used to compile the generated cFS application in a standard
distribution of cFS.
@ivanperez-keera
Copy link
Member Author

Implementor: Fix implemented, review requested.

@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
    • The solution proposed produces the expected result. Details:
      The following dockerfile runs the cFS backend on a known example and generates a monitoring application. As part of the generated output, another Dockerfile is included. When the latter is built, it compiles the monitoring application within a cFS installation.
      FROM ubuntu:22.04
      
      ENV DEBIAN_FRONTEND=noninteractive
      
      RUN apt-get update
      SHELL ["/bin/bash", "-c"]
      
      RUN apt-get install --yes \
        alex \
        cabal-install \
        g++ \
        ghc \
        git \
        happy \
        libbz2-dev \
        libexpat1-dev \
        libz-dev \
        pkg-config
      
      WORKDIR /root/
      
      ENV PATH=/root/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install BNFC
      
      CMD git clone $REPO \
        && pushd $NAME \
        && git checkout $COMMIT \
        && popd \
        && cabal v1-install --force-reinstalls $NAME/ogma-**/ \
        && ogma cfs --target-dir demo \
             --input-file $NAME/ogma-cli/examples/cfs-001-hello-ogma/expressions.json \
             --input-format $NAME/ogma-cli/examples/cfs-001-hello-ogma/json-format.cfg \
             --prop-format literal \
             --variable-db $NAME/ogma-cli/examples/cfs-001-hello-ogma/db.json \
             --template-vars $NAME/ogma-cli/examples/cfs-001-hello-ogma/extra-vars.json \
        && cp $NAME/ogma-cli/examples/cfs-001-hello-ogma/extra.h demo/copilot/fsw/src/ \
        && echo "Success"
      Command (substitute variables based on new path after merge):
      $ mkdir -p demo
      $ docker run -e REPO=https://github.com/ivanperez-keera/ogma -e NAME=ogma -e COMMIT=c7ecd94d134a189c23ac9fd46185c765a635da59 -v $PWD/demo:/root/demo ogma-verify-353
      $ cd demo
      $ docker build -t ogma-verify-353-cfs .
      
      A step of changing permissions by executing chown -R $USER:$(id -ng $USER) . inside the demo directory may be necessary prior to the second docker build, depending on the host setup.
  • Implementation is documented. Details:
    The tutorial and README are updated.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    The tutorial affected by this change has been updated.
  • Author is internal or has provided signed CLA.
  • Required version bumps are evaluated. Details:
    Bump required; the change affects the output produced and how it is compiled.

@ivanperez-keera ivanperez-keera merged commit 7d6800f into nasa:develop Feb 11, 2026
4 checks passed
@ivanperez-keera ivanperez-keera deleted the develop-cfs-dockerfile branch February 11, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant