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

https://github.com/Bahmni/openmrs-distro-bahmni/pull/71

bahmni-web

https://github.com/Bahmni/openmrs-module-bahmniapps/pull/446

bahmni-lab

https://github.com/Bahmni/OpenElis/pull/60

bahmni-erp

https://github.com/Bahmni/odoo-modules/pull/69

bahmni-erp-connect

https://github.com/Bahmni/openerp-atomfeed-service/pull/56

bahmni-implementer-interface

BAH-2303 | Add Job to build RPM in Github Actions by mohan-13 · Pull Request #82 · Bahmni/implementer-interface

bahmni-reports

BAH-2304 Migrate Bahmni Reports Pipeline from GoCD to Github Actions by goyaldivij · Pull Request #50 · Bahmni/bahmni-reports

bahmni-appointments

BAH-2296 | Add job in Github Actions workflow to build and publish RPM by mohan-13 · Pull Request #224 · Bahmni/openmrs-module-appointments-frontend

dcm4chee, pacs-integration

BAH-2332 | Add job for building Bahmni PACS artifacts by mohan-13 · Pull Request #28 · Bahmni/pacs-integration

bahmni-event-log-service

BAH-2302| Migrated event-log-service from GoCD to Github Actions by stavtnameh · Pull Request #19 · Bahmni/event-log-service

bahmni-offline

https://github.com/Bahmni/bahmni-offline/pull/14

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)