Continuous intergration (CI) and continuous deployment (CD) are critical parts of making sure software development does not mess up our deployment(s).
We need various levels of tests to be run, from unit tests to the more complicated ones like integration, performance, regression, etc tests, and of course, they cannot all be run for each and every commit, and will thus need to be staggered across the entire deployment cycle to help with quick iteration of the code.
As part of the CI/CD effort, it is necessary that there is
#### Ideas
GeneNetwork is interested in doing two things on every commit (or periodically, say, once an hour/day):
Arun has figured out the CI part. It runs a suitably configured laminar CI service in a Guix container created with `guix system container'.
We have the quick running tests, e.g unit tests, run on each commit to branch "main". Once those are successful, the CI/CD system we choose should automatically pick the latest commit that passed the quick running tests for for further testing and deployment. Once the next battery of tests is passed, the CI/CD system will create a build/artifact to be deployed to staging and have the next battery of tests runs against it. If that passes, then that artifact could be deployed to production with details of the commit and deployment dependencies.
IIRC actions run artifacts inside github's infrastracture. We use webhooks: e.g.
Update the hook at
A web hook basically calls an endpoint on a git push event. The webhook for genenetwork3 has recently not been called (ever? it says: This hook has never been triggered. ). The webhook for genenetwork2, however, has been called.
To trigger CI manually, run this with the project name:
curl https://ci.genenetwork.org/hooks/example-gn3
I just tested and it appeared this triggered a redeploy of gn2:
curl -XGET "https://ci.genenetwork.org/hooks/genenetwork2
For gemtext we have a github hook that adds a forge-project and looks like
(define gn-gemtext-threads-project
(forge-project
(name "gn-gemtext-threads")
(repository "https://github.com/genenetwork/gn-gemtext-threads/")
(ci-jobs (list (forge-laminar-job
(name "gn-gemtext-threads")
(run (with-packages (list nss-certs openssl)
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(setenv "LC_ALL" "en_US.UTF-8")
(invoke #$(file-append tissue "/bin/tissue")
"pull" "issues.genenetwork.org"))))))))
(ci-jobs-trigger 'webhook)))
The normal trigger is automatic, you push code in any of the two repos (three? I'll verify), GN2 and GN3 and the laminar runs the jobs and updates the code in the container restarts services, as appropriate.
If you want to trigger the CI manually, there are webhooks available for that that can be triggered manually with something like:
curl -XGET "https://ci.genenetwork.org/hooks/genenetwork2"
for GN2. Change the part after /hooks/ for each of the different repos as follows:
GN2: /genenetwork2 GN3: /genenetwork3 gn-auth: /gn-auth (I need to verify this) gn-uploader: Does not exist right now
Guix forge can be found at
TBD
#### Possible Steps
Below are some possible steps (and tasks) to undertake for automated deployment
##### STEP 01: Build package
##### STEP 02: Deploy to Staging
##### STEP 03: Deploy to Release Candidate
##### STEP 03: Deploy to Production
#### See also
This contains a check-list of things that need to be done: