Hi,
I'm discovering dagger, and right now I'm trying to "speed it up" in a gitlab-ci setup - because the engine has the lifetime of the gitlab-ci job - we're running dagger-engine in docker-in-docker.
I've enabled the remote registry cache, using the "_EXPERIMENTAL_DAGGER_CACHE_CONFIG" env var, with something like:
- type: registry
- mode: max
- image-manifest: true
- ref: gitlab's internal registry (https://docs.gitlab.com/ee/user/packages/container_registry/)
in gitlab UI I can see that the layers have been pushed - something like 1GB of data (my dagger pipeline is very simple for the moment: golang image to run the unit tests, and golangci-lint)
in the output of the dagger job I can see that the cache is used:
- importing cache manifest from gitlab-xyz:4567/vbehar/test-dagger:cache
- inferred cache manifest type: application/vnd.oci.image.manifest.v1+json [0.00s]
- importing cache manifest from gitlab-ncsa.ubisoft.org:4567/vbehar/test-dagger:cache DONE
and I can see an operation as CACHED (still in the output of the job):
- copy /builds/vbehar/test-dagger CACHED
so I guess that it's somehow working.
but I would have expected to see more cached operations - for example the unit tests - as the source code hasn't changed.
instead, I'm seeing that dagger is still downloading the container images such as golang or golangci-lint:
- pull golang:1.20
- sha256:aec14dce7e7846bbadf40f19d3d871f619c54c1fa6296cc3cfaa810b3c66024d 95.56MiB / 95.56MiB [1.08s]
- extracting sha256:aec14dce7e7846bbadf40f19d3d871f619c54c1fa6296cc3cfaa810b3c66024d [3.38s]
and running the unit tests:
- [5.28s] === RUN TestRun
so my question is: what is cached exactly? shouldn't the base image layers at least be re-used from the cache? and what about the unit tests?
thanks!