forked from overhangio/tutor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add --mount/--automount options to local/dev
The `--mount` and `--automount` options are available both with `tutor local` and `tutor dev` commands. They allow users to easily bind-mount containers from the host to containers. Yes, I know, we already provide that possibility with the `bindmount` command and the `--volume=/path/` option. But these suffer from the following drawbacks: - They are difficult to understand. - The "bindmount" command name does not make much sense. - It's not convenient to mount an arbitrary folder from the host to multiple containers, such as the many lms/cms containers (web apps, celery workers and job runners). To address this situation, we now recommend to make use of --mount and --automount options. 1. `--mount=service1[,service2,...]:/host/path:/container/path`: manually mount `/host/path` to `/container/path` in container "service1" (and "service2"). 2. `--automount=/host/path`: use the new v1 plugin API to discover plugins that will detect this option and select the right containers in which to bind-mount volumes. This is really nifty... Close openedx-unsupported/wg-developer-experience#43
- Loading branch information
Showing
15 changed files
with
354 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import unittest | ||
|
||
from click.exceptions import ClickException | ||
from tutor.commands import compose | ||
|
||
|
||
class ComposeTests(unittest.TestCase): | ||
def test_mount_option_parsing(self) -> None: | ||
param = compose.MountParam() | ||
|
||
self.assertEqual( | ||
[("lms", "/path/to/edx-platform", "/openedx/edx-platform")], | ||
param("lms:/path/to/edx-platform:/openedx/edx-platform"), | ||
) | ||
self.assertEqual( | ||
[ | ||
("lms", "/path/to/edx-platform", "/openedx/edx-platform"), | ||
("cms", "/path/to/edx-platform", "/openedx/edx-platform"), | ||
], | ||
param("lms,cms:/path/to/edx-platform:/openedx/edx-platform"), | ||
) | ||
self.assertEqual( | ||
[ | ||
("lms", "/path/to/edx-platform", "/openedx/edx-platform"), | ||
("cms", "/path/to/edx-platform", "/openedx/edx-platform"), | ||
], | ||
param("lms, cms:/path/to/edx-platform:/openedx/edx-platform"), | ||
) | ||
with self.assertRaises(ClickException): | ||
param("lms,:/path/to/edx-platform:/openedx/edx-platform") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.