|
| 1 | +--- |
| 2 | +title: Decoupling Fedora CI deployment from Packit Service |
| 3 | +authors: lbarcziova |
| 4 | +--- |
| 5 | + |
| 6 | +Related links: |
| 7 | + |
| 8 | +- [issue](https://github.com/packit/packit-service/issues/2737) |
| 9 | + |
| 10 | +This research describes requirements and plan to decouple Fedora CI-specific worker functionality from |
| 11 | +the [Packit Service repository](https://github.com/packit/packit-service) and deploy it as a separate, independent service. |
| 12 | +This will improve maintainability, scalability, and make the deployment within Fedora infrastructure easier. |
| 13 | + |
| 14 | +## Code |
| 15 | + |
| 16 | +- create the new repo (`https://github.com/packit/fedora-ci`?) structure, something like this: |
| 17 | + |
| 18 | +``` |
| 19 | +fedora-ci/ |
| 20 | +├── fedora_ci/ |
| 21 | +│ ├── handlers/ # Fedora CI handlers |
| 22 | +│ ├── helpers/ # Helper classes like FedoraCIHelper |
| 23 | +│ ├── checker/ # Checker classes |
| 24 | +│ ├── jobs.py # Job processing logic |
| 25 | +│ └── tasks.py # Celery tasks |
| 26 | +├── tests/ |
| 27 | +
|
| 28 | +``` |
| 29 | + |
| 30 | +- code migration: |
| 31 | + - identify and move all Fedora CI-related worker functionality from packit-service to the new repository; this concerns jobs that do not depend on a repo having Packit configuration in the repository |
| 32 | + - set up tests and CI |
| 33 | + - create files needed for deployment: `run_worker.sh`, Containerfile, docker-compose file, etc. |
| 34 | +- remove the moved code from the `packit-service` repo |
| 35 | + (this should be done after the code from new repo is deployed) |
| 36 | + |
| 37 | +## DB and API |
| 38 | + |
| 39 | +- schema same, empty tables |
| 40 | +- do we want to migrate the data from the current deployment? |
| 41 | +- API at e.g. `prod.fedora-ci.packit.dev/api` |
| 42 | + |
| 43 | +## Dashboard |
| 44 | + |
| 45 | +- keeping one instance or having 2 |
| 46 | + - 1 instance: we can use [`Context selector`](https://www.patternfly.org/components/menus/context-selector/design-guidelines) like OpenShift does |
| 47 | + - using different backends |
| 48 | + - 2 instances: |
| 49 | + - implementation wise this would require more changes |
| 50 | +- to consider: this might be also required to be deployed in Fedora infra |
| 51 | + - dashboard deployment is quite straightforward, shouldn't be an issue |
| 52 | + |
| 53 | +## Identity |
| 54 | + |
| 55 | +- we probably want a new identity (or 2, both for stg and prod) on `src.fedoraproject.org` to be set up |
| 56 | +- current Fedora CI user (`releng-bot`) is in these groups: |
| 57 | + - cvsadmin |
| 58 | + - fedora-contributor |
| 59 | + - fedorabugs |
| 60 | + - packager |
| 61 | + - relenggroup |
| 62 | + |
| 63 | +## Openshift |
| 64 | + |
| 65 | +### Ansible playbook, roles, Openshift object definitions |
| 66 | + |
| 67 | +- [Fedora infra ansible repo](https://pagure.io/fedora-infra/ansible) |
| 68 | +- copy and adjust the existing [deployment playbook](https://github.com/packit/deployment/blob/main/playbooks/deploy.yml) and related files |
| 69 | +- mimic existing Fedora infrastructure playbooks, such as https://pagure.io/fedora-infra/ansible/blob/main/f/playbooks/openshift-apps/openscanhub.yml, and remove any unneeded tasks specific to Packit Service |
| 70 | +- copy and adjust the Openshift object definitions, also remove Packit Service specific values (e.g. MPP specific) |
| 71 | +- logs collection in Fedora infra? |
| 72 | + |
| 73 | +### Configuration |
| 74 | + |
| 75 | +- create Packit service config (specific server name etc.), variable file templates |
| 76 | + |
| 77 | +### Secrets |
| 78 | + |
| 79 | +- all the secrets should be new (different from Packit Service) |
| 80 | + - certificates |
| 81 | + - identity related files: token, SSH keys, keytab |
| 82 | + - Fedora messaging |
| 83 | + - Testing Farm |
| 84 | + - Flower |
| 85 | + - postgres |
| 86 | + - Sentry |
| 87 | + - ? |
| 88 | + |
| 89 | +# To discuss |
| 90 | + |
| 91 | +- repo naming |
| 92 | +- identity - do we want new? permissions/groups? |
| 93 | +- do we want both stg and prod? new code deployment strategy? weekly prod updates? |
| 94 | +- existing data migration |
| 95 | +- how to handle code changes while being in the process of the decoupling |
| 96 | + |
| 97 | +# Follow-up work (to be adjusted based on discussion) |
| 98 | + |
| 99 | +- code migration as described above: |
| 100 | + - functionality and tests |
| 101 | + - CI setup |
| 102 | + - deployment related files |
| 103 | + - data migration? |
| 104 | +- configuration and secrets generation |
| 105 | +- integrate our deployment into https://pagure.io/fedora-infra/ansible/blob/main/f/playbooks |
| 106 | +- dashboard changes |
0 commit comments