-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify workflow for mounting repositories from host #43
Comments
@regisb This one is also ready for a look. |
No, you were doing things just right. I agree that the "bindmount" workflow is too complex. A proper solution would be to declare all bind-mounts in the Thus, the question becomes: how do we make it easier to add volumes to the Could we consider the following syntax?
With such a command, every repository would auto-magically be bind-mounted to the right folder in the right container(s). With the plugin v1 API, I believe that we could have a rather lean implementation of that feature and make every plugin responsible for its own set of bind-mounts.
The automount option would generate a Preparation of the edx-platform repo ( |
+1 to everything here ^
👍🏻
Interesting! The syntax itself looks user friendly. I am curious about how the auto-magic part would work, though. Would tutor/plugins would need to look at the contents of each automounted folder to deduce where it should be bind-mounted in which containers? In a different direction, how would you feel about using configuration settings to set up bind-mounts? Something like this: kdmccormick/tutor#2. Then, the workflow would end up like this:
Plugins would be responsible for exposing settings allowing bind-mounting of repositories or other resources. Either way, I think we'd want to leave the Let me know your thoughts. |
Yes, exactly. There would be special logic in place for every plugin that would capture some of the
I have thought about this but I'm feeling reluctant. The reason is that tutor configuration and environments are portable. You can move them around from one computer to the next and they will keep working. If we add machine-specific information there, then we will lose that portability.
Yes, absolutely. |
That makes sense. I wouldn't want to break that simplifying assumption. The reason I suggested using configuration was to find a syntax more concise than:
But, if we allow relative paths and let
And for the average dev, who is working on one IDA at a time, the common startup command will just be:
|
WIP here: kdmccormick/tutor#8 |
@regisb I started hacking on this because I think it'd be great to be able to showcase it in the workshop. Here's my first stab at the helptext, which explains the precise syntax I'm implementing. It's almost exactly the same syntax you suggested, but I'm proposing calling it just "mount" instead of "automount", since the long, manual
|
@regisb I added an acceptance criteria and assigned this one to you. If you find you're too busy to finish this next week, let me know, and I'd be happy to try to finish it in time for the conference. |
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
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
Will be resolved by overhangio/tutor#643 |
The `--mount` option is available both with `tutor local` and `tutor dev` commands. It allows 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: 1. `--mount=service1[,service2,...]:/host/path:/container/path`: manually mount `/host/path` to `/container/path` in container "service1" (and "service2"). 2. `--mount=/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
The `--mount` option is available both with `tutor local` and `tutor dev` commands. It allows 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: 1. `--mount=service1[,service2,...]:/host/path:/container/path`: manually mount `/host/path` to `/container/path` in container "service1" (and "service2"). 2. `--mount=/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
Context
Desired workflow:
The docs recommend using
tutor dev bindmount
to extract a provisioned clone of edx-platform from the Tutor LMS container. I hit several issues:$(tutor config printroot)/volumes/edx-platform
was a bit of pain. I ended linking the repository to my home directory, but that's a lot of steps to ask a new developer to do.--volume=/openedx/edx-platform
to every command was cumbersome. Being able to add the mounts todocker-compose.override.yml
was a lot better, but still one more step.I ended up avoiding
tutor dev bindmount
after that and instead just did this:after which it was smooth sailing.
@regisb, was I using
tutor dev bindmount
wrong, and is there anything wrong with the workflow I ended up on? Either way, could we make it easier to get started with working on branches off of master?Acceptance
start
(proposed names:--automount
,--mount
). The option can be supplied multiple times in one command. Each use of the option should take an argument in one of the following forms:HOST_PATH
(automatic mount)SERVICE1,SERVICE2:HOST_PATH:CONTAINER_PATH
(manual mount)dir_name
argument and produces a list of(service, container_path)
tuples. Use this new filter to determine where directories should be auto-mounted, based on the basename of the directory.--mount
option with the same interface to Tutor'srun
command.--mount
option with the same interface to Tutor'sinit
command.bindmount
to something more fitting. Ideas:extract
,extractmount
,copyfrom
.WIP implementation
was started here: kdmccormick/tutor#8
The text was updated successfully, but these errors were encountered: