Skip to content

[ci] Faster image builds without changing the images - #2663

Merged
DiegoTavares merged 88 commits into
AcademySoftwareFoundation:masterfrom
DiegoTavares:ci/phase-4-speed
Nov 23, 2026
Merged

DiegoTavares merged 88 commits into
AcademySoftwareFoundation:masterfrom
DiegoTavares:ci/phase-4-speed

Conversation

@DiegoTavares

@DiegoTavares DiegoTavares commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Related Issues

None filed. This is part 5 of 5 of the CI overhaul. It builds on #2649, #2655 and #2661, so until they merge this diff also shows their changes. This part alone: DiegoTavares/OpenCue@ci/phase-3-release...ci/phase-4-speed

Summarize your change.

Why: with the earlier parts in place, most of the remaining wait in CI is Docker image builds that redo work nothing changed: re-downloading every dependency after a one-line edit, running Cuebot's unit tests a second time inside the image build, and building an RPM that only a release needs.

What changes: the image builds are reordered so that dependencies are cached separately from source code, and work that was done more than once is done once. The images users pull behave the same, with one intended exception: the Cuebot image no longer carries a copy of the RPM.

Result so far, measured in CI with empty caches:

Before After
A pull request that runs everything 10.4 min 7.2–8.8 min
Runner time for that PR 78.7 min 67–70 min
Integration test 10.2 min 6.9–7.9 min
Cuebot image build 257 s 93–108 s

The bigger gains only appear once master has filled the caches, so they can't be shown until this merges (see "What to expect after merging").

What changed, by component

Cuebot image

  • Dependencies are downloaded in their own cached step, so a source change no longer re-downloads them.
  • The image build no longer runs the unit tests. They already run on their own, and nothing can be published or merged without that test job passing, so they now run exactly once.
  • The RPM is no longer inside the image (101 MB smaller). It is built as a separate output on master and still ships as a release asset. A plain docker build or docker compose up no longer pulls CentOS 7 to build an RPM nobody asked for.
  • Pull requests that touch the RPM's ingredients (the packaging files, the Dockerfile, the license) still build it, so a packaging mistake is caught before merge.
  • The jar that ships is checked byte-for-byte against the jar in the tested image.

RQD image

  • Dependencies are compiled in their own cached step. A change to rqd rebuilds two crates, not everything, and a change to another Rust crate doesn't rebuild the image at all.
  • With an empty cache this is no faster. Locally, with a warm cache, an rqd change builds in 17 s, down from 116 s.

REST gateway

  • go.mod and go.sum are now committed, so builds are repeatable and the code generators are pinned to exact versions. Before, CI used whatever was newest that day.
  • One script generates the code from the proto files, for the image, the tests and local development. The README and guides are updated to use it.
  • Tests: 1.55 min → about 0.4 min.

CueWeb image

  • Build caches that are never read at runtime are left out: 1.62 GB → 1.15 GB.
  • A deeper slimming of the image was considered and not done: the app reads its sources at startup, and removing development dependencies risks changing how it runs.

Python packages

  • All ten packages are built in one pass with a faster build tool: 41 s → about 13 s. The resulting files are identical.

Scheduler simulation

  • Cuebot is built once and shared with every scenario, where each scenario used to build it twice. Each scenario is about a minute shorter.
  • The simulator has a new SIM_SKIP_BUILD=1 switch for running against a jar you already built.

Considered and not done

  • Parallel linting: it is a few seconds faster, but the linter silently stops reporting circular imports in parallel mode.
  • Shallower checkouts: already in place wherever full history isn't needed to compute the version.

Do the images still behave the same?

Each image was built from the old and the new Dockerfile on the same commit, then compared file by file (path, permissions, owner, size and checksum) along with its configuration (user, ports, environment, command, entrypoint).

Image Configuration Contents
opencue/cuebot identical identical except the removed RPM; the jar is byte-identical
opencue/rqd identical the openrqd binary and resources are byte-identical; only package-manager log timestamps differ
opencue/rest-gateway identical the gateway binary and API description are identical; only log timestamps differ
opencue/cueweb identical all dependencies and sources are identical; the removed caches are gone. The compiled app differs in the same way two builds of the old Dockerfile already differ, because Next.js builds aren't reproducible

The RPM has the same metadata, install scripts and file list as before, with identical checksums for every file in it.

One caveat: the RQD comparison in CI ran on an earlier version of this change. For the final version the byte-identical binary was confirmed in a local build from the same base image.

What got slower

  • Master's integration job is 40–60 s longer, because the RPM is now built there as a separate step.
  • The RQD image with an empty cache is no faster, and within noise of the old time.
  • The scheduler simulation on a PR waits for the shared build first: 5.0 → about 5.5 min. It isn't the slowest job on a PR.

How it was verified

  • On this PR: four runs, all green with every check on, nothing re-run.
  • Master dry run in a throwaway PR with publishing off: green, the release bundle has the same 32 files as before, and all 11 scheduler scenarios passed.
  • The dry run caught one bug, now fixed: Docker was adding an extra metadata file to the release bundle.
  • 74 unit tests pass, including a new one for when a PR must build the RPM.

Not verifiable before merge: the warm-cache timings in CI, since only master fills the caches.

After merging

  • What to expect: compare the second master push's Cuebot, RQD and REST gateway image build times with the numbers above. That is where the caching shows.
  • Release notes: the opencue/cuebot image no longer contains the RPM under /opt/opencue (it is still a release asset), and the CueWeb image is about 470 MB smaller.
  • Possible next steps, not done here:
    • Build the Cuebot and RQD images in parallel in the integration test; today they build one after the other.
    • Make the bundle check fail on unexpected files, which would have caught the bug above without a dry run.
    • Pin the CentOS 7 RPM build image to an exact version.

LLM usage disclosure

Claude (Claude Code) implemented these changes and ran the checks and dry runs described above, at the direction of Diego Tavares.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Build & CI

    • Cuebot package builds now produce both the application archive and RPM through a dedicated packaging workflow.
    • Python package builds are consolidated, and simulator runs can reuse a prebuilt Cuebot archive.
    • REST gateway code generation now uses consistent, version-pinned tooling across local and automated builds.
  • Documentation

    • Updated REST gateway setup and deployment guides to reflect the current Go requirement and code-generation steps.
    • Added guidance for running simulator scenarios with an existing Cuebot build.

DiegoTavares and others added 30 commits November 19, 2026 14:30
The SonarCloud workflow failed on every master push (53 of 53 runs) because
the scanner no longer accepts Java 17, and nobody acted on the results.
Remove the workflow, sonar-project.properties, the coverage script it was the
only user of, and the org.sonarqube plugin and config in cuebot/build.gradle.

Co-Authored-By: Claude <noreply@anthropic.com>
GitHub no longer serves the macos-14 label ("The configuration
'macos-14-arm64-us-default' is not supported"), so every master packaging
run since 10 Nov was cancelled at the macOS jobs and the S3 upload in
create_other_artifacts was skipped. Use macos-15 in packaging and release;
x86_64-apple-darwin keeps cross-compiling from the arm64 runner.

Co-Authored-By: Claude <noreply@anthropic.com>
monitor_server_output only checked its deadline after reader.lines() yielded
a line, so a silent dummy-cuebot blocked the test forever. That hung
windows-tests until the 60-minute job timeout on 54 of 55 sampled runs and the
Linux build job on 27% of runs.

- Read child stdout and stderr on background threads and wait on a channel
  with recv_timeout, so the deadline holds without output. The server is
  killed and reaped on timeout.
- Drain openrqd's output the same way. It logs at debug level to a pipe
  nobody read, which can fill and stall rqd.
- Add a test that feeds the monitor a silent child.
- Run Rust tests with cargo nextest. A test is killed after 90s, and the
  integration binary runs in a single-threaded group since nextest gives each
  test its own process and the in-process mutex no longer serializes them.
- Pre-build the release dummy-cuebot outside the per-test timeout, and drop
  the job timeouts to 15 minutes (Linux) and 20 minutes (Windows).

Co-Authored-By: Claude <noreply@anthropic.com>
run_integration_test.sh built opencue/cuebot and opencue/rqd, then docker
compose up built its own copies because those services had build: and no
image:. On a layer cache miss the second build ate the 5-minute wait and the
job failed with "Timed out waiting for Docker compose".

- Name the flyway, cuebot and rqd images in docker-compose.yml so compose
  reuses the images the script builds, and start it with --no-build.
- Build the flyway image in the script alongside the others.
- Print the build log whenever an image build fails (it was only printed for
  RQD), and the tail of the compose log when the wait times out.

Co-Authored-By: Claude <noreply@anthropic.com>
The nightly Maestro run was red on 66% of nights, mostly COMPLETIONSTORM
failing its peak tick threshold (65% of nights) and SOLOFILL (14%). Those
thresholds measure the shared runner as much as the scheduler, so a red
nightly stopped carrying information.

Run both with continue-on-error and record every scenario's numbers (peak
tick, post-op queue, lost reports, fill ratio, throughput) as a JSON artifact
kept for 90 days, so the thresholds can be reset from the observed
distribution before they gate again. Logs are archived for a report-only
failure too.

Co-Authored-By: Claude <noreply@anthropic.com>
- Declare opencue_cuegui_path as an output of the Testing pipeline's build
  job. It was never declared, so CueGUI tests ran pip install "[test]" and
  the install matrix silently skipped the cuegui wheel. That wheel requires
  Python > 3.7, so the 3.7 install leg leaves it out.
- run_gui_test.sh: run with set -eo pipefail and decide on pytest's exit
  code, recorded inside the xvfb session so an xvfb-run crash on exit still
  cannot fail a passing run. Grepping for "N failed" let collection errors
  pass.
- Write the commit SHA into build_metadata.json with ${GITHUB_SHA}.
  $(BUILD_SOURCEVERSION) is Azure syntax and produced an empty commit.
- Drop the lint job's "Set package vars" step, which exported into a shell
  that exited immediately.
- Move checkout@v3, configure-aws-credentials@v1, login-action@v2 and the
  composite action's upload-artifact@v4 to current majors (v7, v6, v4, v7).

Co-Authored-By: Claude <noreply@anthropic.com>
Two jobs ran to GitHub's 6-hour limit stuck in apt-get, and neither had a
timeout. Superseded PR pushes kept running to the end because the Testing and
Rust workflows had no concurrency group.

- Give every job a timeout-minutes of roughly three times its median
  duration over recent successful runs, at least 10 minutes for jobs that
  pull containers or build images, and at most 30 minutes. Manual
  Maestro sim runs keep a longer ceiling because they can pick the full-farm
  scenarios.
- Cancel in-progress Testing and Rust runs when a pull request gets a new
  push. Master pushes are grouped by commit, so every commit still runs.
- Install protoc for the REST gateway tests with a pinned setup-protoc
  instead of apt-get.

Co-Authored-By: Claude <noreply@anthropic.com>
…dows

Killing cmd left its ping child holding the pipe, which nextest reported as a
leak.

Co-Authored-By: Claude <noreply@anthropic.com>
The CI containers have no bare pip on PATH. Without set -e that failure was
ignored and the tests hit a collection error that the old grep counted as a
pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Building a Host or Job wrapper opens a gRPC stub, so TempCellHelpersTests and
UtilsViewerTests tried to reach a real cuebot. Whichever ran first failed. CI
never noticed because the CueGUI tests were not actually running.

Co-Authored-By: Claude <noreply@anthropic.com>
Naming the services' images opencue/cuebot and opencue/rqd made a plain
`docker compose up` on a clean machine pull the released images from Docker
Hub instead of building the checkout. Leave docker-compose.yml as it was and
have the script build the services with `docker compose build`, so
`up --no-build` runs exactly what was just built. On a build failure, print
the last 300 lines of the log; the full log is in the test-logs artifact.

Co-Authored-By: Claude <noreply@anthropic.com>
Recording and uploading metrics is reporting only; a bug there must not turn a
report-only scenario red.

Co-Authored-By: Claude <noreply@anthropic.com>
On CY2024 the tests all passed and Python then segfaulted on exit in Qt
teardown, failing the job with 139. Run pytest through pytest.main and leave
with os._exit, so its own exit code decides and teardown never runs.

Co-Authored-By: Claude <noreply@anthropic.com>
rqd sometimes fails to report completion of a frame recovered after a
restart: the restarted rqd keeps reporting the frame as running after it
exited. With the hang fixed this fails in about 43 s instead, but still turns
roughly a quarter of runs red. Retry only the test_rqd_restart_* tests, up to
twice; nextest reports a pass on retry as FLAKY so the bug stays visible.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The PR pipeline checks formatting from here on.

Co-Authored-By: Claude <noreply@anthropic.com>
Next.js 16 removed `next lint`, so `npm run lint` treated "lint" as a
project directory and failed. It now runs eslint directly, and a stale
disable comment for a rule that isn't loaded is gone.

The REST gateway fetch tests now expect the abort signal the client passes.
The FrameRangeSelector tests are skipped: they drive per-frame cells that the
slider-based component does not render.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
With no arguments it installs and lints everything, as before.

Co-Authored-By: Claude <noreply@anthropic.com>
The Maestro sim job moves into maestro-sim.yml unchanged; the nightly and
manual runs call it.

Co-Authored-By: Claude <noreply@anthropic.com>
The Testing, Rust and Maestro pipelines no longer run on pull requests.

Co-Authored-By: Claude <noreply@anthropic.com>
Wheels built on 3.11 carry generated proto code that needs a newer protobuf
runtime than Python 3.9 can install.

Co-Authored-By: Claude <noreply@anthropic.com>
- Build the API docs for pycue, pyoutline and proto changes too: the
  reference autodocs them with warnings as errors.
- Run everything when the pull request changes more files than the filter
  received, since the files API stops at 3000.
- Test that every planner output is wired into pr.yml, so a renamed key
  can't silently skip its job.

Co-Authored-By: Claude <noreply@anthropic.com>
integration.yml builds the Cuebot and RQD images with buildx and the GHA cache, and
ci/run_integration_test.sh runs compose on them when CUEBOT_IMAGE and RQD_IMAGE are set.
With a build ID, the tested images and the Cuebot jar and RPM are uploaded as artifacts.

Co-Authored-By: Claude <noreply@anthropic.com>
- cueweb.yml and rest-gateway.yml take a build ID, tag the image with it and upload it.
- cuebot.yml can write the JaCoCo report.
- Each Python leg gets its own uv cache entry, so one package's cache doesn't stand in
  for all of them.

Co-Authored-By: Claude <noreply@anthropic.com>
maestro-sim.yml takes a full input instead of reading the event name. The scheduled
run is weekly, and the pipeline has no concurrency group, so a manual run no longer
cancels a scheduled one.

Co-Authored-By: Claude <noreply@anthropic.com>
pr.yml and master.yml both call it; the license check is its optional second job.

Co-Authored-By: Claude <noreply@anthropic.com>
One workflow on push to master: verify, build once, prove, then stage. The release-bundle
artifact (90 days) holds everything a release publishes, and the stage jobs push the tested
images to opencuebuild and mirror the bundle to the same S3 path as before. The Testing,
Rust and Packaging pipelines are deleted.

Co-Authored-By: Claude <noreply@anthropic.com>
Every package now declares requires-python >=3.9, so pip on 3.7 or 3.8 refuses the
wheels instead of installing something that fails at import. CI no longer tests 3.7 or
3.8: wheels are built on 3.9 and installed on 3.9 to 3.11. The docs list 3.9 as the
minimum.

Co-Authored-By: Claude <noreply@anthropic.com>
The release bundle keeps its own copy for 90 days.

Co-Authored-By: Claude <noreply@anthropic.com>
DiegoTavares and others added 19 commits November 20, 2026 15:17
Co-Authored-By: Claude <noreply@anthropic.com>
… is queued

recv_timeout returns queued lines even with a zero timeout, so a server that
kept writing could hold the monitor past its deadline.

Co-Authored-By: Claude <noreply@anthropic.com>
Pruning the cache by the processes read successfully dropped a leader whose
read failed while it still ran, so its frame looked gone. Prune by the
processes seen alive instead.

Co-Authored-By: Claude <noreply@anthropic.com>
The manual pick replaced every default job's scenario, so all of them ran the
same scenarios under the wrong names: the report-only exemption and the
metrics looked at the default names.

Co-Authored-By: Claude <noreply@anthropic.com>
A rename is listed under both its paths, so a list cut at 3000 files could
still look complete.

Co-Authored-By: Claude <noreply@anthropic.com>
In an environment variable, the file lists of a large pull request exceed
Linux's 128 KiB limit on one variable and the planner never starts.

Co-Authored-By: Claude <noreply@anthropic.com>
eslint 8 only picks .js files and those its overrides name, so eslint . left
out the .jsx ones next lint used to check.

Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/maestro-sim.yml
${service^^} needs Bash 4, so pass each service's prebuilt image as an argument.

Co-Authored-By: Claude <noreply@anthropic.com>
Both packages now require Python 3.9.

Co-Authored-By: Claude <noreply@anthropic.com>
Reading it through the tag again let a tag moved between the two reads pass
the check for one image and publish another.

Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/maestro-sim.yml
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
DiegoTavares and others added 6 commits November 20, 2026 15:40
… fails

Keeping its cache entry alone left it out of the session, which then reported
no memory and no start time.

Co-Authored-By: Claude <noreply@anthropic.com>
A misspelt name ran nothing and reported a pass.

Co-Authored-By: Claude <noreply@anthropic.com>
git ls-files quotes non-ASCII names by default, so such a file looked unmapped.

Co-Authored-By: Claude <noreply@anthropic.com>
DiegoTavares and others added 2 commits November 23, 2026 10:21
Master is AcademySoftwareFoundation#2661 squashed, whose content this branch already has.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@DiegoTavares
DiegoTavares merged commit 9cf345d into AcademySoftwareFoundation:master Nov 23, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant