Skip to content
GitLab
Next
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #1151

Cache not always restored on concurrent > 1 and docker executor

I don't know if it's an expected behavior but i have noticed that the cache is split for each docker concurrent container.

I'm experiencing a storm of failed jobs because the jobs are executed in different concurrent container and obviously the cache is not present.

I'm going to explain myself with an example:

.gitlab-ci.yml

cache:
  key: "$CI_PROJECT_ID/$CI_BUILD_REF_NAME"
  paths:
    - node_modules/

# Build job
build:
  type: build
  script:
    - npm prune
    - npm install

# Test job
test:
  type: test
  script:
    - npm test

config.toml

concurrent = 1

[[runners]]
  name = "node_wheezy"
  limit = 0
  disable_verbose = false
  tls-ca-file = ""
  executor = "docker"
  [runners.docker]
    image = "node:wheezy"
    privileged = false
    volumes = ["/cache"]
    cache_dir = "/cache"
    allowed_images = ["node:*-wheezy"]
    allowed_services = ["redis:latest", "mongo:latest"]

If i keep concurrent to 1 the cache is always restored but if i put 2 it's possible that build job is executed on concurrent-0 and test on concurrent-1 causing a fail.

Edited Jul 10, 2020 by Darren Eastman
Assignee
Assign to
Time tracking