From ba00c9fb7d373b386742341b25a4a246fcb6433b Mon Sep 17 00:00:00 2001 From: Tejal Desai Date: Fri, 5 Jun 2020 15:10:28 -0700 Subject: [PATCH] add benchmarking for gcb --- DEVELOPMENT.md | 15 +++++++++++++++ integration/benchmark_fs/cloudbuild.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 18b69b3e3..330d9ba56 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -166,6 +166,21 @@ Additionally, the integration tests can output benchmarking information to a `be BENCHMARK=true go test -v --bucket $GCS_BUCKET --repo $IMAGE_REPO ``` +#### Benchmarking your GCB runs +If you are GCB builds are slow, you can check which phases in kaniko are bottlenecks or taking more time. +To do this, add "BENCHMARK_ENV" to your cloudbuild.yaml like this. +```shell script +steps: +- name: 'gcr.io/kaniko-project/executor:latest' + args: + - --build-arg=NUM=${_COUNT} + - --no-push + - --snapshotMode=redo + env: + - 'BENCHMARK_FILE=gs://$PROJECT_ID/gcb/benchmark_file' +``` +You can download the file `gs://$PROJECT_ID/gcb/benchmark_file` using `gsutil cp` command. + ## Creating a PR When you have changes you would like to propose to kaniko, you will need to: diff --git a/integration/benchmark_fs/cloudbuild.yaml b/integration/benchmark_fs/cloudbuild.yaml index 01a83440b..829fb946b 100644 --- a/integration/benchmark_fs/cloudbuild.yaml +++ b/integration/benchmark_fs/cloudbuild.yaml @@ -1,5 +1,5 @@ steps: -- name: 'gcr.io/kaniko-project/executor:perf-latest' +- name: 'gcr.io/kaniko-project/executor:latest' args: - --build-arg=NUM=${_COUNT} - --no-push