I've had this issue a number of times, it's incredibly dangerous - jobs are succeeding on cache hits that shouldn't be happening.
- component: gitlab.com/path/to/component/that/calls/dagger/module
inputs:
name: amzl-laas-21-jre
build_args: ["JAVA_MAJOR=21"]
dagger_progress: plain
- component: gitlab.com/path/to/component/that/calls/dagger/module
inputs:
name: amzl-laas-25-jre
build_args: ["JAVA_MAJOR=25"]
dagger_progress: plain
Note the version differences in both name and build args. These are fed to a Docker builder module. The build method accepts the build args as a parameter named args and has +cache=session (which should be two different client sessions). build function signature:
func (m Docker) Build(
...
// A list of build arguments in the format of arg=value
// +optional
args []string,
- These includes produce two separate Gitlab jobs that run at the same time (image attached).
- Those two jobs connect to the same Dagger engine (remotely hosted)
Result = two jobs, both the same:
- https://dagger.cloud/mjb/traces/68112b970df043aae2864e1622810d03
- https://dagger.cloud/mjb/traces/2334c0e99ac98af4ab3d9b1341f2f5b9?listen=b5da4f3b50a00859
I ran dagger core engine local-cache prune on the remote runner with pointing at the engine exposed by the remote host (e.g. localhost:port) and ran again, same problem:
- https://dagger.cloud/mjb/traces/7c89ca3d87bc56112c5339468345d9fe
- https://dagger.cloud/mjb/traces/ffb7cca66bb45fe9b21dc045767bd6ab
From job logs:
12 : Docker.build(
12 : ┆ source: Address.directory: Directory!
12 : ┆ file: "Dockerfile"
12 : ┆ args: ["JAVA_MAJOR=25"]
12 : ┆ platform: ["linux/amd64", "linux/arm64"]
12 : ): Docker!
18 : Docker.build(
18 : ┆ source: Address.directory: Directory!
18 : ┆ file: "Dockerfile"
18 : ┆ args: ["JAVA_MAJOR=25"]
18 : ┆ platform: ["linux/amd64", "linux/arm64"]
18 : ): Docker!