Repository navigation
fix(build): migrate container image from archived rules_docker to rules_oci - #118
Merged
Merged
Conversation
…es_oci Mirror osskit/dafka-producer#40. rules_docker's GCS puller/loader binaries 403, so the image cannot build on main. Package the java_binary deploy jar with rules_oci; keep //src:image.tar and bazel/src:image contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
Same as osskit/dafka-producer#40. cp-kafka:7.2.2 ships Zulu 11.0.16.1, which NPEs under cgroup v2 (JDK-8287073) and kills ZooKeeper + broker before the wait strategy can match. 7.6.0 ships 11.0.21. Co-authored-by: Cursor <cursoragent@cursor.com>
Temurin 18 is EOL and still hits JDK-8287073 under cgroup v2. Bazel's persistent Javac worker initializes OperatingSystemMXBean and NPEs on ubuntu-latest. Producer #40 did not hit this (Scala workers). Force Javac to local execution; keep language level and runtime image on 18. Co-authored-by: Cursor <cursoragent@cursor.com>
guysegal
approved these changes
Aug 4, 2026
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 was broken
bazel build //src:image.tar— the target both the release workflow andyarn pretestdepend on — cannot complete on currentmain. Same class of breakages asosskit/dafka-producer#40(merged). This unblocksosskit/dafka-consumer#117(and transitively the DLQmax.request.sizeraise): #117's CI dies inpretestbefore any of its code compiles.1.
rules_docker's prebuilt Go binaries are gone (the hard blocker)container_repositories()declareshttp_filetargets pointing at a Google Cloud Storage bucket that no longer serves anonymous reads. Every one of them 403s:Reproduced on #117 CI (
actions/runs/30901027620) and on untouchedmain:rules_dockerwas archived by Google; re-pinning is not an option.2. Base image / JDK path
openjdk:18404s on Docker Hub (deprecated Official Image; Linux tags removed). This repo already pulledeclipse-temurin:18viarules_docker, with acontainer_imagesymlink/usr/bin/java→/opt/java/openjdk/bin/javasojava_image's entrypoint worked. Migrating torules_ocidigest-pinseclipse-temurin:18-jdkatsha256:1b8a5c3f...(JDK18.0.2.1+1, same digest as the18/18-jdktags today) and drops the symlink — the entrypoint isjava -cp /app/dafka-consumer.jar Main, and Temurin putsjavaonPATH.3. CI would not have honoured
.bazeliskrcanywaydocker.ymlandtest.ymldownloaded bazelisk v1.1.0, which predates.bazeliskrcsupport —USE_BAZEL_VERSION=6.4.0is silently ignored. Neither workflow pinned a JDK despite.bazelrcsetting--java_language_version=18.4. Kafka test harness (separate commit)
confluentinc/cp-kafka:7.2.2ships Zulu 11.0.16.1, which hits JDK-8287073 under cgroup v2 (JMX agent NPE kills ZooKeeper + broker). Bumped to7.6.0(Zulu 11.0.21) in a separate commit, same as producer #40.What changed
Migrated from archived
rules_docker(java_image) torules_oci, packaging thejava_binarydeploy jar — same shape as producer #40's Scala deploy-jar approach.WORKSPACE— dropio_bazel_rules_docker; addrules_oci1.8.0,rules_pkg0.9.1,aspect_bazel_lib2.7.7 (pinned ahead ofrules_oci_dependencies()for arm64 jq); bumpbazel_skylib1.0.3 → 1.4.2.src/BUILD—pkg_tar+oci_image+oci_tarball+copy_filesobazel build //src:image.tarstill writesbazel-bin/src/image.tarand loads asbazel/src:image.docker.ymlload/tag/push andpackage.jsonpretest are unchanged.CI — bazelisk v1.1.0 → v1.20.0 (+
PATH); Temurin 18 viasetup-java; checkout/node/login/metadata action major bumps.5. Bazel Javac workers on Temurin 18 (consumer-specific)
After the
rules_docker403 was gone, CI analysis succeeded but compilation failed:Same JDK-8287073, but in Bazel's persistent Javac worker under Temurin 18 (EOL; fix never landed on 18). Producer #40 did not hit this because it compiles Scala. Added
build --strategy=Javac=localin.bazelrcso Javac runs without that worker path. Runtime image stays oneclipse-temurin:18-jdk.Verification
Built in a Linux container (
eclipse-temurin:18-jdk+ build-essential + python3 + bazelisk v1.20.0,--platform linux/amd64) because this workstation has no local JDK 18. Loadedbazel/src:image, started the container with required env and no broker:Temurin-18.0.2.1+1JAVA_RUNFILES=/appas intendedGET /alive→200 trueNo image was published to any registry.
Follow-ups
#117should rebase / refresh frommainafter this merges — its branch was cut before this build fix.Made with Cursor