You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP: Add ensure-integration-network job and terraform for GCP integration subnet
Introduces a manually-triggered Concourse job, ensure-integration-network,
that idempotently creates the per-branch GCP subnetwork consumed by the
test-stemcells-ipv4 and bats jobs (deploy-director, cleanup-bats-vms,
prepare-bats) under the bosh-concourse VPC.
Why
---
The test-stemcells-ipv4 and bats jobs in ci/pipelines/builder.yml assume a
subnetwork named stemcell-builder-integration-<subnet_int> exists in the
projects/cloud-foundry-310819/global/networks/bosh-concourse VPC, with a
/24 at 10.100.<subnet_int>.0/24, gateway .1, private Google access, and
IPV4_ONLY stack type. Until now this subnet had to be created and
maintained out of band; this change captures it as code so it can be
recreated reproducibly per branch (subnet_int is set per branch in
ci/pipelines/vars.yml).
What
----
* ci/tasks/ensure-integration-network/{input,network,output}.tf
- hashicorp/google ~> 5.0
- google_compute_subnetwork "integration":
name = stemcell-builder-integration-<subnet_int>
ip_cidr_range = 10.100.<subnet_int>.0/24
region = europe-north2 (matches GCP_ZONE
europe-north2-a in deploy-director)
network = bosh-concourse (configurable)
private_ip_google_access = true
purpose = PRIVATE
stack_type = IPV4_ONLY
- subnet_int is taken as input so the same module produces the
appropriate subnet for any branch.
* ci/pipelines/builder.yml
- New `infrastructure` group containing the new job.
- New resource_type `terraform_type` (ljfranklin/terraform-resource).
- New resource `integration-network-environment` (GCS backend). The
bucket is referenced via the Concourse credential
((integration_network_terraform_state_bucket)); pick a bucket name
and add the credential before flying. A TODO comment marks this.
- New job `ensure-integration-network`:
* serial: true, manual trigger only (no `trigger: true` on get).
* Puts to integration-network-environment with
env_name = stemcell-builder-integration-<subnet_int>, so the
state file is deterministically named and re-discovered on
subsequent runs (no recreate-on-rerun).
* Apply only — never destroyed by this job, since the subnet is
long-lived shared infrastructure.
* No `passed:` constraint on the existing test/bats jobs to avoid
coupling; the job is intended to be run on demand when the
subnet needs to be created or reconciled.
Verification
------------
* `ytt -f ci/pipelines/builder.yml -f ci/pipelines/vars.yml` renders
successfully.
* `fly validate-pipeline -c <rendered>` reports "looks good".
Follow-ups
----------
* Create the GCS bucket that will hold terraform state and set the
((integration_network_terraform_state_bucket)) Concourse credential.
* If the existing subnetwork in cloud-foundry-310819 is to be adopted
rather than recreated, run `terraform import` once before flying the
job (or delete the existing subnet first).
Co-authored-by: Cursor <cursoragent@cursor.com>
description="GCP project that owns the bosh-concourse VPC."
4
+
}
5
+
6
+
variable"gce_credentials_json" {
7
+
type=string
8
+
description="JSON-encoded service account credentials with Compute Network Admin on the project."
9
+
sensitive=true
10
+
}
11
+
12
+
variable"gce_region" {
13
+
type=string
14
+
description="Region to create the integration subnetwork in. Must match the region of the GCP_ZONE used by deploy-director."
15
+
default="europe-north2"
16
+
}
17
+
18
+
variable"network_name" {
19
+
type=string
20
+
description="Name of the VPC network the subnetwork will be attached to."
21
+
default="bosh-concourse"
22
+
}
23
+
24
+
variable"subnet_int" {
25
+
type=string
26
+
description="Integer (as string) used as both the third octet of the /24 CIDR and the suffix of the subnet name. Matches data.values.stemcell_details.subnet_int in ci/pipelines/vars.yml."
0 commit comments