Skip to content

feat: run the berth server from your own berth - #69

Merged
helightdev merged 4 commits into
mainfrom
server-image-from-binary
Nov 15, 2026
Merged

helightdev merged 4 commits into
mainfrom
server-image-from-binary

Conversation

@helightdev

Copy link
Copy Markdown
Owner

berth can now put itself into the server's image and run the server from it, without waiting for a release. Switching back to the published image works as before.

  • container/berth.Dockerfile is now only the runtime stage. It takes a static berth from its context. CI's image job uses the release's own x86_64 binary from the binary job and sets BERTH_SOURCE=published. berth embeds the same file, and a test checks it against the file the workflow names.
  • The image's labels: version, dev.berth.source (self-built or published), dev.berth.baseline and dev.berth.binary-sha256. The build stops when berth --version or the SHA-256 is not what was asked.
  • berth run NODE upgrade-server source=here asks the node for its CPU and checks that this berth is a static Linux ELF for it. It then sends a gzipped tar (Dockerfile, requirements.txt from the provisioning source, /proc/self/exe) as the new Act.input_b64. That goes over HTTP when it is larger than the portal carries. The server passes it to the controller's action on stdin. The helper checks it and runs docker build -t berth:VERSION -, which it skips when the tag already holds that binary, then swaps the container.
  • The client follows the node's session, not the server's job. When the connection drops because the server was replaced, it waits for the server to answer again and reads how the session ended.
  • upgrade-server version=X on a self-built image pulls from the baseline repository. Self-built images that no container uses are pruned down to the two newest.
  • berth server deploy [USER@]HOST does the same over the user's own ssh: it builds there, sends the helper on stdin and runs it with --image. It makes a new container when there is none. --release X goes back to the published image. berth server image builds with the local engine only.
  • The controller's upgrade-server can no longer be called through the controller proxy. It goes through the server's action, which needs the admin role.

Reviewers: the image job now waits for the whole binary matrix.

The Dockerfile no longer compiles berth. It takes a static build from its
context, so berth can carry the same file and build its own image on a server.
…is sent

With source=here the helper takes a build context on standard input and
builds berth:VERSION. A release from a self-built image goes back to the
baseline repository its image names, and unused self-built images are pruned
down to the two newest.
…ver deploy

berth run NODE upgrade-server source=here sends this berth's build context in
the new input_b64 of an action, over HTTP when it is larger than the portal
carries. The client follows the node's session and reads it again once the
replaced server answers.
@helightdev
helightdev merged commit e29591c into main Nov 15, 2026
23 checks passed
@helightdev
helightdev deleted the server-image-from-binary branch November 15, 2026 19:30
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