-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
add dev container run script #8994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
e427f5e
to
e35e3d2
Compare
e35e3d2
to
5ae16f8
Compare
This was referenced Sep 1, 2023
1e464e3
to
c2c6a89
Compare
simonrw
approved these changes
Sep 4, 2023
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.
Awesome work, just a couple of comments about finding the venv dir.
dfangl
approved these changes
Sep 4, 2023
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.
Nice changes 👍
c2c6a89
to
3e39943
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR introduces a script for developers that aims to replace
bin/docker-run.sh
and ultimately all its derivatives.We have several ways of starting what I call a "dev container", i.e., a localstack container with various mounted things like source folders or dependencies. Here are some:
bin/localstack-start-docker-dev.sh
make docker-mount-run
make test-docker-mount
make docker-run-tests
test-docker-mount-code
In ext:
bin/docker-run.sh
bin/test-in-docker.sh
make docker-mount-run
With the introduction of #8781 and #9050, there was an opportunity to unify some of the code necessary to start and configure such a dev container.
Moreover, with the growing amount of bootstrap tests (network configs, extensions, persistence, ...) there was a need to run these tests locally without having to build the image every time. So whatever configuration logic needed for a
docker-run.sh
replacement could be used there as well.Usage
This is what it looks like when you run a localstack container. The only main difference to
localstack start
is that it also mounts the source folders by default. The command also outputs the container config in a more human readable way:Here's the help:
Changes
ContainerConfigurator
implementations to encapsulate the configuration logic needed by the various startup scenarios, and add the newlocalstack.dev.run
scriptrun_interactive
method tolocalstack.utils.run
to attach the tty to a subprocess (in this casedocker run
)stream_container_logs
with the CmdDockerClientTesting
source .venv/bin/activate
python -m localstack.dev.run --help
To test ext:
localstack-ext
python -m localstack.dev.run -e LOCALSTACK_API_KEY=test
should now start a pro containerFuture work
Follow up PRs will include:
test-in-docker.sh
TODO