Repository navigation
Feat/docker codegen - #2
Conversation
setdefault() is rejected by protobuf >= 4.
Pinned toolchain, with generate and check commands.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
KevinRomanello
left a comment
There was a problem hiding this comment.
Nice direction overall: one versioned image as the single source of the generator is a big improvement. Two things I'd fix before merging (the .serializers-version marker logic and publishing without running check), plus a few suggestions inline. The setdefault → map[key].CopyFrom() fix is correct and still works with protobuf 3.20, so the legacy workflows are fine.
Merge order with eagletrt/telemetry-serializers#18: merge this → tag v1.0.0 → make the ghcr package public → merge #18.
KevinRomanello
left a comment
There was a problem hiding this comment.
It works but it has some problem and it can be improved
The path was taken from the text after 'proto/', so the generator failed with an IndexError when the input folder has another name, such as /in in the Docker image. The output is unchanged for the existing layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HoaykH7nb7C6u744T4xSG4
The marker only protected the first run: after writing into a wrong, non-empty folder, the next run deleted everything in it. generate now refuses a non-empty folder it did not create (unless --force), records the files it writes in .serializers-manifest and deletes only those. Add a clean command, and build in a temporary copy so that /opt/serializers is never written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HoaykH7nb7C6u744T4xSG4
Drop the world-writable /opt/serializers, now that every run works in a temporary copy. Cross-compile protoc-gen-jsonschema on the build platform (static, CGO_ENABLED=0) instead of building it under QEMU for arm64.
On a tag the image was pushed without running the tests. Build and load each platform, run check against the telemetry-serializers protos, then publish with the OCI labels and the major.minor tag too.
Without set -e a protoc failure was ignored. Also find the .proto files at any depth and drop the unused PROTO_FILES.
KevinRomanello
left a comment
There was a problem hiding this comment.
Re-review after the new commits (e4c1d1a).
CI: the image job is green: real Docker build with the real protoc-gen-jsonschema, then check passing on linux/amd64 and on linux/arm64 (emulated), both as a non-root user. Run Tests is green too.
Fixed, threads resolved:
- output folder:
generaterefuses a non-empty folder it did not create (unless--force) and deletes only the files listed in.serializers-manifest; newcleancommand; - every run works in a temporary copy,
/opt/serializersis no longer world-writable; - the image is tested on both platforms before being published; OCI labels and the
major.minortag are added; generate_schemasstops on the first protoc error and finds .proto files at any depth;- no more
pre-commit installfrom the generator; - README examples use
<version>instead of1.0.0(@radix54).
Blocker found and fixed while testing: utils.load_files took the path from the text after proto/, so with the image defaults (/in) both generate and check crashed with an IndexError. It now uses the path relative to the input folder; the output is byte-identical on the current layout.
Still open (non-blocking, team decisions): Python 3.14 and protoc from the official release instead of Debian, protobuf/lock file in requirements.txt, base images pinned by digest. See the open threads.
Merge order unchanged: merge → tag v1.0.0 → make the package public → merge eagletrt/telemetry-serializers#18.
…uirements protoc now comes from the official protobuf release (35.1, sha256-checked by ADD) instead of Debian, so it always matches the protobuf 7.35.1 runtime, which is now pinned in requirements.txt. The base image moves to python:3.14-slim-trixie.
What
generateandcheck.ghcr.io/eagletrt/serializers:<version>for linux/amd64 and linux/arm64 when avX.Y.Ztag is pushed.setdefault()on a map of messages is rejected by protobuf >= 4, so usemap[key].CopyFrom().Why
The generated code now depends only on the image version and on the protos, so
telemetry-serializerscan stop generating it and every project generates its own.Tested
checkwith protobuf 7.35.1 and protoc 3.21.12: 187 tests pass (also with 3.20.0).Not tested
The image has not been built yet, and the workflows have not run. The C++ output is unchanged and not tested.
After merging
Tag
v1.0.0to publish the image, and make the package readable bytelemetry-serializers.