Created
February 9, 2018 19:02
-
-
Save Philmod/bf1e64643bdb20564e94370663a7e87b to your computer and use it in GitHub Desktop.
Side container to keep track of docker stats during GCB build steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
# Run docker stats in the background. | |
# --no-stream is used in order to print the stats on different lines. | |
- name: 'gcr.io/cloud-builders/docker' | |
args: | |
- 'run' | |
- '-d' | |
- '--name=docker-stats' | |
- '--volume=/var/run/docker.sock:/var/run/docker.sock' | |
- '--entrypoint=/bin/bash' | |
- 'gcr.io/cloud-builders/docker' | |
- '-c' | |
- 'while true; do docker stats --no-stream; sleep 1; done' | |
# Simulate some CPU intensive step. | |
- name: 'ubuntu' | |
entrypoint: 'bash' | |
args: | |
- '-c' | |
- | | |
apt-get update | |
apt-get install -y stress | |
stress --cpu 1 --timeout 10 | |
# Show logs from the docker stats command. | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['logs', 'docker-stats'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment