misc/scratch: derive AMIs by architecture and add instance-type override#36935
Conversation
94d853f to
376c914
Compare
def-
left a comment
There was a problem hiding this comment.
provision.bash bumps Docker (29.5.3)
https://materializeinc.slack.com/archives/C01LKF361MZ/p1773310371789569
I'd recommend not upgrading to Docker 29 until this issue is resolved (edited)
I did just notice that we already were on Docker 29.1.3 though, ouch. At least for me locally it was pretty unusable having to kill containers many times.
Node (24.16.0 LTS), kind (0.32.0), and kubectl (1.36.1, kept within one minor of kind's cluster),
It's nice to have the same versions in bin/ci-builder too, so if you want to bump them also do it in ci/builder/Dockerfile please.
f3ef514 to
418a179
Compare
|
Thanks!
I removed your |
It's only in Nightly though.
Why only change it for |
418a179 to
1fbab47
Compare
Good point — PR CI won't exercise it. We'll kick off a Nightly against this branch to validate the kind/kubectl bump before merge; if Cloudtest goes red there, we pin kind/kubectl back to 0.29.0/1.24.3 in both files (Node/Compose can still move).
It's not just |
|
This doesn't look particularly borderless to me: Edit: Didn't see the new push, nevermind. |
We're also not using Ubuntu 26.04 anywhere else, but probably doesn't matter much: #36053 No nightly yet: https://buildkite.com/materialize/nightly/builds?branch=antiguru%3Ascratch-modernize I'm guessing cloudtest will fail the same way. |
1fbab47 to
3c0ff73
Compare
|
Nightly confirmed your TODO is still live — the kind/kubectl bump breaks Cloudtest: minio never comes up on the kind v0.32 / k8s 1.36 cluster (nightly 16717). upstream/main has no relevant fix since, so rebasing wouldn't help. Reverted kind/kubectl back to 0.29.0/1.24.3 in both files and restored your TODO. Kept Node 24.16 + Compose 5.0.1, and Docker on the 28 line. |
Enumerating one config file per instance size meant the AMI was copy-pasted across every config and the instance type was baked into each filename, which is how a recently added config ended up naming the wrong type internally. Centralize the two Ubuntu 26.04 AMIs in a single `AMIS_BY_ARCH` map and derive the AMI from the instance type's architecture, queried from EC2 via `describe_instance_types` (which also validates the type). Add `--instance-type` and `--size-gb` overrides to `create`, `go`, and `claude`; `--instance-type` works without a preset by synthesizing a default config, so arbitrary sizes no longer need a checked-in file. `MachineDesc.ami` becomes optional and the per-config `ami` field is dropped, leaving a single place to bump on the next release. Bump all configs to Ubuntu 26.04 and remove the now-redundant r6gd/r8gd presets. Also fold in a few obvious modernizations to the same tooling: replace deprecated `datetime.utcnow()` (which silently produced tz-offset `scratch-delete-after` epochs) with timezone-aware UTC, swap the deprecated `get_event_loop().run_until_complete` for `asyncio.run`, and avoid mutable default arguments. Bump the provisioned Node (24.16) and Compose (5.0.1) versions in lockstep across provision.bash and ci/builder/Dockerfile, staying on Docker 28 until moby#51845 is fixed. kind/kubectl stay pinned at 0.29.0/1.24.3 since newer versions break Cloudtest. And drop the obsolete ec2-instance-connect OpenSSL-3 workaround that Ubuntu 26.04 already ships. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3c0ff73 to
5b58072
Compare
Motivation
Enumerating one config file per instance size meant the AMI was copy-pasted across every config and the instance type was baked into each filename.
That is how a recently added config drifted to name the wrong instance type internally.
Description
Centralize the two Ubuntu 26.04 AMIs in a single
AMIS_BY_ARCHmap and derive the AMI from the instance type's architecture, queried from EC2 viadescribe_instance_types(which also validates the type).Add
--instance-typeand--size-gboverrides tocreate,go, andclaude;--instance-typeworks without a preset by synthesizing a default config, so arbitrary sizes no longer need a checked-in file.MachineDesc.amibecomes optional and the per-configamifield is dropped, leaving a single place to bump on the next release.All configs move to Ubuntu 26.04 and the now-redundant r6gd/r8gd presets are removed.
While here, the rest of the scratch tooling is modernized:
provision.bashandci/builder/Dockerfileso scratch matches CI: Node 24.16 and Compose 5.0.1. Docker stays on the 28 line until moby#51845 is fixed. kind/kubectl stay pinned at 0.29.0/1.24.3 — a Nightly run confirmed newer versions break Cloudtest (minio fails to come up on the kind cluster). The obsolete ec2-instance-connect OpenSSL-3 workaround is dropped — Ubuntu 26.04 already ships it fixed.bin/scratch listand the instance picker render a compact, borderless table (instance id first, relative expiry, no private IP) that fits a default terminal; CSV output is unchanged.datetime.utcnow()(which silently produced tz-offsetscratch-delete-afterepochs) is replaced with timezone-aware UTC,get_event_loop().run_until_completebecomesasyncio.run, and mutable default arguments are removed.🤖 Generated with Claude Code