CI: run LocalStack via lstk instead of the localstack PyPI package - #25
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…job env) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| # The config pins the emulator image to the release version. It lives outside | ||
| # the workspace so the "Check Uncommitted Changes" step stays clean. | ||
| run: | | ||
| cat > "${RUNNER_TEMP}/lstk-config.toml" <<EOF |
There was a problem hiding this comment.
out of curiosity is it possible at all to change the chosen image without using the config ?
There was a problem hiding this comment.
Our decision back then was to consciously have the main way of doing this be the config file.
Could be that we added option overrides since then, but IMO both locally and in CI it's better to just have a clear file that defines your setup vs. attaching an increasing list of CLI parameters to your call.
aidehn
left a comment
There was a problem hiding this comment.
LGTM! Tests are passing so looks good! Thanks for picking this up - it means once we move away from the localstack CLI in our release there's less for us to do!
| - name: Install lstk | ||
| run: | | ||
| pip install --pre --upgrade localstack | ||
| npm install -g @localstack/lstk |
There was a problem hiding this comment.
hopefully at some point lstk releases a github action? 👀
There was a problem hiding this comment.
setup-localstack should probably handle the install in the future, yeah
Motivation
The release workflow installs
localstack==${RELEASE_VERSION}from PyPI just to start LocalStack for the SDK tests. This couples the SDK release to thelocalstackpackage release (published separately via localstack-cli-standalone, with no retry on PyPI propagation lag) and stands in the way of the planned deprecation of that package. The pinned Docker image is the actual dependency; the pip package is only the launcher.Changes
release.yml: installlstkvia npm instead ofpip install localstack==$VERSION; pin the emulator image through an lstk config file in$RUNNER_TEMP(outside the workspace, so the "Check Uncommitted Changes" gate stays clean).lstk start --timeout 2mreplacesstart -d+wait— it blocks until the emulator is healthy and dumps startup logs itself on failure.logs/stoppass the same--config, since the derived container name embeds the pinned tag.test.yml: same swap, no config file needed — lstk defaults tolocalstack/localstack-pro:latest.DEBUG/DISABLE_EVENTSbecomeLOCALSTACK_DEBUG/LOCALSTACK_DISABLE_EVENTS(lstk forwardsLOCALSTACK_*host env vars into the container).The Docker image pull remains the only release-time dependency on LocalStack itself.
Testing
Verified locally with lstk built from latest main: the exact pinned-style config plus
lstk --config … start --timeout 2m/logs/stopall pass, with DEBUG output visible in the logs (env forwarding works). Thetest.ymlpath runs on this PR; therelease.ymlpath is first exercised on the next release.Review
Workflow-only change. Worth a skim of the
release.ymldiff since that path only runs during an actual release. Notes for reviewers:portis required in an lstk[[containers]]block (omitting it fails validation), and a tag the license server can't parse degrades to in-container license validation instead of failing the start.Closes COSY-856
🤖 Generated with Claude Code