From 5f83fec479043dde402cf44bf355132dc1d3a43b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 10 Oct 2017 14:39:43 -0700 Subject: [PATCH] Put /home/zuul/cache in place on test node images We use paths relative to the current user's homedir to find the location of the cached files for devstack. Unfortunately we only set up the symlink for that in Jenkins' homedir and not Zuul's. Update that so either user can find the cache. Change-Id: Iff9bcb9700ad5eab36cf8c42d5b6c145dee342b5 --- .../zuul-worker/install.d/60-zuul-worker | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nodepool/elements/zuul-worker/install.d/60-zuul-worker b/nodepool/elements/zuul-worker/install.d/60-zuul-worker index db2917bff9..a436c9da24 100755 --- a/nodepool/elements/zuul-worker/install.d/60-zuul-worker +++ b/nodepool/elements/zuul-worker/install.d/60-zuul-worker @@ -36,3 +36,19 @@ cp $_pub_key /home/zuul/.ssh/authorized_keys # cleanup everything to the right owner chown -R zuul:zuul /home/zuul + +# a lot of caching happens in extra-data.d (for "historical" reasons). +# We've put the cache stuff into /opt/cache/files, but again, for +# "historical" reasons, ensure this is available in /home/zuul +# +# We do this for zuul as well as jenkins users as relative paths to +# the current user's homedir are used in places like devstack-gate. +# +# Check if the cache exists as we don't have a strict dependency on the +# devstack-cache element. This allows you to build an image without +# incurring the cost of caching all the things. +if [ -d /opt/cache/files ] ; then + mkdir -p /home/zuul/cache + chown zuul:zuul /home/zuul/cache + ln -sf /opt/cache/files /home/zuul/cache/files +fi