Repository navigation
build(docker): fetch the external components by running their placeholder scripts - #26205
Conversation
…lder scripts The images of bbb-webrtc-sfu, bbb-webrtc-recorder, bbb-webhooks and bbb-playback built their source from a git tag hardcoded in docker-bake.hcl, and bbb-record-and-playback downloaded bbb-presentation-video at a release hardcoded in its Dockerfile. Each version was pinned twice: there and in the <component>.placeholder.sh the package build runs, with a CI step to keep the two in sync. Every merge of v4.0.x-develop (no docker-bake.hcl) that bumps a component failed that step and needed a hand edit of the 4.1-only copy. The Dockerfiles now bind-mount their placeholder script from the repository root (named context "placeholders"; BuildKit transfers only that file) and run it, so the image and the package get the same version from the one file. The CI check has nothing left to compare and is removed. The sha256 pins of the bbb-presentation-video zip and the python3-perfect-freehand .deb go with the hardcoded release; the placeholder, like the packages, does not verify them.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 4
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ Automated tests are running... |
48f9ca2
into
bigbluebutton:v4.1.x-develop
|
The record-and-playback image used to verify |
What does this PR do?
Makes the container images of the external components fetch their source the way the package build does: by running
<component>.placeholder.shfrom the repository root. The version of each component is then pinned in one place only.docker-bake.hcl: thewebrtc-sfu,webrtc-recorder,webhooksandplaybacktargets no longer hardcode a git tag incontexts.src. They (andrecord-and-playback) get the repository root as a named contextplaceholders.docker/bbb-*/Dockerfile: the build stage bind-mounts its placeholder script from that context and runs it (BuildKit transfers only that one file, not the repository). The three Alpine build stages installgitfor the clone; the sfu stage already had it, and no longer needs thegit initit used to fake a repository fornpm install.record-and-playback/Dockerfile: downloads bbb-presentation-video and python3-perfect-freehand by runningbbb-presentation-video.placeholder.shinstead of its owncurlwith a hardcoded release..github/workflows/build-all-images.yml: the step that checked thatdocker-bake.hclmatched the placeholders is gone, since there is nothing left to compare.docker/README.md: updated accordingly.Closes Issue(s)
None.
Motivation
Every merge of v4.0.x-develop into v4.1.x-develop that bumps an external component fails the image workflow, because 4.0 has no
docker-bake.hcland nobody updates the copy of the tag there. #26198 is the current example: it bumps bbb-webrtc-sfu, bbb-webrtc-recorder and bbb-playback in the placeholders and fails onWith this change a placeholder bump on 4.0 merges into 4.1 with no edit to any 4.1-only file. Nothing changes on 4.0.
Alternatives considered: bake
variableblocks filled from the environment by a wrapper script arounddocker buildx bake(bake's HCL has no way to read a file, so a wrapper is unavoidable there). It keeps one source of truth too, but adds a script, five variables, three workflow edits, and plaindocker buildx bakestops working. Running the placeholder is less code and keeps the plain command working.How to test
docker buildx bake --print webhooksshowscontexts.placeholders = "."and no tag.docker buildx bake webhooks playback webrtc-recorder record-and-playback webrtc-sfu --load --set '*.platform=linux/amd64'builds all five (done locally for this PR).More
record-and-playback/Dockerfileverified sha256 sums of the bbb-presentation-video zip and the perfect-freehand .deb. The placeholder does not, so those pins are gone from the image (the packages never had them). If we want them back without maintaining them in two places, the follow-up is to add aSHA256=line and asha256sum -ctobbb-presentation-video.placeholder.shon v4.0.x-develop, which then benefits the packages too.docker buildx bake --printno longer shows which tag an image builds; the placeholder file does.