-
Notifications
You must be signed in to change notification settings - Fork 423
Multiple devstack releases with one machine #532
Multiple devstack releases with one machine #532
Conversation
Thanks for the pull request, @ztraboo! I've created OSPR-4468 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. |
2ca6692
to
ea3e9e3
Compare
@kdmccormick I recent made this change to accommodate automatically naming the Docker compose project based on release. |
@ztraboo Thanks for the PR! I'll take a look when I can. Apologies in advance if the review is slow-moving. Devstack isn't my primary work, so I've been doing the best I can to fit in fixes and reviews around other projects. |
@ztraboo Thank you for your contribution. @kdmccormick This is ready for your review. |
57d2ce5
to
6cf8a88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this must have been a lot of finding-and-replacing. Nice!
Only a couple of comments from me. I still need to test this on my own devstack -- Hopefully I'll be able to do that on Monday. When I do, I'll let you know how it works for me.
@kdmccormick A lot of find and fix was more like it. Yeah there were several files touched so hopefully that doesn't complicate this update. |
@ztraboo Commenting to let you know I haven't forgotten about this. I upgraded to Ubuntu 20.04 a couple days ago and I'm still working getting my development environment set back up. |
@ztraboo, @kdmccormick, just a quick note that I'm about to test this on an Ubuntu 19.10 box, where there's already a master devstack installed, for the express purpose of testing juniper.rc2. Fingers crossed! If this works, it'll save me many hours of devstack rebuilding. |
...aaand it worked beautifully. +1 from me. |
ports: | ||
- "44567:4567" | ||
|
||
lms: | ||
command: bash -c 'source /edx/app/edxapp/edxapp_env && while true; do python /edx/app/edxapp/edx-platform/manage.py lms runserver 0.0.0.0:18000 --settings devstack_docker; sleep 2; done' | ||
container_name: edx.devstack.lms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this instead:
container_name: "${COMPOSE_PROJECT_NAME:-edx}.devstack.lms"
It would make container names more easily predictable by external services. I'm thinking of blockstore devstacks, for instance, which would otherwise need complicated changes due to this PR.
Tagging @bradenmacdonald and @kdmccormick for thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.lms"
For backwards compatibility with a minimal diff. You'd then be able to ditch the network alias below, and still have predictable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to focus on just making blockstore
(and blockstore-test) an (optional?) part of the regular edX devstack distribution, vs. adapting its idiosyncratic devstack setup.
CC @ormsbee - I'm not clear on the path to make that happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arbrandes My changes are based on what @kdmccormick mentioned here https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902/4 since docker compose environment variable COMPOSE_PROJECT_NAME
supports this out of the box with prefixing the container names with this project name.
COMPOSE_PROJECT_NAME
Sets the project name. This value is prepended along with the service name to the container on start up. For example, if your project name is myapp and it includes two services db and web, then Compose starts containers named myapp_db_1 and myapp_web_1 respectively.
https://docs.docker.com/compose/reference/envvars/#compose_project_name#compose_project_name
I'm using docker compose Aliases
to still allow containers to reach each other on the network.
https://docs.docker.com/compose/compose-file/compose-file-v2/#aliases
See example of how Aliases
are use here with this PR.
https://github.com/edx/devstack/pull/532/files#diff-d9f40066d6470c3b707e9bbb0ad21f74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bradenmacdonald I don't know what the specific complexities of adding Blockstore to devstack are, but if you added it like any other service (Registrar is a good example of how to do that), it would by default be an "optional service".
Only the services listed in DEFAULT_SERIVCES
in options.mk
are pulled, run, and provisioned by default - the others are ignored unless:
- they are specifically referenced, such as in
make dev.{up|pull|provision|etc}.blockstore
, or DEFAULT_SERVICES
is overridden inoptions.local.mk
to include more services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdmccormick Any update on testing this PR on your end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ztraboo I think there is some confusion here. When you change the COMPOSE_PROJECT_NAME
, it does not affect how containers address one another inside the network. Thus, setting the COMPOSE_PROJECT_NAME
does not imply that you should also define aliases.
Thanks for your patience @ztraboo . I'm doing comprehensive testing right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data separation: looks good!
I did the following:
- Provisioned one
devstack
and smoke-tested it. - Provisioned
devstack-other
and smoke-tested it. - Made a DB modification in
devstack-other
and confirmed it doesn't affectdevstack
. - Destroyed
devstack-other
and confirmed it doesn't affectdevstack
.
Nice 🥇
Backwards-incompatability with container names:
The old container names (edx.devstack.lms
, etc.) don't work. I figure that:
...
networks:
default:
aliases:
- edx.devstack.lms
doesn't actually make a container name alias, it makes a container network hostname alias. So edx.devstack.lms
is available as a hostname to containers on the network, but would not work in Docker commands like docker exec edx.devstack.lms
and such.
This isn't a dealbreaker, but it would be a breaking change for people who made custom scripts to integrate against devstack. I see two routes to address this:
- Set all the container names to
edx.${COMPOSE_PROJECT_NAME}.<service>
, thus keeping the default container names the same. - Make it a breaking change, but notify discuss.openedx.org of the potential breakage a few days before merging it. I could distribute the notification inside edX if you decide to go this route.
Cannot run multiple devstack simultaneously:
You probably realized this, but the hard-coded port numbers we have prevent multiple devstacks from being up at the same time. This isn't a problem, but should probably be made clear in the docs.
@kdmccormick I'm on board for whatever you recommend for a change here. Let me know if you'd like for me to add back in the container names as you describe above or keep the change and notify discuss.openedx.org accordingly. See this mentioned above If we add back in the container names should we remove the network alias? Just let me know what you prefer. I'm ok with either option that you mentioned above. Maybe someone else from the community can chime in here on option they prefer. I'm leaning more toward keeping a fixed container name to avoid issues mentioned here https://github.com/edx/devstack/pull/532#discussion_r425225387 Based on what I read about aliases here it should work but I see your point in that https://docs.docker.com/compose/compose-file/compose-file-v2/#aliases
|
Of the two options, I recommend adding the container names, mainly because it will make this change less controversial (and therefore more likely to merge soon :).
I do recommend removing the network aliases, as they are redundant with the
The |
96a0bba
to
626b46c
Compare
@kdmccormick I committed this change edx@626b46c, however, the test passed in Travis CI but when I try to re-provision my devstack > mongo > edx.devstack.mongo
|
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target. It also adds a couple of convenience Makefile targets.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target. It also adds a couple of convenience Makefile targets.
…e machine with multiple OPENEDX_RELEASES. (openedx-unsupported#548) This update works with latest PR https://github.com/edx/devstack/pull/532 to ensure that a PyCharm debug/run configuration can work for a given OPENEDX_RELEASE on a single machine.
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target. It also adds a couple of convenience Makefile targets.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target. It also adds a couple of convenience Makefile targets.
This allows for multiple edX devstacks (introduced via https://github.com/edx/devstack/pull/532) by letting the user specify which compose project to target. It also adds a couple of convenience Makefile targets.
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…ers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request openedx-unsupported#532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. openedx-unsupported#376 openedx-unsupported#377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with 59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
…tainers for multi-version devstack support https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902 Multiple devstack releases with one machine. This is in regards to this pull request https://github.com/edx/devstack/pull/532 Updating volumes for `themes` to work with the `ironwood` release. Applying these changes to get local devstack working for ironwood release. https://github.com/edx/devstack/pull/376 https://github.com/edx/devstack/pull/377 Moved `COMPOSE_PROJECT_NAME` update to `options.mk` file. Additional changes to get `devstack_docker` for Ironwood working multisite environment setup. Additional changes needed to make `docker` commands work making use of the `dev.print-container.%` target to get the container id. Reverting some of these commands back to `docker` type to align with what we did with edx@59f812e
This is the start of changing devstack to accommodate multiple releases (master, open-release-name) as mentioned here by @kdmccormick
https://discuss.openedx.org/t/docker-devstack-multiple-releases-one-machine/1902/4
Replace all the hard-coded container references like:
docker [exec|run|...] edx.devstack.<service>
with calls to docker-compose:
docker-compose [exec|run|...] <service>