GoCD to Github Actions Migration
Bahmni CI pipelines were implemented using GoCD. Since GoCD is a hosted solution, it required EC2 instances to be running to run the build pipelines. Since Github Actions provides on-demand runners, the CI pipelines for building and uploading docker images have been implemented in Github Actions. So the plan to migrate RPM builds also to Github Actions has started. The following diagram maps the artifacts with the pipelines and dependent repositories.
Challenges faced during migration:
1. Github Actions doesn’t support upstream/downstream pipeline config
This made it hard to consume some of the dependencies together for building the artifacts and triggering the pipeline when a downstream dependency gets updated.
2. Github Actions persists build artifacts maximum for 90 days
3. Uploading an RPM to S3 Yum Repository requires us to download the entire S3 bucket contents on every workflow run
Bahmni maintains the YUM artifactory for RPMs in S3, which has all the builds of RPMs and this amounts to ~400 GBs. Now for a new artifact to be published to the repository, the entire content needs to be in the runner to sync and update the repodata of the artifactory. As this is a huge storage, this would not be feasible to download on every run. So a workaround would need to be found to persist the repo for the sync to happen faster. Some of the options would be as follows:
a. Attaching an EC2 as a self hosted runner in Github Actions(Has security implications)
b. Moving to a self hosted Yum Repository using Nexus. (Would require monitoring and management and added cost)
c. Having a EC2 running to perform the sync. (Breaks the automated flow and involves manual intervention and added cost.)
Considering the aforementioned challenges and the thought of sunsetting the RPM setups in next few releases, only docker/ kubernetes setup will be supported. So migration of RPM builds is put on hold.
Maintaining GoCD with reduced cost:
The RPM build would still happen from GoCD, but the GoCD agents and the CI Server will only run on demand during the time of a release. Once the release has been completed, the CI system will be backed up and the EC2 instances would be stopped.
The below table provides the list of closed PRs for the completed migrations for the individual RPMs:
RPM | Pull Request |
bahmni-emr, bahmni-lab-connect | |
bahmni-web | https://github.com/Bahmni/openmrs-module-bahmniapps/pull/446 |
bahmni-lab | |
bahmni-erp |
|
bahmni-erp-connect |
|
bahmni-implementer-interface |
|
bahmni-reports |
|
bahmni-appointments |
|
dcm4chee, pacs-integration |
|
bahmni-event-log-service |
|
bahmni-offline |
|
bahmni-installer | Yet to be started |
atomfeed-console | Yet to be started |
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)