Skip to content

Commit

Permalink
Pre-clean conformance env (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored Nov 8, 2024
1 parent 24a52da commit a980f51
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion deployment/modules/gcp/cloudbuild/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ resource "google_cloudbuild_trigger" "docker" {
}

build {
## Destroy any pre-existing deployment/live/gcp/conformance/ci environment.
## This might happen if a previous cloud build failed for some reason.
step {
id = "preclean_env"
name = "alpine/terragrunt"
script = <<EOT
terragrunt --terragrunt-non-interactive destroy -auto-approve 2>&1
EOT
dir = "deployment/live/gcp/conformance/ci"
env = [
"TESSERA_SIGNER=unused",
"TESSERA_VERIFIER=unused",
"GOOGLE_PROJECT=${var.project_id}",
"TF_IN_AUTOMATION=1",
"TF_INPUT=false",
"TF_VAR_project_id=${var.project_id}"
]
}
## Build the GCP conformance server docker image.
## This will be used by the conformance terragrunt config step further down.
step {
Expand Down Expand Up @@ -119,7 +137,21 @@ resource "google_cloudbuild_trigger" "docker" {
id = "hammer"
name = "golang"
script = <<EOT
go run ./internal/hammer --log_public_key=$(cat /workspace/key.pub) --log_url=https://storage.googleapis.com/trillian-tessera-ci-conformance-bucket/ --write_log_url="$(cat /workspace/conformance_url)" -v=1 --show_ui=false --bearer_token="$(cat /workspace/cb_access)" --bearer_token_write="$(cat /workspace/cb_identity)" --logtostderr --num_writers=1100 --max_write_ops=1500 --leaf_min_size=1024 --leaf_write_goal=50000 --force_http2
apt update && apt install -y retry
retry -t 5 -d 15 --until=success go run ./internal/hammer \
--log_public_key=$(cat /workspace/key.pub) \
--log_url=https://storage.googleapis.com/trillian-tessera-ci-conformance-bucket/ \
--write_log_url="$(cat /workspace/conformance_url)" \
-v=1 \
--show_ui=false \
--bearer_token="$(cat /workspace/cb_access)" \
--bearer_token_write="$(cat /workspace/cb_identity)" \
--logtostderr \
--num_writers=1100 \
--max_write_ops=1500 \
--leaf_min_size=1024 \
--leaf_write_goal=50000 \
--force_http2
EOT
wait_for = ["terraform_outputs", "generate_keys", "access"]
}
Expand Down

0 comments on commit a980f51

Please sign in to comment.