#Dagger layer cache on gitlab.com Shared Runner

1 messages · Page 1 of 1 (latest)

icy obsidian
#

I tried to get the Dagger Layer Cache working between jobs on gitlab.com's Shared Runner but cant find any documentation.

Did someone know what to add to the config to use previous job cache?

Below a simplify .gitlab-ci.yaml I used:

.docker-dagger:
    image: docker:latest
    services:
        - docker:${DOCKER_VERSION}-dind
    variables:
        DOCKER_HOST: tcp://docker:2376
        DOCKER_TLS_VERIFY: '1'
        DOCKER_TLS_CERTDIR: '/certs'
        DOCKER_CERT_PATH: '/certs/client'
        DOCKER_DRIVER: overlay2
        DOCKER_VERSION: '27.2.0'

.dagger:
    extends: [.docker-dagger]
    before_script:
        - apk add curl
        - curl -fsSL https://dl.dagger.io/dagger/install.sh | BIN_DIR=/usr/local/bin sh
    variables: # Tried to use gitlab's image registry as cache, but not working.
        _EXPERIMENTAL_DAGGER_CACHE_CONFIG: "type=registry,ref=${CI_REGISTRY_IMAGE}/cache,mode=max"
    cache: # Maybe I can cache some dirs but do not know which ones.
        key:
            files: [dagger.json]
        paths:
            - ???

build:
    extends: [.dagger]
    stage: build
    script:
        - dagger call build

qa:
    extends: [.dagger]
    needs: [build]
    stage: qa
    script:
        - dagger call cs # cs use build, all steps are redo and do not use any cache T_T
tender heron
icy obsidian
#

Hi, thank for the answer. And yes, it can be good to try out the futur version of the Dagger Cloud 🙂

ocean crow
#

hey. working along side with @icy obsidian . Some of our clients might be against moving to daggercloud for infrastructure policies. Will there be a way to have cached layers as well on supported CIs ?

tender heron
ocean crow
#

no worries. If there is something we can do to help do not hesitate. We don't have much of knowledge on golang however :/