Caching not working on windows with gitlab runner version 9.3.0
Summary
I am attempting use the cache:
directive with gitlab.com and on-premise ci runner running on Windows 7. A simple example fails to work even when both stages are tagged so that they execute on the same runner.
Steps to reproduce
- Use the latest 9.3.0 of the runner
- Use the following
.gitlab-ci.yml
file
cache:
untracked: true
stages:
- build
- test
suite:
stage: build
tags:
- testing
script:
- echo "hello world" > test.txt
suite.test:
stage: test
tags:
- testing
script:
- if exist .\test.txt echo "Success file exists"
- cat < test.txt
- Configuration
config.toml
of the gitlab runner
concurrent = 1
check_interval = 0
[[runners]]
name = "stz-W7"
url = "https://gitlab.com/ci"
token = "aaaedfde312d1aa5487347b454a410"
executor = "shell"
[runners.cache]
Type = "s3"
ServerAddress = "192.168.1.138:9005"
AccessKey = "5JHXIYMY2ETYC9ZDTD8A"
SecretKey = "awPTeTod9GQNyfwji+pq0ksUPGCSsL6YvuzK/T6b"
BucketName = "runner"
Insecure = true
Shared = true
Note the use of [runners.cache]
which is not respected, in that no data is uploaded to the minio server running on the same network. I would have hoped that this worked correctly as we often employ multiple build agents and need to share data between them.
Actual behavior
Below is the raw output of the first stage:
Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
on stz-W7 (aaaedfde)
Using Shell executor...
Running on STZ-W7...
Fetching changes...
HEAD is now at 8d7d494 Simple cache test
Checking out 8d7d4949 as cache-test...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
$ echo "hello world" > test.txt
Creating cache default...
Created cache
Job succeeded
And the second stage:
Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
on stz-W7 (aaaedfde)
Using Shell executor...
Running on STZ-W7...
Fetching changes...
Removing test.txt
HEAD is now at 8d7d494 Simple cache test
Checking out 8d7d4949 as cache-test...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
$ if exist .\test.txt echo "Success file exists"
$ cat < test.txt
The system cannot find the file specified.
Creating cache default...
Created cache
Job succeeded
I can see that the cache.zip
file in the cache\<project>\default
folder contains the test.txt
file. But it is not found by the second stage even though the log indicates that it has been restored.
Expected behavior
I would expect that the test.txt
file is available to the second stage in the pipeline. I would also expect the cached data to be placed in the minio
S3 server.
I would also like to see better logging from the gitlab runner. I can see the script.cmd
files being created and what the contents are. But I can't see the execution of the caching.
It is possible to use the artifacts:
and dependencies:
directives to make this work. However that requires a round trip to gitlab.com and slows the build down unnecessarily.
Relevant logs and/or screenshots
gitlab-ci-multi-runner-windows.am64.exe --debug run
PS C:\gitlab-runner> .\gitlab-ci-multi-runner-windows-amd64.exe --debug run
Runtime platform arch=amd64 os=windows rev
ision=3df822b version=9.3.0
Starting multi-runner from C:\gitlab-runner\config.toml ... builds=0
Checking runtime mode GOOS=windows uid=-1
Configuration loaded builds=0
metricsserveraddress: ""
concurrent: 1
checkinterval: 0
loglevel: null
user: ""
runners:
- name: stz-W7
limit: 0
outputlimit: 0
requestconcurrency: 0
runnercredentials:
url: https://gitlab.com/ci
token: ababababababababababababababa0
tlscafile: ""
tlscertfile: ""
tlskeyfile: ""
runnersettings:
executor: shell
buildsdir: ""
cachedir: ""
environment: []
preclonescript: ""
prebuildscript: ""
postbuildscript: ""
shell: ""
ssh: null
docker: null
parallels: null
virtualbox: null
cache:
type: s3
serveraddress: 192.168.1.138:9005
accesskey: 5JHXIYMY2ETYC9ZDTD8A
secretkey: awPTeTod9GQNyfwji+pq0ksUPGCSsL6YvuzK/T6b
bucketname: runner
bucketlocation: ""
insecure: true
path: ""
shared: true
machine: null
kubernetes: null
sentrydsn: null
modtime: 2017-06-28T09:33:58.1412969+01:00
loaded: true
builds=0
Metrics server disabled
Starting worker builds=0 worker=0
Feeding runners to channel builds=0
Dialing: tcp gitlab.com:443 ...
Feeding runners to channel builds=0
Checking for jobs... nothing runner=aaaedfde
Feeding runners to channel builds=0
Checking for jobs... nothing runner=aaaedfde
Checking for jobs... received job=20362429 repo_url=https://gitlab.com/securethingz
/secure-deploy.git runner=aaaedfde
Failed to requeue the runner: builds=1 runner=aaaedfde
Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
on stz-W7 (aaaedfde) job=20362429 project=1867844 runner=aaaedfde
Shell configuration: environment: []
dockercommand: []
command: cmd
arguments:
- /C
passfile: true
extension: cmd
job=20362429 project=1867844 runner=aaaedfde
Using Shell executor... job=20362429 project=1867844
runner=aaaedfde
Waiting for signals... job=20362429 project=1867844
runner=aaaedfde
Feeding runners to channel builds=1
Submitting job to coordinator... ok job=20362429 runner=aaaedfde
Appending trace to coordinator... ok code=202 job=20362429 job
-log=0-213 job-status=running runner=aaaedfde sent-log=0-213 status
=202 Accepted
Job succeeded job=20362429 project=1867844 runner=aaaedfde
Submitting job to coordinator... ok job=20362429 runner=aaaedfde
Checking for jobs... received job=20362430 repo_url=https://gitlab.com/securethingz
/secure-deploy.git runner=aaaedfde
Failed to requeue the runner: builds=1 runner=aaaedfde
Running with gitlab-ci-multi-runner 9.3.0 (3df822b)
on stz-W7 (aaaedfde) job=20362430 project=1867844 runner=aaaedfde
Shell configuration: environment: []
dockercommand: []
command: cmd
arguments:
- /C
passfile: true
extension: cmd
job=20362430 project=1867844 runner=aaaedfde
Using Shell executor... job=20362430 project=1867844
runner=aaaedfde
Waiting for signals... job=20362430 project=1867844
runner=aaaedfde
Feeding runners to channel builds=1
Submitting job to coordinator... ok job=20362430 runner=aaaedfde
Appending trace to coordinator... ok code=202 job=20362430 job
-log=0-302 job-status=running runner=aaaedfde sent-log=0-302 status
=202 Accepted
Job succeeded job=20362430 project=1867844 runner=aaaedfde
Submitting job to coordinator... ok job=20362430 runner=aaaedfde
Checking for jobs... nothing runner=aaaedfde
Feeding runners to channel builds=0
Feeding runners to channel builds=0
WARNING: Requested service stop: <nil> builds=0
FATAL: forced exit: interrupt
Gitlab runner hosting O/S
Windows 7 Profesinonal Service Pack 1
64 bit operating system
GitLab Enterprise Edition 9.3.1-ee a15332b
Environment description
Hosted Gitlab.com and multiple private runners. For the testing a single runner was selected and the runner and yml tags set appropriately.
Used GitLab Runner version
Version: 9.3.0
Git revision: 3df822b
Git branch: 9-3-stable
GO version: go1.7.5
Built: Thu, 22 Jun 2017 10:57:49 +0000
OS/Arch: windows/amd64