diff --git a/tutor/commands/compose.py b/tutor/commands/compose.py index 53c0791..fd5d9bc 100644 --- a/tutor/commands/compose.py +++ b/tutor/commands/compose.py @@ -20,6 +20,7 @@ class ComposeJobRunner(jobs.BaseComposeJobRunner): self.docker_compose_files: t.List[str] = [] self.docker_compose_job_files: t.List[str] = [] self.docker_compose_tmp_path = "" + self.docker_compose_jobs_tmp_path = "" def docker_compose(self, *command: str) -> int: """ @@ -62,11 +63,11 @@ class ComposeJobRunner(jobs.BaseComposeJobRunner): ) tutor_env.write_to( serialize.dumps(docker_compose_tmp), - tutor_env.pathjoin(self.root, "local", "docker-compose.tmp.yml"), + self.docker_compose_tmp_path, ) tutor_env.write_to( serialize.dumps(docker_compose_jobs_tmp), - tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.tmp.yml"), + self.docker_compose_jobs_tmp_path, ) def run_job(self, service: str, command: str) -> int: diff --git a/tutor/commands/dev.py b/tutor/commands/dev.py index 46f500e..297671e 100644 --- a/tutor/commands/dev.py +++ b/tutor/commands/dev.py @@ -21,6 +21,9 @@ class DevJobRunner(compose.ComposeJobRunner): self.docker_compose_tmp_path = tutor_env.pathjoin( self.root, "dev", "docker-compose.tmp.yml" ) + self.docker_compose_jobs_tmp_path = tutor_env.pathjoin( + self.root, "dev", "docker-compose.jobs.tmp.yml" + ) self.docker_compose_files += [ tutor_env.pathjoin(self.root, "local", "docker-compose.yml"), tutor_env.pathjoin(self.root, "dev", "docker-compose.yml"), @@ -31,7 +34,7 @@ class DevJobRunner(compose.ComposeJobRunner): self.docker_compose_job_files += [ tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.yml"), tutor_env.pathjoin(self.root, "dev", "docker-compose.jobs.yml"), - tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.tmp.yml"), + self.docker_compose_jobs_tmp_path, tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.override.yml"), tutor_env.pathjoin(self.root, "dev", "docker-compose.jobs.override.yml"), ] diff --git a/tutor/commands/local.py b/tutor/commands/local.py index a26ee07..7e48175 100644 --- a/tutor/commands/local.py +++ b/tutor/commands/local.py @@ -21,7 +21,10 @@ class LocalJobRunner(compose.ComposeJobRunner): super().__init__(root, config) self.project_name = get_typed(self.config, "LOCAL_PROJECT_NAME", str) self.docker_compose_tmp_path = tutor_env.pathjoin( - self.root, "dev", "docker-compose.tmp.yml" + self.root, "local", "docker-compose.tmp.yml" + ) + self.docker_compose_jobs_tmp_path = tutor_env.pathjoin( + self.root, "local", "docker-compose.jobs.tmp.yml" ) self.docker_compose_files += [ tutor_env.pathjoin(self.root, "local", "docker-compose.yml"), @@ -31,7 +34,7 @@ class LocalJobRunner(compose.ComposeJobRunner): ] self.docker_compose_job_files += [ tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.yml"), - tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.tmp.yml"), + self.docker_compose_jobs_tmp_path, tutor_env.pathjoin(self.root, "local", "docker-compose.jobs.override.yml"), ] diff --git a/tutor/hooks/consts.py b/tutor/hooks/consts.py index f017944..5dfc122 100644 --- a/tutor/hooks/consts.py +++ b/tutor/hooks/consts.py @@ -142,7 +142,7 @@ class Filters: #: conditionnally add mounts. COMPOSE_MOUNTS = filters.get("compose:mounts") - #: Contents of the local/docker-compose.tmp.yml file that will be generated at + #: Contents of the (local|dev)/docker-compose.tmp.yml files that will be generated at #: runtime. This is used for instance to bind-mount folders from the host (see #: :py:data:`COMPOSE_MOUNTS`) #: