0

I have implemented the Kaniko Cache for Google Cloud Build with the following exact cloudbuild.yaml file :

steps:
- name: 'gcr.io/kaniko-project/executor:latest'
  args:
  - --destination=gcr.io/$PROJECT_ID/image
  - --cache=true
  - --cache-ttl=6h
timeout: 7200s

I can see the newer logs being introduced into Cloud Build traces :

Updating files:  95% (11083/11587)
Updating files:  96% (11124/11587)
Updating files:  97% (11240/11587)
Updating files:  98% (11356/11587)
Updating files:  99% (11472/11587)
Updating files: 100% (11587/11587)
Updating files: 100% (11587/11587), done.
HEAD is now at 21f501d Update Dockerfile
BUILD
Pulling image: gcr.io/kaniko-project/executor:latest
latest: Pulling from kaniko-project/executor
.
.
INFO[2152] Taking snapshot of full filesystem...        
INFO[2194] Pushing layer gcr.io/videoo2/image/cache:52..25 to cache now 
INFO[2194] CMD ["bash"]                                 
INFO[2194] Pushing image to gcr.io/videoo2/image/cache:52..25 
INFO[2194] No files changed in this command, skipping snapshotting. 
INFO[2196] Pushed gcr.io/videoo2/image/cache@sha256:a8..ed69e6431 
INFO[2196] Pushing image to gcr.io/videoo2/image        
INFO[2199] Pushed gcr.io/videoo2/image@sha256:38..68c28

But there is literally no change in the speed of the builds.

What shall I supposed to do in order actually benefit from this caching ?

london_utku
  • 1,070
  • 2
  • 16
  • 36
  • 1
    Have you tried [`gcloud config set builds/use_kaniko True`](https://cloud.google.com/blog/products/application-development/build-containers-faster-with-cloud-build-with-kaniko) command? – Roopa M Aug 11 '22 at 14:24
  • I haven't but I think it works only when you trigger the builds from the command line. Our builds are triggered through GitHub push events. Would it work if I don't trigger the events through command line ? – london_utku Aug 11 '22 at 18:10
  • So whenI execute the command : "gcloud config set builds/use_kaniko True", it responded this way : Updated property [builds/use_kaniko]. Where has it updated this property to ? – london_utku Aug 11 '22 at 18:11
  • Even though I dont use the gcloud config set builds/use_kaniko_True command, I can see the following output in the build logs : Pulling image: gcr.io/kaniko-project/executor:latest latest: Pulling from kaniko-project/executor So I don't think that I need that as it is already enabled. – london_utku Aug 11 '22 at 19:00
  • Can you mention time taken by trigger before and after using kaniko? If possible can you attach build history (which has log details of before and after kaniko)? – Roopa M Aug 12 '22 at 05:12

0 Answers0