Skip to content

feat: [COMP-2106] support VPC network and subnetworks for google-cloud compute environment - #653

Open
jonmarti wants to merge 3 commits into
masterfrom
feature/COMP-2106-gcp-cloud-vpc-subnet
Open

feat: [COMP-2106] support VPC network and subnetworks for google-cloud compute environment#653
jonmarti wants to merge 3 commits into
masterfrom
feature/COMP-2106-gcp-cloud-vpc-subnet

Conversation

@jonmarti

@jonmarti jonmarti commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds VPC/subnet customization to the compute-envs add google-cloud command, which previously had no networking options. Mirrors the existing aws-cloud VPC/subnet support (#639).

New advanced options:

  • --network — VPC network name or URI (defaults to the project's default network)
  • --subnetworks — comma-separated subnetworks; the first is used for basic placement, Intelligent Compute may use all of them
  • --network-tags — firewall-targeting tags (validated: require --network, GCP tag format, max 64)
  • --use-private-address — launch VMs without an external IP

subnetworks is a list (not singular like google-batch), matching the GoogleCloudConfig SIC model where workers can be spread across a subnet pool.

Also bumps the minimum required Platform API version to 1.190.0 (the version that introduced the GoogleCloudConfig network fields, and the current cloud production API version), updating the info command tests/fixture to match.

Test plan

Unit tests

New tests in GoogleCloudPlatformTest:

  • --network + --subnetworks (list) + --use-private-address → asserts exact request body
  • --network-tags → asserts tags in request body
  • --network-tags without --network → fails CLI-side ("Network tags require VPC configuration")
  • invalid tag format (Allow-SSH) → fails CLI-side

Manual end-to-end verification

Built the CLI shadow jar and exercised the real compute-envs add google-cloud flow against live backends, confirming each field round-trips CLI flag → API → persisted CE config.

Scenario Backend Result
network + subnetworks + tags + private-address (no SIC) local (API 1.195.0) CE created; persisted network=sic-test-vpc, subnetworks=[sic-test-subnet], networkTags=[allow-ssh, web-tier], usePrivateAddress=true
same, non-SIC dev (API 1.195.0), personal workspace same four fields persisted ✓
SIC enabled + network flags dev (API 1.195.0), org workspace schedEnabled=true, schedConfig={provisioningModel: ondemand, machineTypes: [n2d-standard-2]} and all four network fields persisted ✓

Negative validation (tags without network, invalid tag format) confirmed to fail CLI-side against the live backend as well.

The SIC + VPC/subnet combination is the key case for COMP-2106 (VPC/subnet customization for GCP Cloud Intelligent Compute); verified the two work together.

Requires tower-java-sdk >= 1.190.0 (already pinned).

🤖 Generated with Claude Code

…d compute environment

Adds --network, --subnetworks, --network-tags and --use-private-address
advanced options to the 'compute-envs add google-cloud' command, mirroring
the aws-cloud VPC/subnet support. Subnetworks is a list (Intelligent Compute
may spread workers across all of them; the first is used for basic placement),
matching the GoogleCloudConfig model. Network tags are validated CLI-side
(require a network, GCP tag format, max count) as for google-batch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jonmarti
jonmarti requested a review from a team July 31, 2026 16:17
@stefanoboriero

Copy link
Copy Markdown
Contributor

Remember to update the minimal required API version for this to work in https://github.com/seqeralabs/tower-cli/blob/master/VERSION-API

The new --network/--subnetworks/--network-tags/--use-private-address
options require GoogleCloudConfig network fields, introduced in Platform
API 1.190.0 (current cloud production version).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jonmarti

jonmarti commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Remember to update the minimal required API version for this to work in https://github.com/seqeralabs/tower-cli/blob/master/VERSION-API

@stefanoboriero thanks for the heads-up , addressed in e8bda08 9647133. Bumped to 1.190.0, the version that introduced the GoogleCloudConfig network fields and the current cloud production API version

Follows the VERSION-API bump: the mocked backend version in InfoCmdTest
(and its service-info fixture) must be >= the CLI minimum, otherwise the
info command reports the backend as older than the minimum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread VERSION-API
@@ -1,4 +1,4 @@
1.181.0
1.190.0

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants