Repository navigation
build(docker): use the new config options of #26170-#26175 in the images - #26217
Conversation
…g reads the environment
…rride the properties files
…APPENDER instead of sed
Needs the /etc/bigbluebutton/bbb-export-annotations.json override file in bbb-export-annotations; deployments mount it instead of setting variables.
…address Needs the SERVER_HOST support in bbb-graphql-middleware and bbb-shared-notes-server.
…ames The location files proxy to the upstreams of bbb-upstreams.conf. The image ships that file with the services' default names, as it does for the three static apps, so a deployment that uses these names mounts no nginx files. webhooks is optional, so nginx resolves it at run time through the container's DNS server and starts without it.
|
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
|
| && sed -i -e 's/listen 80;/listen 8080;/' -e 's/listen \[::\]:80;/listen [::]:8080;/' \ | ||
| /etc/nginx/sites-available/bigbluebutton \ | ||
| && sed -i 's/listen 127.0.0.1:8185;/listen 8185;/' /etc/nginx/sites-available/hasura-loadbalancer.conf \ | ||
| && sed -i -e 's/listen 127.0.0.1:8185;/listen 8185;/' -e 's/server 127.0.0.1:8085;/server graphql-server:8085;/' \ |
There was a problem hiding this comment.
In this new container setup, what does "two hasuras" mean in terms of configs/commands? https://docs.bigbluebutton.org/4.1/administration/customize/#number-of-hasura-instances
|
On bare metal, "two Hasuras" means a second In the containers it works the same way, except that the instances are replicas of one service. The nginx image keeps the balancer, listens on 8185 and has docker compose up -d --scale graphql-server=2
docker compose exec nginx nginx -s reload # nginx picks up the new instanceScaling down works the same way: reload nginx afterwards. Until then it keeps the old address, gets a connect error on it, and retries on the remaining instance (joins still worked, but some took about 18 s instead of 8 s). On Kubernetes you set One difference from bare metal: the image applies the metadata on every start (Hasura's cli-migrations entrypoint), while the package applies it once in after-install. I started two instances at the same moment three times. Each time one of them failed with a 409 "metadata resource version ... did not match", exited, and came up fine after the automatic restart. Both instances then reported consistent metadata, and join and recording tests passed with two instances. |
antobinary
left a comment
There was a problem hiding this comment.
I reviewed this against the merge base (cc4fed1) and the current v4.1.x-develop (9fffe59), and it merges cleanly. I built and ran the nginx image. I checked the other five images by reading the code, not by building them.
| Check | Result |
|---|---|
Every variable the images now rely on is read upstream: the ${?VAR} lines in akka's application.conf, BBB_LOG_FILE_APPENDER in both logback.xml, SERVER_HOST in graphql-middleware and shared-notes, the export-annotations override path, and bbb-web's environment-first property sources. All still there on current v4.1.x-develop |
PASS |
Every proxy_pass in the fragments the nginx image copies has an upstream in bbb-upstreams.conf, with the same six names as bbb-config's file |
PASS |
Service names and variables match the compose in #26186 (SECURITYSALT, BIGBLUEBUTTON_WEB_SERVERURL, REDISHOST, mounted bbb-export-annotations.json) |
PASS |
No key in bigbluebutton.properties maps to a variable the container already sets (HOSTNAME, HOME, PATH, JAVA_HOME, ...) |
PASS |
Nothing still refers to the deleted entrypoints or docker/bbb-apps-akka.conf |
PASS |
nginx image with --read-only, a tmpfs /tmp and stub backends: it starts and writes resolver 127.0.0.11 valid=30s; to /tmp/bbb-resolver.conf |
PASS |
/bigbluebutton/api/hooks without webhooks returns 502. Once webhooks starts it returns 200 within 30 s, with no reload |
PASS |
None of the following blocks the PR.
1. nginx logs an error every 30 s while webhooks is not running. resolve looks the name up again every valid=30s, whether or not anyone calls the hooks API. In the #26186 compose, webhooks is an optional profile, so in a default deployment this line repeats about 2,900 times a day:
[error] 27#27: webhooks could not be resolved (2: Server failure)
The minimum fix is a sentence in the README. Alternatively, the image could ship its own webhooks.nginx that resolves the name per request, as it already ships its own html5, dashboard and player fragments. I tested that on top of this PR:
- no log lines while idle, and one per actual request
- 502 without webhooks
- the first request after webhooks starts succeeds
With this change the webhooks address lives in the fragment instead of bbb-upstreams.conf, so the README paragraph needs a matching edit. proxy_redirect default cannot be combined with a variable in proxy_pass, so the fragment names the prefix explicitly:
--- a/docker/nginx/Dockerfile
+++ b/docker/nginx/Dockerfile
@@ -28,6 +28,8 @@ COPY bigbluebutton-web/loadbalancer.nginx \
# names, as bbb-upstreams.conf does for the backends.
COPY docker/nginx/bbb-html5.nginx docker/nginx/learning-dashboard.nginx docker/nginx/playback.nginx \
/usr/share/bigbluebutton/nginx/
+# webhooks is optional: this location resolves its name per request instead of in an upstream
+COPY docker/nginx/webhooks.nginx /usr/share/bigbluebutton/nginx/
# The base image's entrypoint renders the resolver for webhooks into /tmp at start (read-only root).
ENV NGINX_ENTRYPOINT_LOCAL_RESOLVERS=1 NGINX_ENVSUBST_OUTPUT_DIR=/tmp
COPY docker/nginx/bbb-resolver.conf.template /etc/nginx/templates/
--- a/docker/nginx/bbb-upstreams.conf
+++ b/docker/nginx/bbb-upstreams.conf
@@ -14,8 +14,3 @@ upstream bbb-webrtc-sfu {
upstream bbb-shared-notes-server {
server shared-notes-server:8787;
}
-# Optional service: resolved at run time, so nginx starts without it (502 until it runs).
-upstream bbb-webhooks {
- zone bbb-webhooks 64k;
- server webhooks:3005 resolve;
-}
--- /dev/null
+++ b/docker/nginx/webhooks.nginx
@@ -0,0 +1,11 @@
+# Pass to the webhooks app all requests made to the webhooks API. Optional service: the name is
+# resolved per request, so nginx starts and stays quiet without it (502 until it runs).
+location /bigbluebutton/api/hooks {
+ set $bbb_webhooks webhooks:3005;
+ proxy_pass http://$bbb_webhooks;
+ proxy_redirect http://$bbb_webhooks/ /;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $http_host;
+ proxy_set_header X-NginX-Proxy true;
+}2. The nginx image now needs the base image's entrypoint. Without the entrypoint, the resolver file is never written and nginx refuses to start:
nginx: [emerg] no resolver defined to resolve names at run time in upstream "bbb-webhooks" in /etc/nginx/conf.d/bbb-upstreams.conf:18
docker run --entrypoint nginx ... shows this, and a Kubernetes command: would cause it too, because it replaces the entrypoint. The README already says the nginx images use the base image's entrypoint. One sentence saying this is now required would help.
3. Variable names changed for anyone using the published develop images. bbb-web no longer reads SHARED_SECRET, SERVER_URL or REDIS_HOST. export-annotations no longer reads BBB_REDIS_HOST or BBB_WEB_HOST. A deployment that still passes the old names starts without an error, but bbb-web falls back to the default securitySalt from bigbluebutton.properties, and export-annotations falls back to 127.0.0.1. This affects only the v4.1.x-develop images, and #26186 already uses the new names, so a line in the PR description is enough.
4. A follow-up on the "two Hasuras" question, for a separate PR. Now that the image has a resolver, the Hasura upstream could resolve its name at run time too. Then --scale graphql-server=N would take effect within 30 s, without an nginx reload. On this nginx (1.30.6), least_conn accepts resolve: nginx -t passes. #26248 already adds the zone that resolve needs. In the Dockerfile's sed, the change would be server graphql-server:8085 resolve;. I only checked the config; I did not test scaling.
Nit: in akka-bbb-apps/Dockerfile, "the image's only includes the defaults" is missing a word. It should read something like "the image's file only includes upstream's defaults".
|
@antobinary thanks for the thorough review. Two new commits:
|
🚨 Automated tests failed |
dde29bf
into
bigbluebutton:v4.1.x-develop
v4.1.x-develop gained bigbluebutton#26219, bigbluebutton#26267, bigbluebutton#26217, bigbluebutton#26248, bigbluebutton#26348 and three Dependabot image bumps since 9fffe59. They merge cleanly; the merge is here so that the two commits that follow can change bigbluebutton-web/Dockerfile and build-all-images.yml as those files now are on 4.1.
Follow-up to #26170, #26171, #26172, #26173, #26174 and #26175. Those changes let the components read their settings in a way that works in a container, so the images no longer need their own workarounds. It also makes the bbb-nginx image work again: since #26175 its location files proxy to named upstreams (
bbb-web,bbb-graphql-middleware, ...), which only the bbb-config package defines; the image does not.One commit per component:
bbb-apps-akka.conf.application.confnow reads the secret, the service URLs and the database hosts from the environment. The image's file only includes the defaults. The README listsREDIS_PASSWORDtoo.SERVER_URL,SHARED_SECRETandREDIS_HOSTintobbb-web.properties. Environment variables now override the properties files, e.g.BIGBLUEBUTTON_WEB_SERVERURL,SECURITYSALT,REDISHOST.BBB_LOG_FILE_APPENDER=STDOUTreplaces thesedonlogback.xml.settings.json. Deployments mount/etc/bigbluebutton/bbb-export-annotations.json.SERVER_HOST=0.0.0.0replaces thesedon the default config.bbb-upstreams.confwith the default service names, and points Hasura tographql-server. nginx resolveswebhooksper request (the image ships its ownwebhooks.nginx), so it starts and stays quiet when webhooks is not running.Changed variable names (v4.1.x-develop images only)
bbb-web no longer reads
SHARED_SECRET,SERVER_URLorREDIS_HOST; it readsSECURITYSALT,BIGBLUEBUTTON_WEB_SERVERURLandREDISHOST. export-annotations no longer readsBBB_REDIS_HOSTorBBB_WEB_HOST; it reads the mounted/etc/bigbluebutton/bbb-export-annotations.json. A deployment that still passes the old names starts without an error, but bbb-web uses the defaultsecuritySaltfrombigbluebutton.propertiesand export-annotations uses127.0.0.1, so rename them when updating. The compose setup in #26186 already uses the new names.Tests
docker buildx bake.playback.nginx./bigbluebutton/api/hooksreturns 502 without webhooks. After webhooks starts it reaches webhooks, without restarting nginx.