Skip to content

Build the watcloud binary via Docker - #41

Open
alexboden wants to merge 1 commit into
mainfrom
40/build-binary-via-docker
Open

alexboden wants to merge 1 commit into
mainfrom
40/build-binary-via-docker

Conversation

@alexboden

Copy link
Copy Markdown

Motivation

Resolves #40. The cluster runs linux/amd64, but there was no easy way to build and test that binary from a dev machine (e.g. an arm64 laptop) or straight from a PR. Developers had to cross-compile by hand, and release.yml built the binary with an inline go build that nothing else reused.

Change

  • Add a Dockerfile as the single source of truth for building the binary. It produces a static linux/amd64 binary on any host and mirrors the former release flags (CGO_ENABLED=0, stripped, -trimpath), so the artifact is reproducible across local, CI, and release builds:

    docker buildx build --platform linux/amd64 --target binary --output type=local,dest=dist .

    The binary lands at dist/watcloud.

  • Add ci.yml (on pull_request): builds through the Dockerfile, uploads the watcloud-linux-amd64 artifact, and posts/updates a PR comment with a download link, checksum, and the build command — so a PR can be tested on the cluster before merge.

  • Point release.yml at the same Dockerfile instead of the inline go build, making the Dockerfile authoritative.

  • Document the Docker build flow in the README and add .dockerignore / dist/ ignore.

How to apply

No infra-config change required for the tooling itself. The next release still publishes a watcloud asset and the infra-config bump snippet is unchanged.

Checklist

  • Built the binary via the Dockerfile locally and confirmed it runs (watcloud --help in a linux/amd64 container).
  • Validated both workflow YAML files parse.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Test this build on the cluster

linux/amd64 watcloud binary for this PR (3588f42):

Or build this branch yourself — straight from GitHub, no clone needed:

docker buildx build --platform linux/amd64 --target binary --output type=local,dest=dist "https://github.com/WATonomous/watcloud-cli.git#40/build-binary-via-docker"

The binary lands at dist/watcloud. On WATcloud, start rootless Docker first (slurm-start-dockerd.sh) and drop --platform; see the README.

@alexboden
alexboden force-pushed the 40/build-binary-via-docker branch from 2917635 to 4d9299b Compare November 8, 2026 03:53
Add a Dockerfile as the single source of truth for building the binary and
route both CI and releases through it, so developers can build and test the
exact cluster binary without a local Go toolchain.

The cluster runs linux/amd64. Building that from an arm64 laptop previously
meant cross-compiling by hand; the Dockerfile produces the static linux/amd64
binary on any host via `docker buildx build --output type=local,dest=dist`.
It mirrors the former release flags (CGO_ENABLED=0, stripped, trimpath) so the
artifact is reproducible across local, CI and release builds.

ci.yml (new, on pull_request) builds through the Dockerfile, uploads the binary
as the watcloud-linux-amd64 artifact, and posts/updates a PR comment with a
download link, checksum and the build command, so a PR can be tested on the
cluster before merge. release.yml now builds through the same Dockerfile instead
of an inline `go build`, making the Dockerfile the authoritative build.

Resolves #40
@alexboden
alexboden force-pushed the 40/build-binary-via-docker branch from 4d9299b to f4ac8d6 Compare November 8, 2026 03:59
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.

Build binary via docker

1 participant