Skip to content

Commit

Permalink
Add gcp region to env vars of cloud run that calls queuer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Oct 25, 2023
1 parent 86232f6 commit 5111484
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cerulean_cloud/cloud_function_ais_analysis/queuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def add_to_aaa_queue(scene_id):
client = tasks_v2.CloudTasksClient()

project = os.getenv("GCP_PROJECT")
location = os.getenv("GCP_LOCATION")
location = os.getenv("GCP_REGION")
queue = os.getenv("QUEUE")
url = os.getenv("FUNCTION_URL")
dry_run = bool(os.getenv("IS_DRY_RUN"))
Expand Down
2 changes: 1 addition & 1 deletion cerulean_cloud/cloud_function_historical_run/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def handler_queue(filtered_scenes, trigger_id):

project = os.getenv("GCP_PROJECT")
queue = os.getenv("QUEUE")
location = os.getenv("GCP_LOCATION")
location = os.getenv("GCP_REGION")
url = os.getenv("ORCHESTRATOR_URL")
dry_run = bool(os.getenv("IS_DRY_RUN"))

Expand Down
2 changes: 1 addition & 1 deletion cerulean_cloud/cloud_function_scene_relevancy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def handler_queue(filtered_scenes, trigger_id):

project = os.getenv("GCP_PROJECT")
queue = os.getenv("QUEUE")
location = os.getenv("GCP_LOCATION")
location = os.getenv("GCP_REGION")
url = os.getenv("ORCHESTRATOR_URL")
dry_run = bool(os.getenv("IS_DRY_RUN"))

Expand Down
2 changes: 1 addition & 1 deletion stack/cloud_function_ais_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
config_values = {
"DB_URL": database.sql_instance_url_with_asyncpg,
"GCP_PROJECT": pulumi.Config("gcp").require("project"),
"GCP_LOCATION": pulumi.Config("gcp").require("region"),
"GCP_REGION": pulumi.Config("gcp").require("region"),
"QUEUE": queue.name,
"FUNCTION_NAME": function_name,
"API_KEY": pulumi.Config("cerulean-cloud").require("apikey"),
Expand Down
2 changes: 1 addition & 1 deletion stack/cloud_function_historical_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
config_values = {
"DB_URL": database.sql_instance_url,
"GCP_PROJECT": pulumi.Config("gcp").require("project"),
"GCP_LOCATION": pulumi.Config("gcp").require("region"),
"GCP_REGION": pulumi.Config("gcp").require("region"),
"QUEUE": cloud_function_scene_relevancy.queue.name,
"ORCHESTRATOR_URL": cloud_run_orchestrator.default.statuses[0].url,
"FUNCTION_NAME": function_name,
Expand Down
2 changes: 1 addition & 1 deletion stack/cloud_function_scene_relevancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
config_values = {
"DB_URL": database.sql_instance_url,
"GCP_PROJECT": pulumi.Config("gcp").require("project"),
"GCP_LOCATION": pulumi.Config("gcp").require("region"),
"GCP_REGION": pulumi.Config("gcp").require("region"),
"QUEUE": queue.name,
"ORCHESTRATOR_URL": cloud_run_orchestrator.default.statuses[0].url,
"FUNCTION_NAME": function_name,
Expand Down
4 changes: 4 additions & 0 deletions stack/cloud_run_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
name="PROJECT_ID",
value=pulumi.Config("gcp").require("project"),
),
gcp.cloudrun.ServiceTemplateSpecContainerEnvArgs(
name="GCP_REGION",
value=pulumi.Config("gcp").require("region"),
),
gcp.cloudrun.ServiceTemplateSpecContainerEnvArgs(
name="API_KEY",
value=pulumi.Config("cerulean-cloud").require("apikey"),
Expand Down

0 comments on commit 5111484

Please sign in to comment.