Skip to content

Commit 9017b20

Browse files
authored
Migration to wpt-live-app (#80)
* Migrate from wpt-live project to wpt-live-app project Currently, the wpt-live project lives in the chromium.org GCP org. However, to better support this long term, we created a new project under the google.com org, wpt-live-app. This is mostly to help with billing. * Move .git to another location upon cloning
1 parent 1ff0261 commit 9017b20

File tree

10 files changed

+332
-421
lines changed

10 files changed

+332
-421
lines changed

.terraform.lock.hcl

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
HOST=gcr.io
2-
PROJECT_ID=wpt-live
2+
PROJECT_ID=wpt-live-app
33

44
.PHONY: cert-renewer wpt-server-tot
55
cert-renewer wpt-server-tot:
@@ -21,15 +21,9 @@ run-%: %
2121
--env WPT_BUCKET \
2222
wpt-live-$*
2323

24-
google-cloud-platform-credentials.json:
25-
@echo To publish images, the file $@ must be present in the root of >&2
26-
@echo this repository. >&2
27-
@exit 1
28-
2924
.PHONY: login
30-
login: google-cloud-platform-credentials.json
31-
cat $< | \
32-
docker login -u _json_key --password-stdin $(HOST)
25+
login:
26+
yes | gcloud auth configure-docker
3327

3428
publish-%: % login
3529
docker tag wpt-live-$* $(HOST)/$(PROJECT_ID)/wpt-live-$*

infrastructure/docker-image/main.tf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,9 @@ variable "image" {
99
}
1010

1111
output "identifier" {
12-
value = "${var.registry}/${var.image}@${data.external.image.result.identifier}"
12+
value = "${var.registry}/${var.image}@${data.docker_registry_image.image.sha256_digest}"
1313
}
1414

15-
data "external" "image" {
16-
program = [
17-
"python3",
18-
"${path.module}/latest-image.py",
19-
"--registry",
20-
var.registry,
21-
"--image",
22-
var.image,
23-
]
15+
data "docker_registry_image" "image" {
16+
name = "${var.registry}/${var.image}:latest"
2417
}

infrastructure/docker-image/versions.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
terraform {
33
required_version = "~> 1.6.2"
44
required_providers {
5-
external = {
6-
source = "hashicorp/external"
5+
docker = {
6+
source = "kreuzwerker/docker"
7+
version = "3.0.2"
78
}
89
}
910
}
11+
12+
provider "docker" {
13+
registry_auth {
14+
address = var.registry
15+
config_file = pathexpand("~/.docker/config.json")
16+
}
17+
}

infrastructure/web-platform-tests/compute.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ resource "google_compute_instance_template" "wpt_server" {
159159
resource "google_cloud_run_v2_job" "cert_renewers" {
160160
name = "${var.name}-cert-renewers"
161161
location = var.region
162-
launch_stage = "BETA"
163162

164163
template {
165164
template {

infrastructure/web-platform-tests/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module "wpt-server-container" {
3737
}
3838

3939
resource "google_storage_bucket" "certificates" {
40-
name = local.bucket_name
41-
location = "US"
40+
name = local.bucket_name
41+
location = "US"
42+
uniform_bucket_level_access = true
4243
}

infrastructure/web-platform-tests/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ variable "wpt_server_ports" {
9191

9292
variable "service_account_email" {
9393
type = string
94-
default = "393246102209[email protected]"
94+
default = "2226368975[email protected]"
9595
}
9696

9797
variable "cert_renewer_ports" {

terraform.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
locals {
22
region = "us-central1"
33
zone = "us-central1-b"
4-
project_name = "wpt-live"
4+
project_name = "wpt-live-app"
55
}
66

77
provider "google" {
8-
project = local.project_name
9-
region = local.region
10-
credentials = file("google-cloud-platform-credentials.json")
8+
project = local.project_name
9+
region = local.region
1110
}
1211

1312
resource "google_compute_network" "default" {
@@ -38,7 +37,7 @@ module "cert-renewer-image" {
3837
module "wpt-live" {
3938
source = "./infrastructure/web-platform-tests"
4039

41-
name = "wpt-tot"
40+
name = "wpt-tot-app"
4241
network_name = google_compute_network.default.name
4342
subnetwork_name = google_compute_subnetwork.default.name
4443
host_zone_name = "wpt-live"

0 commit comments

Comments
 (0)