From be555e86e079e43f0d743b357040c765462d99e8 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Fri, 7 Oct 2022 16:19:35 +0200 Subject: [PATCH] jjb: ensure /log files are writable for deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bazel output of the action that compiles `DumpPlatformClassPath` is written in a non -writable directory. When we wipe the `log` directory with `find log/ --delete` that results in: /usr/bin/find: cannot delete ‘/workspace/log/execroot/eventsWikimedia /bazel-out/k8-fastbuild/bin/external/bazel_tools/tools/jdk /platformclasspath_classes/DumpPlatformClassPath.class’: Permission denied Unconditionally create the `log` directory and ensure all files are writables before deletion. Update gerrit-events-wikimedia-bazel-docker Bazel issue https://github.com/bazelbuild/bazel/issues/15616 Bug: T320251 Change-Id: Ia6dafa3e9bacd81c03e9ec35644c8a2893368e03 --- jjb/job-templates.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jjb/job-templates.yaml b/jjb/job-templates.yaml index 823faa4e9a..25d4df00d1 100644 --- a/jjb/job-templates.yaml +++ b/jjb/job-templates.yaml @@ -70,6 +70,18 @@ builders: - docker-castor-load - docker-src-dir + + # Ensure /log files are writable before deleting - T320251 + - shell: | + mkdir -m 2777 -p "log" + - docker-run: + image: docker-registry.wikimedia.org/buster:latest + entrypoint: /bin/chmod + options: >- + --volume "$WORKSPACE/log":/log + args: >- + -R u+w /log + - docker-log-dir - docker-ci-src-setup-simple - docker-run-with-log-cache-src: