Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .generator/test-resources/librarian/build-request.json

This file was deleted.

36 changes: 0 additions & 36 deletions .generator/test-resources/librarian/generate-request.json

This file was deleted.

49 changes: 2 additions & 47 deletions cloudbuild-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# Reduce this timeout by moving the installation of Python runtimes to a separate base image
timeout: 7200s # 2 hours for the first uncached run, can be lowered later.
steps:
# Step 1: Build the generator image using Kaniko and push it to the registry.
# Build the generator image using Kaniko and push it to the registry as a
# verification that the image builds successfully.
Comment on lines +19 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

With the removal of the resource-intensive steps (cloning googleapis, generating, and building the library), the global timeout of 7200s (line 17) and the E2_HIGHCPU_32 machine type (line 37) are now likely excessive for a single image build verification. Consider reducing these values to optimize resource usage and ensure faster failure feedback. Additionally, if this build is triggered by pull requests, pushing to the registry as mentioned in the comment can lead to tag collisions; consider using the --no-push flag in the Kaniko arguments if the goal is strictly build verification.

- name: 'gcr.io/kaniko-project/executor:latest'
id: 'build-generator'
args:
Expand All @@ -31,52 +32,6 @@ steps:
# Sets a time-to-live for cache layers
- '--cache-ttl=24h'

# Step 2: Clone the googleapis repository into the workspace.
# This runs in parallel with the image build.
- name: 'gcr.io/cloud-builders/git'
id: 'clone-googleapis'
args: ['clone', '--depth', '1', 'https://github.com/googleapis/googleapis.git', '/workspace/googleapis']
waitFor: ['-']

# Step 3: Run the generator to generate the library code.
- name: 'gcr.io/cloud-builders/docker'
id: 'generate-library'
args:
- 'run'
- '--rm'
# Mount the cloned googleapis repo from the workspace.
- '-v'
- '/workspace/googleapis:/app/source'
# Mount the generator-input from this repo's workspace.
- '-v'
- '/workspace/.librarian/generator-input:/app/input'
# Mount the test-resources/librarian from this repo's workspace as the librarian dir.
- '-v'
- '/workspace/.generator/test-resources/librarian:/app/librarian'
# The image that was built in the first step.
- 'gcr.io/$PROJECT_ID/python-librarian-generator:latest'
# The command to execute inside the container.
- 'generate'
waitFor: ['build-generator', 'clone-googleapis']

# Step 4: Run the generator to test the library code.
- name: 'gcr.io/cloud-builders/docker'
id: 'build-library'
waitFor: ['generate-library']
args:
- 'run'
- '--rm'
# Mount the test-resources/librarian from this repo's workspace as the librarian dir.
- '-v'
- '/workspace/.generator/test-resources/librarian:/app/librarian'
# We run the `build` command against the checked in google-cloud-language package.
- '-v'
- '/workspace:/app/repo'
# The image that was built in the first step.
- 'gcr.io/$PROJECT_ID/python-librarian-generator:latest'
# The command to execute inside the container.
- 'build'

options:
default_logs_bucket_behavior: REGIONAL_USER_OWNED_BUCKET
machineType: E2_HIGHCPU_32
Loading