Skip to content

Commit 5383637

Browse files
committed
Merge bitcoin/bitcoin#30314: doc: clarify Cirrus self-hosted workers setup
c67f215 ci: clarify Cirrus self-hosted workers setup (Sjors Provoost) Pull request description: Taken from #29274 (except for two paragraphs that require the other commits in that PR). ACKs for top commit: maflcko: ACK c67f215 tdb3: ACK c67f215 Tree-SHA512: 321cc327bfbf0b8e55eb84cb259cf55a66d480c99abe6824248f8b5fdb9a31a079f7ce2c5a6c27afa809aa343d1efb0744a19dd379c17162b21fdf24b6b8836b
2 parents a19563a + c67f215 commit 5383637

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

.cirrus.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,44 @@ env: # Global defaults
88
CCACHE_DIR: "/tmp/ccache_dir"
99
CCACHE_NOHASHDIR: "1" # Debug info might contain a stale path if the build dir changes, but this is fine
1010

11+
# A self-hosted machine(s) can be used via Cirrus CI. It can be configured with
12+
# multiple users to run tasks in parallel. No sudo permission is required.
13+
#
1114
# https://cirrus-ci.org/guide/persistent-workers/
1215
#
13-
# It is possible to select a specific persistent worker by label. Refer to the
16+
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
17+
#
18+
# The following specific types should exist, with the following requirements:
19+
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
20+
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
21+
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
22+
#
23+
# CI jobs for the latter configuration can be run on x86_64 hardware
24+
# by installing qemu-user-static, which works out of the box with
25+
# podman or docker. Background: https://stackoverflow.com/a/72890225/313633
26+
#
27+
# The above machine types are matched to each task by their label. Refer to the
1428
# Cirrus CI docs for more details.
1529
#
16-
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
17-
# Specifically,
30+
# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1
31+
# ensures that previous containers and artifacts are cleared before each run.
32+
# This requires installing Podman instead of Docker.
33+
#
34+
# Futhermore:
1835
# - apt-get is required due to PACKAGE_MANAGER_INSTALL
19-
# - podman-docker-4.1+ is required due to the use of `podman` when
20-
# RESTART_CI_DOCKER_BEFORE_RUN is set and 4.1+ due to the bugfix in 4.1
36+
# - podman-docker-4.1+ is required due to the bugfix in 4.1
2137
# (https://github.com/bitcoin/bitcoin/pull/21652#issuecomment-1657098200)
22-
# - The ./ci/ depedencies (with cirrus-cli) should be installed:
38+
# - The ./ci/ dependencies (with cirrus-cli) should be installed. One-liner example
39+
# for a single user setup with sudo permission:
2340
#
2441
# ```
2542
# apt update && apt install git screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
2643
# ```
2744
#
28-
# - There are no strict requirements on the hardware, because having less CPUs
29-
# runs the same CI script (maybe slower). To avoid rare and intermittent OOM
30-
# due to short memory usage spikes, it is recommended to add (and persist)
31-
# swap:
45+
# - There are no strict requirements on the hardware. Having fewer CPU threads
46+
# than recommended merely causes the CI script to run slower.
47+
# To avoid rare and intermittent OOM due to short memory usage spikes,
48+
# it is recommended to add (and persist) swap:
3249
#
3350
# ```
3451
# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | tee -a /etc/fstab )
@@ -39,11 +56,6 @@ env: # Global defaults
3956
# ```
4057
# RESTART_CI_DOCKER_BEFORE_RUN=1 screen cirrus worker run --labels type=todo_fill_in_type --token todo_fill_in_token
4158
# ```
42-
#
43-
# The following specific types should exist, with the following requirements:
44-
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
45-
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
46-
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
4759

4860
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
4961
filter_template: &FILTER_TEMPLATE

0 commit comments

Comments
 (0)