-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add stack option for CLI start command #12675
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
Conversation
@click.option( | ||
"--stack", | ||
"-s", | ||
type=str, |
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 use click.Choice here to enforce only snowflake
can be used here
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.
Ah, nice one! Today I learned. Added in 714e323.
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.
Reverted the choice in 931f2af to make it more flexible to add versions next to the image.
localstack start -s snowflake
localstack start -s snowflake:0.3
Happy to go back to restricting this only to image name as a first iteration.
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.
We could subtype click.Choice
as well and that logic in there instead of the start command. But no need to optimize without knowing what we'll do with the CLI in the future yet :)
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.
For passing specific versions next to the image, we can also introduce another cli option that would look like:
localstack start -s snowflake -v 0.3.0
This was also mentioned in #12529 briefly to get ideas around it. Wdyt?
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.
Thanks @eruditmorina! I would still keep the {image}:{version} approach for simplicity, having a Docker-familiar syntax, not creating any confusion on what version (-v) is referring to (CLI, stack, or start command). Let me know if I'm missing something!
{image}:{version} | {image} -v {version} |
---|---|
![]() |
![]() |
Test Results - Alternative Providers597 tests 420 ✅ 15m 5s ⏱️ Results for commit dd2c462. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 2h 21m 55s ⏱️ Results for commit dd2c462. ♻️ This comment has been updated with latest results. |
Added opportunistically 4.5 as the milestone, but open to moving to 4.6 or Playground if this can't make it in time. Thanks @anisaoshafi for the nudge to add a milestone! 😃 |
Most of this was inspired by #12529, #12674, and the linked discussion in the PR description! Hat tip to @silv-io, @eruditmorina, @hovaesco, and @SimonWallner for sparking the discussion. ❤️ Looking for a code review since both code owners are OOO! Happy to make any changes or close the PR. |
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.
LGTM! Just have some minor suggestions
@click.option( | ||
"--stack", | ||
"-s", | ||
type=str, |
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.
We could subtype click.Choice
as well and that logic in there instead of the start command. But no need to optimize without knowing what we'll do with the CLI in the future yet :)
931f2af
to
9a48cb0
Compare
Co-authored-by: Silvio Vasiljevic <silvio.vasiljevic@gmail.com>
3e2221b
to
dd2c462
Compare
Rebased to run the pipeline with the latest changes from Merged! Thanks @silv-io and @eruditmorina for taking a look, inspiring this, and closing the draft PRs[1][2]! Added you both as co-authors. 🏂 🏂 🏂 Thanks also everyone involved in the early discussions of adding a CLI command or option for running |
Motivation
Following up from a relevant discussion, this is an attempt to add a CLI option for selecting a stack (image, emulator).
See also relevant discussion for more context.
Changes
This will add --stack and -s as a shorthand for selecting the image and optional a version.
Heads-up: We are experimenting with the Stacks terminology also in the Console, see https://github.com/localstack/localstack-web/pull/1787.