Change default job_dir location

To increase the chances that job_dir and git_dir are on the
same filesystem in the default configuration, set the default
job_dir to /var/lib/zuul/builds.

Also, all zuul container images specify a volume at /var/lib/zuul,
therefore the docker-compose file does not need to specify the
same for the scheduler container.

Due to this, we were inadvertently running the executor with the
git_dir and job_dir on different filesystems in the quick-start.
That should no longer be the case.

Change-Id: I2fe5eea588006da7181c3ea8ad2637598764e8f1
This commit is contained in:
James E. Blair 2019-06-13 10:21:30 -07:00
parent 7e45f84f05
commit e5008494ec
4 changed files with 17 additions and 4 deletions

View File

@ -529,7 +529,7 @@ The following sections of ``zuul.conf`` are used by the executor:
cache.
.. attr:: job_dir
:default: /tmp
:default: /var/lib/zuul/builds
Directory that Zuul should use to hold temporary job directories.
When each job is run, a new entry will be created under this

View File

@ -54,7 +54,6 @@ services:
- "./etc_zuul/:/etc/zuul/:z"
- "./playbooks/:/var/playbooks/:z"
- "sshkey:/var/ssh:z"
- /var/lib/zuul
web:
command: "sh -c '/var/playbooks/wait-to-start-gearman.sh && zuul-web -d'"
depends_on:

View File

@ -0,0 +1,13 @@
---
upgrade:
- |
The default value for the :attr:`executor.job_dir` configuration
setting has been changed from ``/tmp`` to
``/var/lib/zuul/builds``. It is important for
:attr:`executor.job_dir` and :attr:`executor.git_dir` to be
located on the same filesystem, so this change increases the chances
that they end up on the same filesystem in most default configurations.
The ``builds`` subdirectory will be created if it does not exist,
however, ``/var/lib/zuul`` at least must exist and be writable by
the Zuul user.

View File

@ -18,7 +18,6 @@ import logging
import os
import sys
import signal
import tempfile
import zuul.cmd
import zuul.executor.server
@ -86,7 +85,9 @@ class Executor(zuul.cmd.ZuulDaemonApp):
job_dir=self.job_dir))
sys.exit(1)
else:
self.job_dir = tempfile.mkdtemp()
self.job_dir = '/var/lib/zuul/builds'
if not os.path.exists(self.job_dir):
os.mkdir(self.job_dir)
self.setup_logging('executor', 'log_config')
self.log = logging.getLogger("zuul.Executor")