Skip to content

Add a DSpace lane with the BoringCache Maven tool cache - #92

Merged
gauravtiwari merged 1 commit into
mainfrom
dspace-maven-tool-cache
Nov 12, 2026
Merged

gauravtiwari merged 1 commit into
mainfrom
dspace-maven-tool-cache

Conversation

@gauravtiwari

@gauravtiwari gauravtiwari commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

DSpace's warm builds are no faster than its cold build in any lane. On step 5, BoringCache reused 2 of 22 build steps; RUN mvn package took 254 of the 309 seconds and reruns on every commit, because it follows the source copy. A layer cache can't skip it.

This adds boringcache-docker-plus (GitHub amd64, GitHub arm64 and local). It uses the layer cache plus the BoringCache Docker Maven tool cache, which serves the Maven build cache extension's remote cache inside that step.

Changes

  • tools/docker/dspace/prepare.sh writes overlay/dspace-maven.Dockerfile from each step's upstream Dockerfile. It changes two places:

    • After COPY --chown=dspace . /app/, it adds .mvn/extensions.xml with maven-build-cache-extension 1.3.0 (the CLI's default version). DSpace has no .mvn/ directory, and the tool cache only sets the extension's properties.
    • It adds -Dmaven.build.cache.alwaysRunPlugins=maven-assembly-plugin:single to mvn package. The Dockerfile then moves dspace/target/dspace-installer, which that goal creates. Without the flag, a cache hit on the dspace module would skip the assembly and the mv would fail. The property exists in 1.3.0 and is documented in the extension parameters.

    If either upstream line changes, preparation fails instead of building a different Dockerfile. Base lanes still build the upstream Dockerfile unchanged.

  • tools/docker/dspace/plus/.boringcache.toml: the base plan plus tool-cache = ["maven:dspace-maven"], building the overlay.

  • tools/docker/dspace/case.toml: adds the lane, the prepare step and rolling_series = 2.

  • tools/README.md: documents the lane and the missing GitHub comparison lane.

No gha-plus lane

The build runs as the non-root dspace user. cache-dance restores a mount by first creating it as root, so dspace can't write a persisted local build cache. Adding uid or mode to the mount gives it a different identity (BuildKit keys it with a base ref), so cache-dance would never restore it. The BoringCache lane doesn't have this problem, because its Maven scratch directory is writable by any user. The comparison is therefore BoringCache plus against the base lanes.

Reseed

rolling_series = 2 restarts every DSpace lane from start_sha on new *-rolling-2 scopes, so the new lane gets the same cold step 0 as the others. Nushell used the same approach. Series-1 records stay in results/ and are no longer read. The repo rules say to delete series-1 BoringCache tags with boringcache rm --no-platform --no-git boringcache/benchmarks <tags>. I can't list or remove tags from my environment. By the plan's scoping they should be dspace-docker-boringcache-docker-github-rolling and dspace-docker-boringcache-docker-github-arm-rolling, but confirm against a listing first.

Checks

  • bin/bench check: 15 tools, 45 cases: ok.

  • Ruby 3.4.10 suite: 203 runs, 0 failures. Two cli_test cases fail only under a US-ASCII locale; they pass under UTF-8, as on GitHub runners.

  • bin/bench matrix dspace --tool Docker --rolling with the current records plans all eight jobs at step 0, sha 622fc02e1491, on -rolling-2 scopes.

  • The prepare script produces the two-hunk overlay against DSpace's Dockerfile, which is the same at start_sha and today's head. It exits 1 on a Dockerfile without those lines.

  • Fresh run of the new lane from this branch, run 43185821530, passed on both architectures:

    Runner Cold Warm
    GitHub amd64 340.7 s 42.1 s
    GitHub arm64 322.7 s 37.4 s

    In the cold amd64 build, Maven loaded the extension, found nothing in the remote cache, built every module and saved all 15 to BoringCache (Saved to remote cache …/buildinfo.xml). mvn package took 4:09 min and the image check passed. The 15 Cannot save project in cache, skipping lines come from the trailing mvn clean, which has nothing to save. The warm builds reused every layer, so Maven didn't run. A Maven cache restore will first happen at rolling step 1 after merge.

DSpace spends most of each build in one mvn package step that every
source change invalidates, so no layer cache shortens it. The plus lane
loads Maven build cache extension 1.3.0 and serves its remote cache
through the BoringCache Docker Maven tool cache.

Preparation writes overlay/dspace-maven.Dockerfile from each step's
upstream Dockerfile: it adds .mvn/extensions.xml after the source copy
and runs the assembly plugin's single goal even when the dspace module
is restored, because the Dockerfile moves the dspace-installer directory
that goal creates. It fails if either upstream line changes.

There is no gha-plus lane. The build runs as the non-root dspace user,
cache-dance restores cache mounts owned by root, and a uid or mode
option gives the mount an identity cache-dance does not restore.

rolling_series = 2 restarts every DSpace lane from start_sha with empty
caches so the new lane has the same cold step 0.

https://boringcache.com/docs/adapters/docker
https://maven.apache.org/extensions/maven-build-cache-extension/parameters.html
@gauravtiwari
gauravtiwari merged commit 57934e1 into main Nov 12, 2026
13 checks passed
@gauravtiwari
gauravtiwari deleted the dspace-maven-tool-cache branch November 12, 2026 09:07
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.

2 participants