-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Understand the Task
Description
We need to build not only docker images from our UI projects (frontend & backend) but also OCM components.
We need to add the respective Github Actions to the ui-frontend repo.
Proposal & ToDos
- ui-frontend repo will get a new github action step
- everytime we do a release of the ui-frontend, we build an ocm component which includes the ui-frontend version as well as the current compatible backend release
- both images are added as resources to the ocm component
- the component is then published in the same place as all other openmcp ocm components
This means we will need to create a component-descriptor.yaml into the frontend project which includes this information. Should use parameterized values so it can be filled with the correct version in the build step.
Tasks to achieve this
1. Add Taskfile
We need to have a Taskfile which contains a task for
- build:image - Builds the docker image
- build:ocm - Builds the ocm component
Then we should also add the build:image task already. This should be the command in our github actions build step.
The github actions should then also utilize Task and the Taskfile
2. OCM Preparation
We need the component descriptor of OCM in the ui-frontend repo. Maybe under an ocm folder or similar. It can be called component.yaml or component-constructor.yaml.
See the structure of the file here:
https://github.com/openmcp-project/openmcp or https://ocm.software
3. Add build:ocm task
We need to add the build:ocm task to the Taskfile. The command looks like this:
ocm add component --file ctf --version VERSION_NUMBER component-constructor.yaml
This creates the ocm component in a local directory called ctf.
4. Add publish:ocm task
We also need another publish:ocm task in our Taskfile. This command uploads the ocm component from the local directory ctf to the openmcp registry (if ran in github action)
ocm transfer -f ctf OCM_TARGET_REPO
For our github actions the target repo must be ghcr.io/openmcp-project/components
5. Add publish:image task
Just to make everything understandable and structured the same we also should have an action which publishes a local build image of the ui-frontend into the target repo.
docker push ghcr.io/openmcp-project/images/mcp-ui-frontend
This should also be utilized by our github actions (normal build as well as our main build)
6. Add the ocm build and publish task to our Github Actions
Our github actions should build the ocm component for every release (not our main builds).
So after the images are build, we need to call the tasks for build:ocm and publish:ocm.
What is required to accept the Task as done.
Done Criteria
- our ui-frontend and ui-backend images are published in the correct location
ghcr.io/openmcp-project/images/ui-frontend&ghcr.io/openmcp-project/images/ui-backend - we have a ocm component under
ghcr.io/openmcp-project/componentscalledgithub.com/openmcp-project/ui - The ocm component is build on every versioned release (no main builds!)
- every ocm component contains the frontend and backend image compatible with each other.