From 2e276cbb09c47e177bca6c0bcd44aee53bb5a0b6 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 28 Apr 2023 10:29:58 -0400 Subject: [PATCH] docs: explain why docker-compose.jobs.yml exists Based on: https://github.com/overhangio/tutor/issues/642#issuecomment-1483970113 --- tutor/templates/local/docker-compose.jobs.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tutor/templates/local/docker-compose.jobs.yml b/tutor/templates/local/docker-compose.jobs.yml index 8b87f9f..37e116c 100644 --- a/tutor/templates/local/docker-compose.jobs.yml +++ b/tutor/templates/local/docker-compose.jobs.yml @@ -1,3 +1,16 @@ +# Tutor provides the `tutor MODE do JOB ...` CLI as a consistent way to execute jobs +# across the dev, local, and k8s modes. To support jobs in the docker-compose modes +# (dev and local), we must define a `-job` variant service in which jobs could be run. + +# When `tutor local do JOB ...` is invoked, we `docker-compose run` each of JOB's +# tasks against the appropriate `-job` services, as defined here. +# When `tutor dev do JOB ...` is invoked, we do the same, but also include any +# compose overrides in ../dev/docker-compose.jobs.yml. + +# Note that these services will all be `run` rather than `start`ed and `exec`ed. +# This is because jobs are often used for initialization tasks, which may need to +# happen before the service can be successfully `start`ed. + version: "{{ DOCKER_COMPOSE_VERSION }}" services: