Skip to content

chore(cli): bump pinned lablink-template to v0.3.1 - #498

Merged
7174Andy merged 1 commit into
mainfrom
andrew/chore-bump-template-v0.3.1
Sep 2, 2026
Merged

chore(cli): bump pinned lablink-template to v0.3.1#498
7174Andy merged 1 commit into
mainfrom
andrew/chore-bump-template-v0.3.1

Conversation

@7174Andy

@7174Andy 7174Andy commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Bumps the pinned infrastructure template to lablink-template v0.3.1 (TEMPLATE_VERSION + TEMPLATE_SHA256).
  • Adds the ssm:GetParameter permission that v0.3.1 now requires to the least-privilege policy in docs/aws-setup.md — without it, tofu plan fails for anyone following that section.
  • CHANGELOG entry covering the bump and the region-move warning.

Changes Made

packages/cli/src/lablink_cli/__init__.py

  • TEMPLATE_VERSION: v0.3.0v0.3.1
  • TEMPLATE_SHA256: 97f2f96c7bbdcaeeec8bd681394883409357613bbe40f97115a7a974d61a7660

docs/aws-setup.md

  • New AllocatorAmiLookup statement in the Option B custom policy: ssm:GetParameter on arn:aws:ssm:*::parameter/aws/service/canonical/*, plus an SSM row in the service table.

packages/cli/CHANGELOG.md

  • [Unreleased] → Changed entry noting the app.region fix, the stock-Ubuntu-via-SSM allocator boot, the new IAM requirement, and that existing us-west-2 resources are not moved when a config names another region.

Why the docs change belongs here

v0.3.1 drops the hardcoded allocator AMI in favor of

data "aws_ssm_parameter" "allocator_ami" {
  name = "/aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id"
}

The template's own scripts/setup.sh attaches ssm:GetParameter to the CI OIDC role, but CLI users deploy with their own credentials. The custom policy in docs/aws-setup.md had no SSM statement, so this bump would have broken every deploy that follows the least-privilege path. The managed-policy option (Option A) is unaffected — AmazonEC2FullAccess does not cover SSM either, but that path is already documented as intentionally broad; the fix targets the policy the docs actually enumerate.

Testing

  • Computed the tarball SHA-256 twice from https://github.com/talmolab/lablink-template/archive/refs/tags/v0.3.1.tar.gz — stable across both fetches.

  • Cleared ~/.lablink/cache/terraform/v0.3.1 and ran the real code path:

    Downloading infrastructure templates v0.3.1... done.
    v0.3.1 /Users/.../.lablink/cache/terraform/v0.3.1
    

    Checksum verification passes and all 21 template files extract (main.tf, alb.tf, backend*.hcl, user_data.sh, config/*.yaml).

  • PYTHONPATH=src uv run pytest in packages/cli: 829 passed, 1 deselected.

  • ruff check clean on the changed file.

Compatibility audit (why no CLI code changed)

Two items in v0.3.1's "Upgrading" notes looked like they could reach the CLI; neither does:

Release note Impact on the CLI
db: block must be password: only (#64, #65) The CLI's config schema exposes no db sub-keys at all, so generated configs already satisfy the strict schema.
app.region now drives the deployment (#70) main.tf still declares region, deployment_name and environment, so deploy.py's -var= calls remain valid. AMI_MAP's comment in schema.py already documented the SSM-based allocator boot.

The dev-uses-S3-state change (#63) only affects the template's own dev environment, which the CLI does not expose.

Updates TEMPLATE_VERSION and TEMPLATE_SHA256 (SHA-256 of the v0.3.1 source
tarball, verified through get_tofu_files()'s real download path).

v0.3.1 replaces the hardcoded allocator AMI with a per-region SSM lookup
(data.aws_ssm_parameter.allocator_ami), so deploy credentials now need
ssm:GetParameter on /aws/service/canonical/*. The least-privilege policy
documented in docs/aws-setup.md did not grant it, which would have failed
`tofu plan` for anyone following that section; the statement is added there.

No CLI code change is needed: main.tf still declares region, deployment_name
and environment, and the CLI's config schema has no `db` sub-keys, so the
release's strict-`db` requirement does not affect it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@7174Andy
7174Andy merged commit 8f88ab3 into main Sep 2, 2026
7 checks passed
@7174Andy
7174Andy deleted the andrew/chore-bump-template-v0.3.1 branch September 2, 2026 18:16
7174Andy added a commit that referenced this pull request Sep 8, 2026
Release prep. publish-pip.yml's version guardrail rejects a tag whose
version does not match pyproject.toml, so the bumps land on main before
the release tags are cut.

Allocator and client stay in lockstep at 0.4.0 as they have since 0.1.0;
the CLI is versioned independently and goes to 0.3.0.

The CLI's allocator pin is raised to >=0.4.0 this time: the CLI
re-exports MachineConfig, whose ami_id default became empty (= resolve
the per-region Deep Learning Base AMI, #489) in allocator 0.4.0. An
older allocator would silently reintroduce the stale hardcoded
us-west-2 AMI default that doctor's #490 fallback logic assumes gone.

CHANGELOG (CLI): new 0.3.0 section (#484, #485, #490, #491, #498), and
a backfilled 0.2.0 section — #481 tagged 0.2.0 without adding one
(#467, #472, #474, #479).

Also: README Docker <version> example moved to 0.4.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7174Andy added a commit that referenced this pull request Sep 8, 2026
Release prep. publish-pip.yml's version guardrail rejects a tag whose
version does not match pyproject.toml, so the bumps land on main before
the release tags are cut.

Allocator and client stay in lockstep at 0.4.0 as they have since 0.1.0;
the CLI is versioned independently and goes to 0.3.0.

The CLI's allocator pin is raised to >=0.4.0 this time: the CLI
re-exports MachineConfig, whose ami_id default became empty (= resolve
the per-region Deep Learning Base AMI, #489) in allocator 0.4.0. An
older allocator would silently reintroduce the stale hardcoded
us-west-2 AMI default that doctor's #490 fallback logic assumes gone.

CHANGELOG (CLI): new 0.3.0 section (#484, #485, #490, #491, #498), and
a backfilled 0.2.0 section — #481 tagged 0.2.0 without adding one
(#467, #472, #474, #479).

Also: README Docker <version> example moved to 0.4.0.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant