From 079fb1c9ec5f904d2bec065c7b1179da9517ca31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Tue, 5 Oct 2021 00:29:26 +0200 Subject: [PATCH] fix: bypass build to accelerate "local start" Previously, we were building all images every time we ran a "local start" command. This was causing unnecessary rebuild. Here, instead, we make use of the `docker-compose up --build`. This means that only the required images will be rebuilt. --- CHANGELOG.md | 2 ++ tutor/commands/compose.py | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32db045..12adfbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Improvement] Faster `tutor local start` by building only necessary images. + ## v12.1.5 (2021-10-25) - 💥[Improvement] Change the `settheme` command such that, by default, a custom theme is assigned to the LMS and the CMS, both in production and development mode. diff --git a/tutor/commands/compose.py b/tutor/commands/compose.py index 6495a1a..f092419 100644 --- a/tutor/commands/compose.py +++ b/tutor/commands/compose.py @@ -65,13 +65,11 @@ class ComposeJobRunner(jobs.BaseJobRunner): @click.argument("services", metavar="service", nargs=-1) @click.pass_obj def start(context: Context, detach: bool, services: List[str]) -> None: - command = ["up", "--remove-orphans"] + command = ["up", "--remove-orphans", "--build"] if detach: command.append("-d") config = tutor_config.load(context.root) - # Rebuild Docker images with a `build: ...` context. - context.docker_compose(context.root, config, "build") # Start services context.docker_compose(context.root, config, *command, *services)