jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/380961 )
Change subject: docker: always set XDG_CACHE_HOME=/cache
......................................................................
docker: always set XDG_CACHE_HOME=/cache
Since running as nobody, the HOME ends up being /nonexistent which...
does not exist. That causes several warnings and even can cause a
command to abort when it is expecting to be able to create the image.
Set environment variable XDG_CACHE_HOME=/cache, will thus be used both
in a docker build and docker run.
Create the directory, and move the directories creation commands up to
be the first layer of ci-jessie.
Nuke /cache/pip after pip/setuptools get installed. Since they are run
as root, that causes the directory to belong to root. We dont need to
keep the cache in the layer anyway.
Pass it to tox which isolate the environment!
Change-Id: Ib75fae0cce76bbc0d0a468921b75c784e83c0e8d
---
M dockerfiles/ci-jessie/Dockerfile
M dockerfiles/tox/Dockerfile
M dockerfiles/tox/run.sh
3 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/dockerfiles/ci-jessie/Dockerfile b/dockerfiles/ci-jessie/Dockerfile
index fce937a..8acc964 100644
--- a/dockerfiles/ci-jessie/Dockerfile
+++ b/dockerfiles/ci-jessie/Dockerfile
@@ -2,6 +2,11 @@
ARG DEBIAN_FRONTEND=noninteractive
+# Cache directory, honored by multiple softwares
+ENV XDG_CACHE_HOME=/cache
+
+RUN install --directory --mode 777 "${XDG_CACHE_HOME}" /log /src
+
# Locale generation, auto generated by installing 'locales'
RUN apt-get update && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
@@ -13,5 +18,3 @@
rm -rf /var/lib/apt/lists/*
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
-
-RUN install --directory --mode 777 /log /src
diff --git a/dockerfiles/tox/Dockerfile b/dockerfiles/tox/Dockerfile
index ff5da53..8ccbded 100644
--- a/dockerfiles/tox/Dockerfile
+++ b/dockerfiles/tox/Dockerfile
@@ -13,7 +13,8 @@
apt-get remove --yes --purge python-pip && \
ln -s /usr/local/bin/pip /usr/bin/pip && \
pip install tox==2.5.0 && \
- pip install setuptools
+ pip install setuptools && \
+ rm -fR "$XDG_CACHE_HOME/pip"
USER nobody
WORKDIR /src
diff --git a/dockerfiles/tox/run.sh b/dockerfiles/tox/run.sh
index c3de4e8..9b2cfe5 100644
--- a/dockerfiles/tox/run.sh
+++ b/dockerfiles/tox/run.sh
@@ -20,4 +20,4 @@
git submodule --quiet update --init --recursive
# Run tests
-TOX_TESTENV_PASSENV=PY_COLORS PY_COLORS=1 tox -v | tee "${LOG_DIR}/stdout.log"
+TOX_TESTENV_PASSENV="PY_COLORS XDG_CACHE_HOME" PY_COLORS=1 tox -v | tee
"${LOG_DIR}/stdout.log"
--
To view, visit https://gerrit.wikimedia.org/r/380961
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib75fae0cce76bbc0d0a468921b75c784e83c0e8d
Gerrit-PatchSet: 4
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits