osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/31042 )
Change subject: jobs/master,gerrit: use ccache to speed up builds ......................................................................
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(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
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 e061b84..8b6c6e9 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' @@ -678,6 +681,10 @@ description: set by gerrit-{repos} job
builders: + - shell: |- + CCACHE_DIR="$HOME/ccache/gerrit-verifications" + mkdir -p "$CCACHE_DIR" + chown osmocom-build:osmocom-build "$CCACHE_DIR" - shell: '{obj:cmd}'
publishers: diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 270ffae..c0b7ea0 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' @@ -545,6 +548,10 @@ - timed: "H H * * *"
builders: + - shell: |- + CCACHE_DIR="$HOME/ccache/master-builds" + mkdir -p "$CCACHE_DIR" + chown osmocom-build:osmocom-build "$CCACHE_DIR" - shell: '{obj:cmd}'
publishers: