Skip to content

Commit bc4fa80

Browse files
committed
source_log_uri as parameter and end index
# Conflicts: # deployment/modules/gcp/cloudbuild/preloader/main.tf # Conflicts: # deployment/live/gcp/static-ct-staging/cloudbuild/staging/terragrunt.hcl
1 parent 2879142 commit bc4fa80

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

deployment/modules/gcp/cloudbuild/preloader/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,21 @@ resource "google_cloudbuild_trigger" "preloader_trigger" {
6565
## TODO(phboneff): move to its own container / cloudrun / batch job.
6666
## Preload entries.
6767
## Leave enough time for the preloader to run, until the token expires.
68+
## Stop after 40k entries, this is what gets copied within 60 minutes.
6869
timeout = "4200s" // 60 minutes
6970
step {
7071
id = "ct_preloader"
7172
name = "golang"
7273
script = <<EOT
73-
START_INDEX=$(curl -H "Authorization: Bearer $(cat /workspace/cb_access)" https://storage.googleapis.com/${var.monitoring_url}/checkpoint | head -2 | tail -1)
74-
echo "Will start preloader at index $START_INDEX"
74+
START_INDEX=$(curl -H "Authorization: Bearer $(cat /workspace/cb_access)" ${var.monitoring_url}/checkpoint | head -2 | tail -1)
75+
END_INDEX=$(($START_INDEX+400000))
76+
echo "Will run preloader between $START_INDEX and $END_INDEX"
7577
go run github.com/google/certificate-transparency-go/preload/preloader@master \
7678
--target_log_uri=${var.submission_url}/ \
7779
--target_bearer_token="$(cat /workspace/cb_identity)" \
78-
--source_log_uri=https://ct.googleapis.com/logs/us1/argon2025h1 \
80+
--source_log_uri=${var.source_log_uri} \
7981
--start_index=$START_INDEX \
82+
--end_index=$END_INDEX \
8083
--num_workers=20 \
8184
--parallel_fetch=20 \
8285
--parallel_submit=20

deployment/modules/gcp/cloudbuild/preloader/variables.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@ variable "github_owner" {
2424
}
2525

2626
variable "submission_url" {
27-
description = "Submission URL of the destination log"
27+
description = "Submission URL of the destination static-ct-api log"
2828
type = string
2929
}
3030

3131
variable "monitoring_url" {
32-
description = "Monitoring URL of the destination log"
32+
description = "Monitoring URL of the destination static-ct-api log"
33+
type = string
34+
}
35+
36+
variable "source_log_uri" {
37+
description = "URL of the source RFC6962 log"
3338
type = string
3439
}

deployment/modules/gcp/cloudbuild/tesseract/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
133133
id = "terraform_apply_preloader"
134134
name = "alpine/terragrunt"
135135
script = <<EOT
136-
terragrunt --terragrunt-non-interactive --terragrunt-no-color apply -auto-approve -no-color -var="submission_url=$(cat /workspace/conformance_url)/arche2025h1.ct.transparency.dev/" -var="monitoring_url=$(cat /workspace/conformance_bucket_name)" 2>&1
136+
terragrunt --terragrunt-non-interactive --terragrunt-no-color apply -auto-approve -no-color -var="submission_url=$(cat /workspace/conformance_url)/arche2025h1.ct.transparency.dev/" -var="monitoring_url=https://storage.googleapis.com/$(cat /workspace/conformance_bucket_name)" 2>&1
137137
EOT
138138
dir = "deployment/live/gcp/static-ct-staging/cloudbuild/preloader"
139139
env = [
@@ -144,6 +144,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
144144
"TF_VAR_location=${var.location}",
145145
"TF_VAR_env=${var.env}",
146146
"TF_VAR_github_owner=${var.github_owner}",
147+
"TF_VAR_source_log_uri=${var.source_log_uri}",
147148
]
148149
wait_for = ["terraform_apply_conformance_staging"]
149150
}

deployment/modules/gcp/cloudbuild/tesseract/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ variable "github_owner" {
2222
description = "GitHub owner used in Cloud Build trigger repository mapping"
2323
type = string
2424
}
25+
26+
variable "source_log_uri" {
27+
description = "URL of the source RFC6962 log to be preloaded."
28+
type = string
29+
}

0 commit comments

Comments
 (0)