Repository navigation
feat(cloud): build deploy images for the cluster's CPU architecture - #556
Open
fabriciojs wants to merge 3 commits into
Open
fabriciojs wants to merge 3 commits into
fabriciojs wants to merge 3 commits into
Conversation
kool cloud deploy built every image for linux/amd64 unless --platform said otherwise, and nothing checked --platform against the cluster: an image of the wrong architecture was pushed, and the deploy failed minutes later with no useful reason. - --platform now defaults to the platform Kool.dev Cloud returns for the cluster in the deploy/create response (linux/amd64 on the shared cloud, linux/amd64 or linux/arm64 on your own cluster) - when it returns none (an older Kool.dev Cloud, or a cluster not inspected yet) the CLI builds linux/amd64 and says so - an explicit --platform is sent to Kool.dev Cloud, which refuses one the cluster cannot run before anything builds; the CLI also refuses it when the response lists the cluster's architectures and it is not among them - on a cluster mixing architectures, it says how to pin services with a kubernetes.io/arch nodeSelector - help text, the command reference, the Building Images doc and the deploy skill explain it, with the FROM --platform=$BUILDPLATFORM builder pattern for JS builds that crash under QEMU Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Platform validation accepts malformed values, allowing them to reach deployment creation and potentially Docker instead of failing locally.
1 open issue
What changed in this PR
Makes kool cloud deploy select build platforms from the target cluster rather than always defaulting to amd64.
Changes:
- Uses cluster-reported platforms, with an amd64 fallback for older servers.
- Adds platform validation, compatibility checks, and mixed-cluster guidance.
- Adds tests and documentation for architecture-aware builds and emulation workarounds.
| File | Description |
|---|---|
| skills/kool-cloud-deploy/SKILL.md | Updates architecture and emulation guidance. |
| skills/kool-cloud-deploy/references/nextjs.md | Clarifies the runner architecture comment. |
| services/cloud/deployer.go | Sends explicit platform overrides to the API. |
| services/cloud/api/deploy_create.go | Adds cluster architecture response fields. |
| services/cloud/api/deploy_create_test.go | Tests platform requests and response decoding. |
| docs/05-Commands-Reference/kool-cloud-deploy.md | Updates generated help and platform defaults. |
| docs/02-Kool-Cloud/03-Building-Images-to-Deploy.md | Documents platform selection and native build stages. |
| commands/cloud_deploy.go | Integrates platform selection into deployment. |
| commands/cloud_deploy_platform.go | Adds platform parsing, validation, and resolution. |
| commands/cloud_deploy_platform_test.go | Tests platform handling and build detection. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- --platform accepts a bare architecture again (arm64 becomes linux/arm64, as docker reads it); a comma list is refused: a deploy builds one platform - the platform is always sent to deploy/create: the one asked for, or "auto" when the build follows the cluster's, so Kool.dev Cloud records and checks what a defaulted build produces too - the CLI no longer refuses a platform itself: Kool.dev Cloud's answer governs, including when its checks are set to warn or off - the mixed-cluster tip shows only when a service running the built image (imageFrom included) is not pinned with a kubernetes.io/arch nodeSelector - the architecture aliases match Kool.dev Cloud's (armv7, x64, i686, ...) - the build loop is a tested method: the resolved platform reaches the image build, and a failed build is reported to the deploy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed and why
kool cloud deploybuilt every image forlinux/amd64unless--platformsaid otherwise, and nothing checked--platformagainst the cluster. On a Mac with Apple Silicon, a coding agent deployed--platform linux/arm64to an amd64 cluster. The CLI accepted it and pushed the image, and the deploy failed about 5 minutes later with only a Go stack-trace fragment as the reason. Clusters you bring yourself can be arm64, so the right platform depends on the cluster.deploy/createresponse (deploy.cluster.architectures,deploy.cluster.platform). With no--platform, the CLI builds for that platform and prints which one.linux/amd64, as before, and says it is falling back.deploy/creategetsplatform: the one passed with--platform, orautowhen the build follows the cluster's.--platformformat. It islinux/<arch>[/<variant>], or a bare architecture (arm64is read aslinux/arm64, as docker does). A comma list is refused before anything is created: a deploy builds one platform.imageFromincluded) has nokubernetes.io/archnodeSelector, the CLI says how to pin it.kool cloud deploy --help(and the generated command reference), the "Building Images to Deploy" page and thekool-cloud-deployskill now explain this. They include theFROM --platform=$BUILDPLATFORMbuilder pattern for JS builds that crash under QEMU (Next.js Turbopack, esbuild, Rolldown).Not in scope, later work: native or server-side builds, so a Mac never has to emulate.
Release notes
--platformno longer defaults tolinux/amd64: it defaults to the cluster's architecture, as Kool.dev Cloud reports it.--platformis now validated before the deploy is created. A comma list (linux/amd64,linux/arm64) and anything that is not a Linux platform (windows/amd64) are refused. Docker accepted these before, so a CI job passing them will now stop with an error saying why. A bare architecture (arm64) still works.Compatibility
linux/amd64and says so. Theplatformfield is ignored.platform, so nothing is refused and behaviour is unchanged.How it was tested
go build ./...,go vet ./...,go test ./...(all pass)autoor the platform)imageFromincludeddeploy/createrequest/response round tripdocs/05-Commands-Reference/kool-cloud-deploy.mdwithgo run -tags kooldocs docs.go.🤖 Generated with Claude Code