blob: 613929ae14a9cc700e7ff5e77519668b0ead2c46 [file] [log] [blame]
Louis Dionne389ef792020-11-19 14:22:28 -05001.. _AddingNewCIJobs:
2
3==================
4Adding New CI Jobs
5==================
6
7.. contents::
8 :local:
9
10Adding The Job
11==============
12
13libc++ uses Buildkite for running its CI. Setting up new CI jobs is easy, and
14these jobs can run either on our existing infrastructure, or on your own.
15
16If you need to run the job on your own machines, please follow the
17`Buildkite guide <https://buildkite.com/docs/agent/v3>`_ to setup your
18own agents. Make sure you tag your agents in a way that you'll be able
19to recognize them when defining your job below. Finally, in order for the
Louis Dionned9d20802021-06-14 15:55:36 -040020agent to register itself to Buildkite, it will need a BuildKite Agent token.
Louis Dionne389ef792020-11-19 14:22:28 -050021Please contact a maintainer to get your token.
22
23Then, simply add a job to the Buildkite pipeline by editing ``libcxx/utils/ci/buildkite-pipeline.yml``.
24Take a look at how the surrounding jobs are defined and do something similar.
25An example of a job definition is:
26
27.. code-block:: yaml
28
29 - label: "C++11"
30 command: "libcxx/utils/ci/run-buildbot generic-cxx11"
31 artifact_paths:
32 - "**/test-results.xml"
33 agents:
34 queue: "libcxx-builders"
Louis Dionne877e97a2021-07-12 16:25:29 -040035 os: "linux"
Louis Dionne389ef792020-11-19 14:22:28 -050036 retry:
Louis Dionned232ec32021-08-09 09:42:24 -040037 [...]
Louis Dionne389ef792020-11-19 14:22:28 -050038
Louis Dionne877e97a2021-07-12 16:25:29 -040039If you create your own agents, put them in the ``libcxx-builders`` queue and
40use agent tags to allow targetting your agents from the Buildkite pipeline
41config appropriately.
Louis Dionne389ef792020-11-19 14:22:28 -050042
43We try to keep the pipeline definition file as simple as possible, and to
44keep any script used for CI inside ``libcxx/utils/ci``. This ensures that
45it's possible to reproduce CI issues locally with ease, understanding of
46course that some setups may require access to special hardware that is not
47available.
48
49Testing Your New Job
50====================
51
52Testing your new job is easy -- once your agent is set up (if any), just open
53a code review and the libc++ CI pipeline will run, including any changes you
54might have made to the pipeline definition itself.
55
56Service Level Agreement
57=======================
58
59To keep the libc++ CI useful for everyone, we aim for a quick turnaround time
60for all CI jobs. This allows the overall pipeline to finish in a reasonable
61amount of time, which is important because it directly affects our development
62velocity. We also try to make sure that jobs run on reliable infrastructure in
63order to avoid flaky failures, which reduce the value of CI for everyone.
64
65We may be reluctant to add and support CI jobs that take a long time to finish
66or that are too flaky.