diff --git a/doc/source/admin/components.rst b/doc/source/admin/components.rst index e2c197ce62..97f17f93fc 100644 --- a/doc/source/admin/components.rst +++ b/doc/source/admin/components.rst @@ -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 diff --git a/doc/source/admin/examples/docker-compose.yaml b/doc/source/admin/examples/docker-compose.yaml index 20c9d36226..99df901630 100644 --- a/doc/source/admin/examples/docker-compose.yaml +++ b/doc/source/admin/examples/docker-compose.yaml @@ -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: diff --git a/releasenotes/notes/jobdir_default-991bd60141045b68.yaml b/releasenotes/notes/jobdir_default-991bd60141045b68.yaml new file mode 100644 index 0000000000..ddb31d1c80 --- /dev/null +++ b/releasenotes/notes/jobdir_default-991bd60141045b68.yaml @@ -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. diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py index ba7426315d..ceb422eb4a 100755 --- a/zuul/cmd/executor.py +++ b/zuul/cmd/executor.py @@ -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")