Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gtsiolis
Copy link
Member

@gtsiolis gtsiolis commented May 28, 2025

Motivation

Following up from a relevant discussion, this is an attempt to add a CLI option for selecting a stack (image, emulator).

Currently, the command to start LocalStack for Snowflake is quite verbose by using the IMAGE_NAME environment variable.

IMAGE_NAME=localstack/snowflake:latest localstack start

Changes

This will add --stack and -s as a shorthand for selecting the image and optional a version.

localstack start                      # default, starts localstack for aws (localstack image)
localstack start --stack snowflake    # starts localstack for snowflake (snowflake image)
localstack start -s snowflake         # starts localstack for snowflake (snowflake image)
localstack start -s snowflake:0.3     # starts localstack for snowflake (snowflake image, 0.3 version)
localstack start -s localstack:4.4     # starts localstack for aws (localstack image, 4.4 version)

Heads-up: We are experimenting with the Stacks terminology also in the Console, see https://github.com/localstack/localstack-web/pull/1787.

@gtsiolis gtsiolis added the area: cli LocalStack CLI label May 28, 2025
Copy link

github-actions bot commented May 28, 2025

Test Results - Preflight, Unit

21 579 tests  ±0   19 927 ✅ ±0   6m 55s ⏱️ +39s
     1 suites ±0    1 652 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 931f2af. ± Comparison against base commit a298730b.

♻️ This comment has been updated with latest results.

@click.option(
"--stack",
"-s",
type=str,
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

@gtsiolis gtsiolis May 28, 2025

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.

Copy link

github-actions bot commented May 28, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 15s ⏱️ +9s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 931f2af. ± Comparison against base commit a298730b.

♻️ This comment has been updated with latest results.

@gtsiolis gtsiolis added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label May 28, 2025
Copy link

github-actions bot commented May 28, 2025

Test Results - Alternative Providers

597 tests   420 ✅  15m 56s ⏱️
  4 suites  177 💤
  4 files      0 ❌

Results for commit 931f2af.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 28, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 42m 30s ⏱️ - 2m 23s
4 468 tests ±0  4 080 ✅ ±0  388 💤 ±0  0 ❌ ±0 
4 470 runs  ±0  4 080 ✅ ±0  390 💤 ±0  0 ❌ ±0 

Results for commit 931f2af. ± Comparison against base commit a298730b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 28, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 22m 44s ⏱️
4 823 tests 4 282 ✅ 541 💤 0 ❌
4 829 runs  4 282 ✅ 547 💤 0 ❌

Results for commit 931f2af.

♻️ This comment has been updated with latest results.

@gtsiolis gtsiolis self-assigned this May 28, 2025
@gtsiolis gtsiolis changed the title Add stack CLI option Add stack option for CLI start command May 28, 2025
@gtsiolis gtsiolis modified the milestones: 4.5, Playground May 29, 2025
@gtsiolis
Copy link
Member Author

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! 😃

@gtsiolis gtsiolis marked this pull request as ready for review May 29, 2025 08:17
@gtsiolis gtsiolis requested review from thrau and alexrashed as code owners May 29, 2025 08:17
@gtsiolis gtsiolis requested a review from silv-io May 29, 2025 08:18
@gtsiolis
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli LocalStack CLI semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants