From 931d46e6b0a06f8a97b1493a2e5e0de17bcaf327 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 6 May 2022 16:36:26 -0400 Subject: [PATCH 1/3] fix: mounts were not being rendered in dev mode Commit 514e3fce22d6c564831605677c45ec1564d803fa made it so that dev containers were to load mounts from env/dev/docker-compose.tmp.yml. However, it did not update the code to generates the docker-compose.tmp.yml files. This manifested as mounts simply not working in dev mode. Additionally, we make the docker-compose.jobs.tmp.yml files follow the same local vs dev differentiation that was introduced in 514e3fce22d6c564831605677c45ec1564d803fa. --- tutor/commands/compose.py | 5 +++-- tutor/commands/dev.py | 5 ++++- tutor/commands/local.py | 7 +++++-- tutor/hooks/consts.py | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) 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`) #: From 5d08438a7b563d521843983545e1ba3b909645e0 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 6 May 2022 16:43:48 -0400 Subject: [PATCH 2/3] docs: attribute @kdmccormick's changes since v13.2.0 --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 187fe64..eea76af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,16 +29,16 @@ Every user-facing change should have an entry in this changelog. Please respect - [Improvement] Add the `COMPOSE_PROJECT_STARTED` action and run `dev stop` on `local start` (and vice versa). (by @regisb) - [Feature] Introduce `local/dev copyfrom` command to copy contents from a container. (by @regisb) - [Bugfix] Fix a race condition that could prevent a newly provisioned LMS container from starting due to a `FileExistsError` when creating data folders. -- [Deprecation] Mark `tutor dev runserver` as deprecated in favor of `tutor dev start`. Since `start` now supports bind-mounting and breakpoint debugging, `runserver` is redundant and will be removed in a future release. -- [Improvement] Allow breakpoint debugging when attached to a service via `tutor dev start SERVICE`. +- [Deprecation] Mark `tutor dev runserver` as deprecated in favor of `tutor dev start`. Since `start` now supports bind-mounting and breakpoint debugging, `runserver` is redundant and will be removed in a future release. (by @kdmccormick) +- [Improvement] Allow breakpoint debugging when attached to a service via `tutor dev start SERVICE`. (by @kdmccormick) - [Security] Apply rate limiting security fix (see [commit](https://github.com/overhangio/edx-platform/commit/b5723e416e628cac4fa84392ca13e1b72817674f)). (by @regisb) - [Feature] Introduce the ``-m/--mount`` option in ``local`` and ``dev`` commands to auto-magically bind-mount folders from the host. (by @regisb) -- [Feature] Add `tutor dev quickstart` command, which is similar to `tutor local quickstart`, except that it uses dev containers instead of local production ones and includes some other small differences for the convience of Open edX developers. This should remove some friction from the Open edX development setup process, which previously required that users provision using local producation containers (`tutor local quickstart`) but then stop them and switch to dev containers (`tutor local stop && tutor dev start -d`). +- [Feature] Add `tutor dev quickstart` command, which is similar to `tutor local quickstart`, except that it uses dev containers instead of local production ones and includes some other small differences for the convience of Open edX developers. This should remove some friction from the Open edX development setup process, which previously required that users provision using local producation containers (`tutor local quickstart`) but then stop them and switch to dev containers (`tutor local stop && tutor dev start -d`). (by @kdmccormick) - 💥[Improvement] Make it possible to run `tutor k8s exec ` (#636). As a consequence, it is no longer possible to run quoted commands: `tutor k8s exec ""`. Instead, you should remove the quotes: `tutor k8s exec `. (by @regisb) - 💥[Deprecation] Drop support for the `TUTOR_EDX_PLATFORM_SETTINGS` environment variable. It is now recommended to create a plugin instead. (by @regisb) - 💥[Improvement] Complete overhaul of the plugin extension mechanism. Tutor now has a hook-based Python API: actions can be triggered at different points of the application life cycle and data can be modified thanks to custom filters. The v0 plugin API is still supported, for backward compatibility, but plugin developers are encouraged to migrate their plugins to the new API. See the new plugin tutorial for more information. (by @regisb) - [Improvement] Improved the output of `tutor plugins list`. (by @regisb) -- [Feature] Add `tutor [dev|local|k8s] status` command, which provides basic information about the platform's status. +- [Feature] Add `tutor [dev|local|k8s] status` command, which provides basic information about the platform's status. (by @kdmccormick) ## v13.1.11 (2022-04-12) From b55df07ebae774655c3407ff59c89eaadb228bdf Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 6 May 2022 16:42:05 -0400 Subject: [PATCH 3/3] v13.2.2 --- CHANGELOG.md | 4 ++++ tutor/__about__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eea76af..32725df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ Every user-facing change should have an entry in this changelog. Please respect ## Unreleased +## v13.2.2 (2022-05-06) + +- [Fix] Mounts were broken in dev mode. (by @kdmccormick) + ## v13.2.1 (2022-05-06) - [Fix] Fix broken file upload in studio because of unpinned studio-frontend requirement (see [discussion](https://discuss.overhang.io/t/missing-js-css-files-missing-from-openedx-docker-image-in-studio/2629) and [pull request](https://github.com/openedx/edx-platform/pull/30309)) (by @regisb. Thanks @uetuluk!). diff --git a/tutor/__about__.py b/tutor/__about__.py index 29c37b1..d4d8c5a 100644 --- a/tutor/__about__.py +++ b/tutor/__about__.py @@ -2,7 +2,7 @@ import os # Increment this version number to trigger a new release. See # docs/tutor.html#versioning for information on the versioning scheme. -__version__ = "13.2.1" +__version__ = "13.2.2" # The version suffix will be appended to the actual version, separated by a # dash. Use this suffix to differentiate between the actual released version and