Code for (Celery) worker used in our "Stream service". It reuses packit-service's worker code and implements new jobs as new handlers.
The service is similar to Packit service, but is expected to eventually follow this workflow:
- If a user creates a merge-request on the source-git repository:
- Create a matching merge-request to the dist-git repository.
- Sync the CI results from the dist-git merge-request to the source-git merge-request.
- If the dist-git is updated, update the source-git repository by opening a PR.
- Implemented, but not enabled yet.
- User is able to convert source-git change to the dist-git change locally via CLI.
- If the source-git merge-request is updated, update the dist-git merge-request.
- If the source-git merge-request is closed, close the dist-git merge-request.
- User is able to re-trigger the dist-git CI from the source-git merge-request.
- User is able to re-create the dist-git MR from the source-git merge-request.
Similar to packit-service we have a docker-compose.yml for fast prototyping.
It expects, that you have:
- .env.fedora-source-git or env.stream
copied or symlinked (
ln -s .env.fedora-source-git .env
) to.env
. secrets/fedora-source-git/dev/
orsecrets/stream/dev/
populated (linked) with secrets mostly taken from our internal repo. "Mostly", because you should use your credential where possible.../ogr/
,../packit/
and../packit-service/
dirs with the respected repos cloned. Those are mounted into the container, so you don't have to rebuild the image each time you change anything in them.
Follow the packit-service's guide for the other settings. Once you have it running (and see no errors), you can test (uses HTTPie) the webhook with:
cat tests/data/webhooks/gitlab/mr_event.json | http --verify=no https://service.localhost:8443/api/webhooks/gitlab
To deploy the service into Openshift cluster, clone the deployment repo and:
- create the variable files in vars/stream/
- link secrets into secrets / stream/{prod|stg}
SERVICE={fedora-source-git|stream} DEPLOYMENT={deployment} make deploy
The image is currently based on the packit-worker image but that might change in the future to decouple those.
For running locally with docker-compose, build it with docker-compose build
.
For deploying in cluster, the image is
built and pushed
to Quay.io whenever you push to main
.
Or you can rebuild manually in
Actions.
Locally: make test-image
&& make check-in-container
CI: Zuul