blob: 7eda3d65e87bea0a65e970796fa114623c96eaa1 [file] [log] [blame] [view]
Serge Bazanski5aa494f2021-05-18 18:57:10 +02001Monogon CI
2==========
3
4Monogon has a work-in-progress continuous integration / testing pipeline.
5Because of historical reasons, some parts of this pipeline are defined in a
Leopold7fbf1042023-01-06 19:57:37 +01006separate non-public repository that is managed by Monogon SE.
Serge Bazanski5aa494f2021-05-18 18:57:10 +02007
8In the long term, the entire infrastructure code relating to this will become
9public and part of the Monogon repository. In the meantime, this document
10should serve as a public reference that explains how that part works and how it
11integrates with `//build/ci/...` and the project as a whole.
12
13Builder Image & Container
14-------------------------
15
16`//build/ci/Dockerfile` describes a 'builder image'. This image contains a
17stable, Fedora-based build environment in which all Monogon components should
Leopold7fbf1042023-01-06 19:57:37 +010018be built. The Jenkins based CI uses the Builder image as a base to run Jenkins agents.
Serge Bazanski5aa494f2021-05-18 18:57:10 +020019
Leopold7fbf1042023-01-06 19:57:37 +010020A Monogon SE developer runs `//build/ci/build_ci_image`, which builds the
21Builder Image and pushes it to a container registry. Then, in another
22repository, that image is used as a base to overlay a Jenkins agent on top,
23and then used to run all Jenkins actions.
Serge Bazanski5aa494f2021-05-18 18:57:10 +020024
Leopold7fbf1042023-01-06 19:57:37 +010025The build image contains only basic dependencies that are required to bootstrap
26the sandbox sysroot and run the CI agents. All other build-time dependencies
27are managed by Bazel via [third_party/sandboxroot](../../third_party/sandboxroot).
Serge Bazanski5aa494f2021-05-18 18:57:10 +020028
29CI usage
30--------
31
32When a change on https://review.monogon.dev/ gets opened, it needs to either
33be owned by a 'trusted user', or be vouched by one. This is because our current
34CI setup is not designed to protect against malicious changes that might
35attempt to take over the CI system, or change the CI scripts themselves to skip
36tests.
37
Leopold7fbf1042023-01-06 19:57:37 +010038Currently, all Monogon SE employees (thus, the core Monogon development team)
Serge Bazanski5aa494f2021-05-18 18:57:10 +020039are marked as 'trusted users'. There is no formal process for community
40contributors to become part of this group, but we are more than happy to
41formalize such a process when needed, or appoint active community contributors
42to this group. Ideally, though, the CI system should be rebuilt to allow any
43external contributor to run CI in a secure and sandboxed fashion.
44
45CI implementation
46-----------------
47
48The CI system is currently made of a Jenkins instance running on
49https://jenkins.monogon.dev/. It runs against open changes that have the
50Allow-Run-CI label evaluated to 'ok' Gerrit Prolog rules, and executes the
51`//build/ci/jenkins-presubmit.groovy` script on them.
52
53Currently, the Jenkins instance is not publicly available, and thus CI logs are
Leopold7fbf1042023-01-06 19:57:37 +010054not publicly available either. This will be fixed soon.