osmith has uploaded this change for review.

View Change

jobs/master,gerrit: use ccache to speed up builds

Related: OS#5848
Change-Id: I81f244ca09e660698df617549d70476fc96255e2
---
M jobs/README.adoc
M jobs/gerrit-verifications.yml
M jobs/master-builds.yml
3 files changed, 26 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/42/31042/1
diff --git a/jobs/README.adoc b/jobs/README.adoc
index 2533563..32da7c1 100644
--- a/jobs/README.adoc
+++ b/jobs/README.adoc
@@ -90,3 +90,15 @@
- hdlc
- osmo-gsm-tester
- podman
+
+*ccache*
+
+The jobs from master-builds and gerrit-verifications use ccache. View the
+statistics with SSH on the build nodes with:
+
+ $ CCACHE_DIR=~/ccache/gerrit-verifications ccache -s
+ $ CCACHE_DIR=~/ccache/master-builds ccache -s
+
+Note that running multiple jobs in parallel influence the ccache statistics,
+and it's impossible to tell which job caused which change in the stats (that's
+why they are not printed at the end of each job, it would be confusing).
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 9d1acb9..2eb6f3c 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -51,14 +51,17 @@
docker run --rm=true \
--cap-add SYS_PTRACE \
-e ASCIIDOC_WARNINGS_CHECK="1" \
+ -e CCACHE_DIR="/ccache" \
-e HOME=/build \
-e JOB_NAME="$JOB_NAME" \
-e MAKE=make \
-e OSMOPY_DEBUG_TCP_SOCKETS="1" \
-e OSMO_GSM_MANUALS_DIR="/opt/osmo-gsm-manuals" \
+ -e PATH="/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
-e PARALLEL_MAKE="$PARALLEL_MAKE" \
-e WITH_MANUALS="1" \
-w /build -i -u build \
+ -v "$HOME/ccache/gerrit-verifications:/ccache" \
-v "$PWD:/build" \
docker_img: '$USER/debian-buster-jenkins'
docker_img_erlang: '$USER/debian-bullseye-erlang'
@@ -666,6 +669,10 @@
description: set by gerrit-{repos} job

builders:
+ - shell: |-
+ CCACHE_DIR="$HOME/ccache/gerrit-verifications"
+ mkdir -p "$CCACHE_DIR"
+ chmod 777 "$CCACHE_DIR"
- shell: '{obj:cmd}'

publishers:
diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 7d1e6da..0ba3779 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -25,17 +25,20 @@
docker run --rm=true \
--cap-add SYS_PTRACE \
-e ASCIIDOC_WARNINGS_CHECK="1" \
+ -e CCACHE_DIR="/ccache" \
-e HOME=/build \
-e JOB_NAME="$JOB_NAME" \
-e MAKE=make \
-e OSMOPY_DEBUG_TCP_SOCKETS="1" \
-e OSMO_GSM_MANUALS_DIR="/opt/osmo-gsm-manuals" \
+ -e PATH="/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
-e PARALLEL_MAKE="$PARALLEL_MAKE" \
-e PUBLISH="1" \
-e SSH_AUTH_SOCK=/ssh-agent \
-e WITH_MANUALS="1" \
-w /build -i -u build \
-v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent \
+ -v "$HOME/ccache/master-builds:/ccache" \
-v "$PWD:/build" \
-v "$HOME/.ssh:/home/build/.ssh:ro" \
docker_img: '$USER/debian-buster-jenkins'
@@ -533,6 +536,10 @@
- timed: "H H * * *"

builders:
+ - shell: |-
+ CCACHE_DIR="$HOME/ccache/master-builds"
+ mkdir -p "$CCACHE_DIR"
+ chmod 777 "$CCACHE_DIR"
- shell: '{obj:cmd}'

publishers:

To view, visit change 31042. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I81f244ca09e660698df617549d70476fc96255e2
Gerrit-Change-Number: 31042
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange