Overview
The continuous integration (CI) and continuous deployment (CD) system is dependent on the following:
- GNU Guix: used to define the machine (VM, container, etc) within which the CI/CD system will run
- Guix Forge: does the main ochestration that enables the CI/CD system to function
- Laminar: Runs the CI jobs
In the sections that follow, we shall dive deeper into how the CI/CD system is put together
CI/CD Flow
- Developer writes some code and pushes it to the main branch in the GeneNetwork(2/3) repositories
- A webhook triggers the CI system
- The CI system runs the unit tests, linting and type checks mostly concurrently
- If ALL the unit tests pass, the application is redeployed
Guix Forge and G-Expressions
The CI/CD used for GeneNetwork makes heavy use of Guix G-Expressions (also known as gexps) written for guix-forge.
The CI system begins by defining a data structure to hold the development server's configuration
(define-record-type* <development-server-configuration> development-server-configuration make-development-server-configuration development-server-configuration? (name development-server-configuration-name) (git-repository development-server-configuration-git-repository) (git-branch development-server-configuration-git-branch) (executable-path development-server-configuration-executable-path) (runner development-server-configuration-runner) (port development-server-configuration-port (default 8080)))
The define-record-type
macro is defined in the (guix records)
module.
The server configuration has the following values:
- name: The name of the server configuration
- git-repository: The git repository relating to the server configuration
- git-branch: The branch to run the CI against
- executable-path: something to do with laminar?
- runner: A gexp that runs the service under …
- port: The port to run the service under CI/CD on
TODO Figure out how to organise these notes genenetwork CI CD
- The system uses webhook to trigger the builds on each commit
- There is some use of
development-server-configuration
objects