Repository navigation
fix(docker): follow-up to the compose setup: review points, install, recording, Redis and docs - #26734
Conversation
|
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
|
361e12e to
685f8b4
Compare
|
Rebased onto Conflicts and what was kept:
Checks re-run locally on the new head (
|
|
Three overlaps with the open compose follow-ups (list in #26186 (comment)), so nobody polishes code that goes away:
|
tibroc
left a comment
There was a problem hiding this comment.
I went through the diff; nothing here breaks a package install. Two things I'd change:
1. setup-dev.sh fails when run again (docker/compose/setup-dev.sh:137). create_truststore now runs as $(id -u):$(id -g) instead of --user 0. A data/certs/cacerts written by the earlier version is owned by root with mode 0644, so the cp over it fails and set -e stops the script before configure_override. With rootless Docker/Podman the container's UID may also not be able to write data/certs. rm -f /certs/cacerts before the cp covers the first case; keeping --user 0 and chowning the file to the caller afterwards covers both.
2. The resque queue sends the main Redis password to a separate worker Redis (record-and-playback/core/lib/recordandplayback.rb:296-299). resque_redis uses redis_workers_password || redis_password. Before this PR the queue connection had no password at all (Rakefile:8-9, rap-enqueue.rb:48-49, rap-starter.rb:91-92). With redis_workers_host pointing to a Redis without auth and redis_password set for the main one, the queue now sends AUTH and Redis 6+ refuses it, so rap-starter, rap-enqueue and the workers fail. Falling back to redis_password only when redis_workers_host is unset keeps that setup working; the comment in bigbluebutton.yml could say the same.
Smaller, take them or leave them: a BBB_WEB_URL without a scheme (web:8090) only warns in shared-notes and leaves an empty host, so uploads go to http://:80/ (bbb-shared-notes-server/src/config/index.ts:52-60); failing at startup would be clearer. pids_limit: 256 on shared-notes-conversion counts all threads of the container, so 8 conversions at the unit's TasksMax=32 already reach it. The error in bbb-graphql-middleware/internal/gql_actions/client.go:169 names BBB_GRAPHQL_MIDDLEWARE_GRAPHQL_ACTIONS_URL, which is not read; the variable is GRAPHQL_ACTIONS_URL (older than this PR).
Checked and fine: nothing still sets the renamed variables; nginx with resolve in the upstreams passes nginx -t in the bbb-nginx image; shellcheck is clean on install.sh, certbot.sh, setup-dev.sh and init.sh.
…v.sh - Create the truststore with docker-compose.yml only: an override that already mounts data/certs/cacerts made Docker create it as a root-owned directory when the file was missing, and keytool then failed on every run. - Without an argument, set up the domain already in .env; with an argument that differs from .env, stop with a message instead of creating a CA and a certificate for another name. - Keep the last line of .env when it does not end with a newline.
v4.1.x-release has no docker/ directory yet, so the three links answered 404.
… setup docker-compose.yml and .env.sample pointed to a docker/README.md section that now only refers to the docs page; the development guide still asked for a .env that setup-dev.sh writes; and the community sentence in install.md had ended up under the Ansible heading.
The image had only DejaVu, so Chinese, Japanese and Korean text was missing from the exported PDF and Hindi and Thai showed as boxes.
… service As the systemd unit does with MemorySwapMax=0, TasksMax, CapabilityBoundingSet= and NoNewPrivileges. The docs name what still differs from the unit: one user and one /tmp for all conversions. pids_limit covers what eight units may use (TasksMax=32 each), the timeout process of each conversion and the listener (8 tasks when idle): 320. Eight conversions of a long document with images and CJK text peaked at 71 tasks, about 8 per conversion.
With 127.0.1.1 <domain> in /etc/hosts, as many hosts have, getent returned the loopback address first and install.sh wrote it to .env, noting only that it was fine behind NAT. It now takes the first address that is not a loopback address. When there is none, it leaves BBB_PUBLIC_IP empty, names the address it found and asks to set it in .env; compose refuses to start until then. The note for an address that is not on the host says what the address is used for.
Redis wrote its snapshot to an anonymous volume, which a new container does not reuse, so docker compose down and up lost it, with the events of recordings not archived yet and the queue of recordings to process. As for PostgreSQL, a named volume keeps it until docker compose down -v. The troubleshooting step for the PostgreSQL password now removes only the postgres volume.
…l changes in the override An upgrade now takes docker-compose.yml and docker/compose/ from the commit of the image tag by running install.sh again. Local changes go in docker-compose.override.yml, which install.sh never touches, instead of the files it replaces. The backup section names the override and the Redis volume.
…files With COMPOSE_FILE set, compose reads docker-compose.override.yml only when it is listed, so the example in the comments dropped the truststore that setup-dev.sh puts there. Same value as in the development guide.
Since the nginx image resolves graphql-server at run time, nginx follows the instances within about 30 s by itself.
bbb-apps-akka reads BBB_WEB_API as the API URL, with /bigbluebutton/api, while bbbWebAPI here is the base URL; one name for two shapes breaks a shared environment. The setting keeps its key, bbbWebAPI.
The message for a failed login to PostgreSQL suggested docker compose down -v, which now also removes the Redis volume with the events of recordings not archived yet and the recording queue. It names the postgres volume instead, as the troubleshooting section does.
As the other formats: the record-and-playback image has the podcast format, and the packages' scripts create published/podcast, recording/publish/podcast and its log directory owned by bigbluebutton.
…s bundle An empty or broken fullchain.pem, or a privkey.pem of another pair, in data/certs was written to the bundle as it was, and haproxy did not start at its next restart. certbot.sh now checks that the chain is a certificate and that the key matches it, keeps the current bundle otherwise and says why.
Without an email, install.sh asks to put the certificate in data/certs, which did not exist yet; docker created it as root on the first up.
A rerun of install.sh, as the upgrade section asks, kept .env and ignored the domain and email given: another domain went unnoticed, and the certificate hint appeared even with ACME_EMAIL in .env. A domain other than the one in .env now stops install.sh before it downloads anything, and the hint follows the email in .env.
deploy.sh applied the metadata of the checkout, whose BigBlueButton source reads HASURA_GRAPHQL_BBB_DATABASE_URL from the environment, but kept the installed unit. With a package from before that variable, the source was inconsistent. deploy.sh now installs the units of the checkout before it starts Hasura, as bbb-shared-notes-server/deploy.sh does.
The unit of a package from before the override moved has no NODE_CONFIG_DIR, so after deploy.sh the service ran the new code and ignored /etc/bigbluebutton/bbb-export-annotations/production.json without a word.
keytool ran as root, so data/certs/cacerts was left to root on the host. It still runs as root, which replaces a cacerts of an earlier run and can write to data/certs with rootless Docker or Podman, and then gives the file the owner of data/certs, which the script created as the caller. Running keytool as the caller instead failed on a second run over the root-owned file of the earlier version, before docker-compose.override.yml was written.
… URL Since the database URL of the BigBlueButton source moved into the packaged unit, a full copy of an older [email protected] in /etc/systemd/system hides it: the upgrade succeeds but the metadata is inconsistent, and --check said nothing. It now warns, and new-features.md explains what to do.
…iables of the shell bbb-record --rebuild with REDIS_HOST or REDIS_PORT exported in the root shell enqueues to that Redis, since rap-enqueue reads them like the services do.
…el on upgrade A moving tag such as v4.1.x-develop has no commit in its name and can be ahead of or behind the branch. The upgrade reads the commit the pulled images were built from, in org.opencontainers.image.revision, and downloads the compose files of that commit.
The upstreams were resolved when nginx started, so a service recreated alone with a new address (up -d --force-recreate <service>, or up -d after a change in .env) answered 502 until nginx restarted. Like graphql-server since bigbluebutton#26349, the upstreams of web, graphql-middleware, webrtc-sfu, shared-notes-server, html5-client and learning-dashboard now have a zone and resolve their names every 30 s; livekit keeps its fixed address. docker/README.md describes it, with the Kubernetes note: own files with the full service names, and several pods only behind a headless Service.
… the steps cron.daily took the formats to wait for from the installed process scripts. With a format installed but not in the steps, its .done never appears and no raw directory was ever removed: in the compose setup, whose image has five formats and processes presentation only, and on a server with a playback package installed but turned off. It now reads the formats the steps publish, and falls back to the installed scripts if the steps cannot be read.
No workflow ran the tests of bbb-graphql-middleware, the recording, bbb-shared-notes-server or bbb-export-annotations, and nothing checked the fixed list of files install.sh downloads against what docker-compose.yml mounts. The new workflow runs them on pull requests that touch those components or the compose files.
bbb-apps-akka uses BBB_WEB_API only to build the breakout rooms' join links, which the browser opens. The compose file set it to http://web:8090/bigbluebutton/api, a name only the compose network resolves, so joining a breakout room opened a blank page. It is now https://${BBB_DOMAIN}/bigbluebutton/api, as bbb-install sets it. The component-unit-tests workflow checks the value.
The notes' CSS asks for Arial and Liberation Mono. A package install has fonts-liberation; the image matched them to Noto Sans and DejaVu Sans Mono, so the exported PDF had other metrics than on a package install.
With ipv6.disable=1 on the kernel command line, nginx stops at start with "socket() [::]:8080 failed (97: Address family not supported by protocol)", and every service that waits for it stays down. An IPv6 address is not needed.
…ut a trailing slash bbb-export-annotations appends /bigbluebutton/... to the value, so http://web:8090/ gives //bigbluebutton/presentation/..., which bbb-web refuses with 403, and the captured whiteboard of a breakout room is not uploaded.
After a reboot, the stopped init container still refers to the paths its image volumes had before Docker restarted, and docker compose up -d and docker compose start stop at init with "cannot access path /var/lib/docker/rootfs/overlayfs/<id>/usr/share/bbb-graphql-server" (Docker 29 with the containerd image store). After docker compose stop and a reboot nothing starts. Removing init lets up -d create it again.
…parate queue Redis resque_redis used redis_password for the queue also when redis_workers_host points to another Redis. With a password on the main Redis and a separate queue Redis without one, AUTH was refused and rap-starter, rap-enqueue and the workers stopped. With redis_workers_host the queue now gets redis_workers_password, or no password.
…y waits for cron.daily took every line the Ruby snippet printed as a format. Without a journal, as in a container, the recording's logger writes to stdout too: with a REDIS_PORT that is not a number (Kubernetes sets REDIS_PORT=tcp://<address>:6379) the warning became a format with no .done, and no raw directory was removed, without a message. Only lines that are format names are kept now; the snippet is a function, with a test that runs it with that REDIS_PORT.
…e steps On a package install with a playback format installed but not in the recording steps, the daily cleanup now removes the raw files of recordings that the steps' formats published, where it used to keep every raw recording. new-features says so, with how to keep them.
…s' upstreams The image's bbb-html5.nginx and learning-dashboard.nginx proxy to the bbb-html5-client and bbb-learning-dashboard upstreams. A bbb-upstreams.conf written for the earlier image, with the five backends only, now stops nginx at start with host not found in upstream.
…ed or stops the service The warning said that bbb-export-annotations runs without an override it cannot read. That holds for a directory the service user cannot open, where the file is skipped and the defaults are used; a file it cannot read stops the service at start. The warning now names the case.
…ttp://host[:port] A value without a scheme threw an Invalid URL error at start, web:8090 was read as an empty host, and an https URL only gave a warning while the connection stayed plain http. These now stop the service with a message that names the expected form. A path after the host is still only a warning.
Moving the sentence about the community's installation options above the Docker Compose heading made the compose setup read as one of them. The section now says that Docker Compose is maintained in the repository and the other options come from the community.
…grade The upgrade snippet always downloaded from bigbluebutton/bigbluebutton. An install from another repository (BBB_REPO) now sets it once and passes it on.
… changes The export-annotations test checks docker/README.md and the compose job renders .env from .env.sample, but a change to either file alone did not run the workflow.
… actions URL error The error named BBB_GRAPHQL_MIDDLEWARE_GRAPHQL_ACTIONS_URL, which nothing reads. It now names graphql-actions.url in the configuration and the HASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL variable.
685f8b4 to
45a672b
Compare
⏳ Automated tests are running... |
de1e9e0
into
bigbluebutton:v4.1.x-develop
|
Thanks for the review, @tibroc. All of it went in before the merge:
On the overlaps: I rebased your follow-ups onto this PR and pushed to your branches. Your commits are unchanged apart from conflicts, with small commits of mine where the base moved:
#26694, #26695, #26703, #26710, #26692 and #26693 are merged. #26711 is not rebased; I will comment there. |
|
A test pass over Docker Compose, done. On a server with a public address, with the published images of that commit:
Bare metal, running now. A clean install with the packages CI built for that commit, and an upgrade from the packages of 14a60b9 (before the merges), with a recording before and after, |
|
Bare metal result, on the same commit (9204c21), with the packages CI built for it. Clean install. Upgrade from the packages of 14a60b9 (before the merges). Two things seen on the upgrade are older than these merges, with the same package scripts on the base: after a plain |
What does this PR do?
Follow-up to #26186 and to the configuration-by-environment PRs merged with it: the points of the second review by @antobinary (review) and what a test pass over the merged setup found, on bare metal (packages built by CI) and with Docker Compose on a server with a public address and a Let's Encrypt certificate. One commit per item; the tests are in the commits that need them.
#26714 broke the install command in the docs, and #26719 fixed it. #26714 removed
docker/compose/bbb-export-annotations.jsonwhileinstall.shstill downloaded it; withset -euandcurl -f, the 404 stopped the script before.envwas written. The new CI job (.github/workflows/component-unit-tests.yml) checks that every fileinstall.shdownloads exists and that every filedocker-compose.ymlmounts fromdocker/compose/is downloaded: on the tree of #26714 it fails, so it would have stopped that merge.Compose setup
install.sh: a loopback address from/etc/hosts(e.g.127.0.1.1 <domain>, the default on many cloud images) is no longer written asBBB_PUBLIC_IP; with no other address the script says so and leaves it empty. An existing.envfor another domain is refused.data/certsis created by the script when it asks for a certificate, so it does not end up owned by root.BBB_WEB_API, which defaulted to the internalhttp://web:8090/bigbluebutton/api, so the browser opened an address it cannot reach and the user never joined the room. The compose file now sets the public API URL. The new CI job checks it.docker compose downandupkeep the events of recorded meetings, the processing queue and webhooks registered through the API. When init asks to reset PostgreSQL, the command it shows removes only the postgres volume.resolvein the upstreams): a service recreated with a new address answers again within about 30 s without a reload, also after a reboot.memswap_limit,pids_limit,cap_drop: [ALL]andno-new-privileges, as in the systemd unit. The shared-notes image has the Noto fonts (Chinese, Japanese, Korean, Hindi, Thai, Arabic, Hebrew) and Liberation, so the PDF export matches a package install; the fonts add about 137 MB to the image (its apt layer grows from 362 MB to 499 MB,fonts-noto-cjkalone is 91 MB).stepsofrecording.yml. Log lines on stdout, as in a container, are no longer taken as formats (a warning aboutREDIS_PORTmade it keep every raw recording). The change on a package install is under Bare metal.Configuration by environment
REDIS_PORTandREDIS_PASSWORD; the recording readsREDIS_PASSWORDand uses it for the resque queue as well (with a password, recordings stopped in the queue, also on bare metal). A queue on another Redis (redis_workers_host) getsredis_workers_password, or no password, not the main one. AREDIS_PORTthat is not a number (Kubernetes setsREDIS_PORT=tcp://<address>:6379for a Service namedredis) is ignored with a warning in all four components.BBB_WEB_URL(bbb-apps-akka'sBBB_WEB_APIis the API URL, a different value). bbb-graphql-middleware reads the actions URL fromHASURA_BBB_GRAPHQL_ACTIONS_ADAPTER_URL, the name bbb-graphql-server reads for the same address, and its error for a missing URL now names that variable. The replaced names,BBB_WEB_HOSTin shared-notes-server andBBB_WEB_APIin export-annotations, came with feat(shared-notes): read the bbb-web, Redis and PostgreSQL hosts from the environment #26656 and feat(bbb-export-annotations): Add env override for bbb-export-annotations #26662 this week and are in no tag, so there is no fallback; @samuelwei, in case a deployment of yours already sets one of them.BBB_WEB_URLthat is nothttp://host[:port]stops it at start with a message that names the expected form (before,web:8090was read as an empty host and anhttpsURL only gave a warning)..github/workflows/component-unit-tests.yml).Bare metal
/etc/cron.daily/bigbluebutton) removes the raw files of a recording afterpublished_daysonce the formats in the recordingstepsare published. Before, it waited for every installed format: a server with a playback format installed but not in the steps kept every raw recording, and now removes the raw files of recordings published in the formats of the steps. This works in both directions: a format that is installed but not in the steps no longer keeps the raw files (they are removed afterpublished_days), and a format that is in the steps but not installed now keeps them forever.new-features.mdsays so.deploy.shof bbb-graphql-server and bbb-export-annotations installs the systemd unit, so a development deploy gets the new environment variables.bbb-conf --checkwarns about an export override in the old place, about one that bbb-export-annotations cannot read (saying whether the service skips it, for a directory it cannot open, or stops at start, for a file it cannot read), and about bbb-graphql-server running without its database URL.Docs
docker/README.mdlists every environment variable each image reads. The docs page covers:initafter a reboot.docker/README.mdalso says that bbb-export-annotations takesBBB_WEB_URLwithout a trailing slash, that an ownbbb-upstreams.confmust define the static apps' upstreams, and how the nginx image resolves Hasura; it no longer calls the recording image amd64 only. The html5 dev files list the override inCOMPOSE_FILE, and the docs no longer ask for an nginx reload after scaling Hasura.new-features.mdmentions Docker Compose, the new environment variables and the cleanup change;configuration-files.mdandnew-features.mddescribe the upgrade of the export-annotations settings from 4.0 correctly; the shared-notes config README describes how its configuration is loaded;bigbluebutton.ymlnotes thatbbb-recordfollows the Redis variables of the shell it runs in.install.mdkeeps Docker Compose apart from the community installation options, and the upgrade snippet downloads from the repository the server was installed from (BBB_REPO). The development guide runs bbb-export-annotations withrun-dev.sh.setup-dev.shgets the diff from the review: a stale override no longer turnsdata/certs/cacertsinto a root-owned directory, the truststore belongs to the caller and a second run replaces it, the domain in.envis used without an argument, and the last line of.envis kept without a trailing newline.Notes for an upgrade
Could not upload), because the old image readsBBB_WEB_API. The upgrade steps in the docs take the files from the commit in the image label.docker/compose/bbb-export-annotations.jsonare not read anymore since feat(Docker): export-annotions container to use environment instead of override file #26714; set them as environment variables indocker-compose.override.yml.bbb-html5.nginxandlearning-dashboard.nginxnow proxy to the upstreamsbbb-html5-clientandbbb-learning-dashboardof the image'sbbb-upstreams.conf. A deployment that mounts its ownbbb-upstreams.conf(asdocker/README.mdsuggests for Kubernetes) must add these two, or nginx stops at start withhost not found in upstream "bbb-html5-client". feat(docker): serve the HTML5 client, dashboard and player from the main nginx #26711 removes both location files, as it serves these apps from the main nginx, and with it the two upstreams.How was it tested?
Bare metal: packages from the CI artifacts of the base and of this branch on Ubuntu 24.04 VMs, the branch's files copied over them where no package was built. Compose: a server with a public address and Let's Encrypt, this branch's compose file and images built from it; a VM with a local CA for the upgrade from the merged setup. Development:
setup-dev.shon a clean checkout. Secrets were compared as hashes only. The end-to-end runs below were made on this branch before the last review rounds; the changes since (the queue password, the cleanup's format list, thebbb-confwarning, the notes'BBB_WEB_URLcheck, the conversionpids_limit, thesetup-dev.shtruststore and the actions URL name) were checked with the unit tests and the targeted runs in the last rows.@cisuite (736 tests) against the compose server!overrideonrecording.ymlBBB_SHARED_SECRETNOAUTH); after: publishedcron.dailywithREDIS_PORT=tcp://...and the logger on stdout; a queue Redis on another hostpresentation, the queue getsredis_workers_passwordor none6380,abc,tcp://..., empty) on the real imagesdocker/README.mdlists; bad ports ignored with a warningforceRelaywith 8 users and 4 cameras for 10 min; coturn relays only to LiveKit (other peers get 403)127.0.1.1asBBB_PUBLIC_IP(whatinstall.shwrote before).envand the override unchanged, all services healthy, old recordings play; the old export json stays and is not mountedBBB_SHARED_SECRETand--force-recreate./data,.envand the override into a fresh directoryinstall.shdockergroup, domain without A record, unknown branch, loopback-only/etc/hostssetup-dev.shcacertsof the earlier versionpids_limitedl/test_video.rb:26) is the same on the baseipv6.disable=1;172.30.82.0/24takenThe docs build passes and the links answer 200. ShellCheck passes on the scripts in
docker/compose/; inbbb-conf,cron.daily/bigbluebutton, the twodeploy.shand the export-annotationsafter-install.shthe findings are the same as on the base.