Service container logs
Release Notes
Logs generated by applications running in service containers can be captured for subsequent examination and debugging.
Please note:
Enabling CI_DEBUG_SERVICES
may result in masked variables being revealed. When CI_DEBUG_SERVICES
is enabled, service container logs and the CI job’s logs are streamed to the job’s trace log concurrently, which makes it possible for a service container log to be inserted inside a job’s masked log. This would thwart the variable masking mechanism and result in the masked variable being revealed.
Description
Hello, is it possible to get service logs from gitlab-ci-multi-runner? For example, in debug mode, or something else?
For example, I have a job in .gitlab-ci.yml:
elastic:
services:
- elasticsearch:5
script:
- ./runtests.sh --tag=require_elasticsearch
And sometimes (or even often) this job have failed by Read Timeout in elasticsearch, but I can't determine, what's happened with elasticsearch, because I have no any logs for it.
Proposal
When .gitlab-ci.yml
defines: variables: CI_DEBUG_SERVICES: trace
we will print data from each service in-line with the build log. We will read full lines from service log and print them one-by-one by prefixing them with [service-name] <serivce log>
.
Example
variables:
CI_DEBUG_SERVICES: trace
Running with gitlab-ci-multi-runner 1.10.4 (b32125f)
Using Docker executor with image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1 ...
Starting service mysql:latest ...
Pulling docker image mysql:latest ...
Starting service redis:alpine ...
Pulling docker image redis:alpine ...
Waiting for services to be up and running...
[docker] Starting docker daemon...
[docker] Docker daemon ready
Pulling docker image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1 ...
Running on runner-ab89f037-project-13083-concurrent-0 via runner-ab89f037-auto-scale-1488787424-211b2b33...
Cloning repository for 26384-improve-omnibus-mattermost-command-installation-flow with git depth set to 20...
Cloning into '/builds/gitlab-org/gitlab-ce'...
...
[docker] Processing API request...
...