Skip to content

Feat/migrate to lstk - #79

Open
bartsdev wants to merge 1 commit into
mainfrom
feat/migrate-to-lstk
Open

bartsdev wants to merge 1 commit into
mainfrom
feat/migrate-to-lstk

Conversation

@bartsdev

@bartsdev bartsdev commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the Python localstack CLI and awslocal with lstk everywhere in the action. Ephemeral Instances are still created through the LocalStack API.

 tools
-  pip install localstack
-  pipx install awscli-local[ver1]
+  npm install -g @localstack/lstk        # brew as fallback
 startup
-  docker pull $IMAGE &
-  IMAGE_NAME=… DNS_ADDRESS=… $CONFIGURATION localstack start -d
-  localstack wait -t $LS_WAIT_TIMEOUT
+  write lstk config: image, port, env profile from `configuration`
+  lstk start                             # waits until ready; backgrounded if skip-wait
 cloud-pods
-  localstack pod save|load NAME
+  lstk save|load pod:NAME
 local
-  localstack state export|import NAME.zip
+  lstk save|load NAME.snapshot           # still loads legacy NAME.zip
 ci / ephemeral / README
-  awslocal …
+  lstk aws …                             # honours AWS_ENDPOINT_URL
 ephemeral/startup
+  wait for $endpoint/_localstack/health before preview-cmd

Other changes:

  • configuration (KEY=VALUE …, shell quoting allowed) becomes an [env.setup_localstack] profile in the lstk config, so every variable reaches the container.
  • LOCALSTACK_API_KEY is copied into LOCALSTACK_AUTH_TOKEN and then unset. lstk forwards every LOCALSTACK_* variable to the container, and localstack-pro:3.2.0 fails to start when LOCALSTACK_API_KEY is present.
  • Ephemeral startup now waits until the instance answers /_localstack/health (up to LS_WAIT_TIMEOUT, default 180s). The create API can return before the instance is ready; awslocal hid that through the AWS CLI's retries, but lstk aws health-checks first and fails fast.
  • install-awslocal and skip-pull are kept as inputs that no longer do anything, and show a deprecation message when set.
  • CI now runs against latest instead of 3.2.0.

Evidence

  • Before: scheduled CI on main failed every week (run 46325297167). awslocal crashed with ModuleNotFoundError: No module named 'botocore.vendored'. fix: install awslocal with pipx to avoid distro botocore #78 patched that on main; this PR removes awslocal entirely.
  • After: LocalStack Test passes 6/6 on this branch (run 46432882873), and the ephemeral instance test passes (run 46432882883):
    ✓ Test LocalStack Version with Github Actions   # LOCALSTACK_API_KEY fallback, image-tag
    ✓ Test skip-pull uses a locally present image
    ✓ Test Cloud Pods Action        → ✓ Test Loading Cloud Pod
    ✓ Test Local State Save Action  → ✓ Test Local State Load Action
    
    The API-key fix was also checked on 3.2.0 (run 46429060349, 6/6).
  • Local checks (lstk 1.5.1):
    • The configuration values DEBUG=1 FOO_TEST="x y" QUOTE=a\"b show up unchanged in the container's env.
    • A .zip exported by localstack state export loads with lstk load.
    • An image present only locally starts when the pull fails (Could not pull …; using the local image).

Merge Danger

Door: two-way

Reverting the merge is easy. Shipping it in an immutable release (see 0.3.2) is the one-way step, so this should go out as a new minor version, not a patch.

Blast Radius: consumers

Breaking for users who upgrade (all listed in CHANGELOG.md):

  • The localstack and awslocal commands are no longer installed, so later steps that call them will fail. Use lstk save|load|snapshot and lstk aws instead.
  • Local state artifacts are now <state-name>.snapshot instead of <state-name>.zip. Old .zip artifacts still load.
  • Startup writes the default lstk config file (lstk config path). On self-hosted runners this overwrites an existing lstk config for the runner user.
  • skip-pull no longer prevents the pull. lstk always tries the registry and only falls back to the local image when the pull fails.
  • Runners need npm or brew to install lstk, and the aws CLI for lstk aws. Both are preinstalled on GitHub-hosted runners.

🤖 Generated with Claude Code

@bartsdev
bartsdev requested a review from a team as a code owner November 30, 2026 13:34
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The ephemeral instance for the application preview has been shut down

Install lstk instead of `pip install localstack` / awscli-local and use
it everywhere:

- startup: write an lstk config (image, port, env profile built from
  `configuration`, DNS_ADDRESS, CI_PROJECT) and run `lstk start`, which
  waits until ready; `skip-wait` runs it in the background
- cloud-pods: `lstk save/load pod:NAME`
- local: `lstk save/load NAME.snapshot`, still loads legacy NAME.zip
- ci, ephemeral test, README: `lstk aws` instead of `awslocal`
- copy LOCALSTACK_API_KEY into LOCALSTACK_AUTH_TOKEN and unset it, since
  lstk forwards LOCALSTACK_* into the container and older images
  (e.g. 3.2.0) fail to start with LOCALSTACK_API_KEY set
- ephemeral: wait for /_localstack/health before preview-cmd, as
  `lstk aws` health-checks the endpoint and fails fast
- deprecate `install-awslocal` and `skip-pull` (no effect)
- CI tests against the latest image instead of 3.2.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bartsdev
bartsdev force-pushed the feat/migrate-to-lstk branch from ffd1530 to c7d0833 Compare November 30, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants