Skip to content

Conversation

@strickvl
Copy link
Contributor

@strickvl strickvl commented Nov 28, 2025

Summary

  • Adds optional location parameter to GCP Image Builder config for specifying Cloud Build region
  • Uses regional Cloud Build endpoint ({location}-cloudbuild.googleapis.com) when location is set
  • Defaults to global endpoint for backward compatibility
  • Includes input validation to handle empty strings gracefully

Why

User request. They need to run Cloud Build in a specific region.

Key Changes

  1. Config (gcp_image_builder_flavor.py): Added location: Optional[str] field with descriptive documentation and a Pydantic validator that normalizes whitespace and converts empty strings to None
  2. Implementation (gcp_image_builder.py): Creates ClientOptions with regional endpoint when location is set, logs which endpoint is used
  3. Docs (gcp.md): Updated with --location examples and note clarifying that Service Connector region does NOT control Cloud Build region

Test plan

  • Manual testing with GCP project using regional endpoint (asia-northeast1) - verified build appears in regional Cloud Build history
  • Verify backward compatibility - existing configs without location continue to work

Users can now specify a `location` parameter to run Cloud Build in a
specific GCP region instead of the global endpoint. This enables:
- Data residency compliance (GDPR, etc.)
- Lower latency when building near GCS buckets/Artifact Registry
- Required for Cloud Build private pools

The Service Connector region does not control Cloud Build region, so
this must be set explicitly on the Image Builder component.
@strickvl strickvl added the internal To filter out internal PRs and issues label Nov 28, 2025
@strickvl strickvl linked an issue Nov 28, 2025 that may be closed by this pull request
1 task
@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Documentation Link Check Results

Absolute links check failed
There are broken absolute links in the documentation. See workflow logs for details
Relative links check passed
Last checked: 2025-12-01 15:34:58 UTC

@strickvl strickvl added backend Issues that require changes on the backend snack x-squad Issues that are being handled by the x-squad labels Nov 28, 2025
@strickvl strickvl moved this to In Review in ZenML Roadmap Nov 28, 2025
@strickvl strickvl added the run-slow-ci Tag that is used to trigger the slow-ci label Dec 1, 2025
strickvl and others added 2 commits December 1, 2025 15:11
Adds a Pydantic field_validator that strips whitespace and converts
empty strings to None at parse time. This prevents edge cases where
location="" would produce an invalid endpoint like
"-cloudbuild.googleapis.com".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Issues that require changes on the backend internal To filter out internal PRs and issues run-slow-ci Tag that is used to trigger the slow-ci snack x-squad Issues that are being handled by the x-squad

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Allow configuring region on image builders (gcp)

3 participants