1616# Reduce this timeout by moving the installation of Python runtimes to a separate base image
1717timeout : 7200s # 2 hours for the first uncached run, can be lowered later.
1818steps :
19- # Step 1: Build the generator image using Kaniko and push it to the registry.
19+ # Build the generator image using Kaniko and push it to the registry as a
20+ # verification that the image builds successfully.
2021 - name : ' gcr.io/kaniko-project/executor:latest'
2122 id : ' build-generator'
2223 args :
@@ -31,52 +32,6 @@ steps:
3132 # Sets a time-to-live for cache layers
3233 - ' --cache-ttl=24h'
3334
34- # Step 2: Clone the googleapis repository into the workspace.
35- # This runs in parallel with the image build.
36- - name : ' gcr.io/cloud-builders/git'
37- id : ' clone-googleapis'
38- args : ['clone', '--depth', '1', 'https://github.com/googleapis/googleapis.git', '/workspace/googleapis']
39- waitFor : ['-']
40-
41- # Step 3: Run the generator to generate the library code.
42- - name : ' gcr.io/cloud-builders/docker'
43- id : ' generate-library'
44- args :
45- - ' run'
46- - ' --rm'
47- # Mount the cloned googleapis repo from the workspace.
48- - ' -v'
49- - ' /workspace/googleapis:/app/source'
50- # Mount the generator-input from this repo's workspace.
51- - ' -v'
52- - ' /workspace/.librarian/generator-input:/app/input'
53- # Mount the test-resources/librarian from this repo's workspace as the librarian dir.
54- - ' -v'
55- - ' /workspace/.generator/test-resources/librarian:/app/librarian'
56- # The image that was built in the first step.
57- - ' gcr.io/$PROJECT_ID/python-librarian-generator:latest'
58- # The command to execute inside the container.
59- - ' generate'
60- waitFor : ['build-generator', 'clone-googleapis']
61-
62- # Step 4: Run the generator to test the library code.
63- - name : ' gcr.io/cloud-builders/docker'
64- id : ' build-library'
65- waitFor : ['generate-library']
66- args :
67- - ' run'
68- - ' --rm'
69- # Mount the test-resources/librarian from this repo's workspace as the librarian dir.
70- - ' -v'
71- - ' /workspace/.generator/test-resources/librarian:/app/librarian'
72- # We run the `build` command against the checked in google-cloud-language package.
73- - ' -v'
74- - ' /workspace:/app/repo'
75- # The image that was built in the first step.
76- - ' gcr.io/$PROJECT_ID/python-librarian-generator:latest'
77- # The command to execute inside the container.
78- - ' build'
79-
8035options :
8136 default_logs_bucket_behavior : REGIONAL_USER_OWNED_BUCKET
8237 machineType : E2_HIGHCPU_32
0 commit comments