Rewrite kodkod as a docker-compose autoheal + auto-update helper#1
Merged
Conversation
Pivot the project from a Docker-in-Docker AI-agent isolation environment into a small Kotlin (2.4.0 / Gradle 9.5.1 / JDK 25) daemon that: - restarts unhealthy containers (autoheal), and - pulls and recreates containers when a newer image is published (auto-update), talking directly to the Docker Engine API over the unix socket with a single runtime dependency (kotlinx-serialization-json). Both jobs are opt-in per container via labels under a configurable namespace. Ships as a lightweight multi-stage BellSoft Liberica JRE Alpine image. Remove the old isolation files (Amazon Linux Dockerfile, SDKMAN multi-JDK setup, run.sh, entrypoint.sh, setup-alias.sh, tmux.conf, .bashrc, .env.example) and refresh CI to build/test the Kotlin app and image with the latest actions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… test
Multi-arch + --load fails ('docker exporter does not currently support
exporting manifest lists'). Build linux/amd64 only on pull_request (load +
smoke test), keep multi-arch build+push for main/tags.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Pivots the project from a Docker-in-Docker AI-agent isolation environment into a small Kotlin docker-compose companion that does two things:
docker-autoheal.Both jobs talk directly to the Docker Engine API over the unix socket (no
docker/compose CLI), and are opt-in per container via labels under a configurable namespace.Stack
kotlinx-serialization-json. HTTP-over-unix-socket (UnixDomainSocketAddress+ manual HTTP/1.1) and scheduling (ScheduledExecutorService) use the JDK only.Labels
kodkod.autoheal.enable— restart onunhealthykodkod.update.enable— pull + recreate when the image changeskodkod.stop.timeout— per-container stop timeoutConfiguration is via
KODKOD_*env vars (interval, monitor-all, cleanup, registry auth, …); see the README.How updates work
For each marked container: read its image ref (digest-pinned containers are skipped) → pull repo/tag → compare image ids → if changed, recreate (stop → rename old → create new from existing
Config/HostConfig/networks against the new image → start → remove old), with rollback on failure. The kodkod container never acts on itself.Verification
Tested end-to-end against real Docker (29.4.3 / API 1.54):
./gradlew build,docker build, the no-socket "nothing to do" exit-0 path, and bytecode = Java 25 (major 69) all pass.Cleanup
Removes the old isolation files (Amazon Linux Dockerfile, SDKMAN multi-JDK setup,
run.sh,entrypoint.sh,setup-alias.sh,tmux.conf,.bashrc,.env.example) and refreshes CI to build/test the Kotlin app + image with the latest GitHub Actions.🤖 Generated with Claude Code