Skip to content

Commit

Permalink
Merge pull request #33 from SchmidtDSE/feat/cloud_tasks
Browse files Browse the repository at this point in the history
Feat/cloud tasks
  • Loading branch information
GondekNP authored Mar 4, 2024
2 parents d0e4382 + 35d139d commit 353785e
Show file tree
Hide file tree
Showing 15 changed files with 3,701 additions and 172 deletions.
1 change: 1 addition & 0 deletions .deployment/prod_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- google-auth
- google-cloud-secret-manager
- google-cloud-logging
- google-cloud-tasks
- rioxarray
- stackstac
- gdal
Expand Down
50 changes: 7 additions & 43 deletions .deployment/tofu/modules/burn_backend/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,49 +53,6 @@ resource "google_compute_router_nat" "burn_backend_nat" {
}
}

# Create a Cloud Run service for titiler - for later
# resource "google_cloud_run_v2_service" "titiler_service" {
# name = "titiler-service"
# location = "us-central1"

# template {
# service_account = google_service_account.burn-backend-service.email
# timeout = "3599s" # max timeout is one hour
# containers {
# image = "ghcr.io/developmentseed/titiler:0.15.8" # Use the titiler Docker image
# resources {
# limits = {
# cpu = "2"
# memory = "2Gi"
# }
# }
# }
# vpc_access {
# connector = google_vpc_access_connector.burn_backend_vpc_connector.id
# egress = "ALL_TRAFFIC"
# }
# }

# traffic {
# percent = 100
# type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
# }

# lifecycle { # This helps to not replace the service if it already exists
# ignore_changes = [
# template[0].containers[0].image,
# ]
# }
# }

# # Allow unauthenticated invocations
# resource "google_cloud_run_service_iam_member" "public_titiler" {
# service = google_cloud_run_v2_service.titiler_service.name
# location = google_cloud_run_v2_service.titiler_service.location
# role = "roles/run.invoker"
# member = "allUsers"
# }

# Create a Cloud Run service for burn-backend services
resource "google_cloud_run_v2_service" "tf-rest-burn-severity" {
name = "tf-rest-burn-severity-${terraform.workspace}"
Expand Down Expand Up @@ -188,6 +145,13 @@ resource "google_cloud_run_v2_service" "tf-rest-burn-severity" {
}
}

# Create a Cloud Tasks queue for the Cloud Run service
resource "google_cloud_tasks_queue" "tf-rest-burn-severity-queue" {
name = "tf-rest-burn-severity-queue-${terraform.workspace}"
location = "us-central1"
}


# Allow unauthenticated invocations
resource "google_cloud_run_service_iam_member" "public" {
service = google_cloud_run_v2_service.tf-rest-burn-severity.name
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/dev_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- google-auth
- google-cloud-secret-manager
- google-cloud-logging
- google-cloud-tasks
- ipykernel
- rioxarray
- stackstac
Expand Down
Loading

0 comments on commit 353785e

Please sign in to comment.