FIRST-Tech-Challenge / fmltc

FIRST Machine Learning Toolchain
Other
38 stars 14 forks source link

Tweak app engine settings #213

Closed cmacfarl closed 2 years ago

cmacfarl commented 2 years ago

Tweaks the app engine settings in terraform to reduce costs.

The big change is to set min_instances to 1. That should reduce costs almost 50%. The rest of the changes are to make the app engine scheduler less aggressive about spinning up new instances.

github-actions[bot] commented 2 years ago

Terraform plan Succeeded for Workspace: default

Show Output ```diff An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: ! update in-place -/+ destroy and then create replacement Terraform will perform the following actions: # module.dev.google_app_engine_standard_app_version.fmltc-app-v1 will be updated in-place ! resource "google_app_engine_standard_app_version" "fmltc-app-v1" { id = "apps/ftc-ml-firstinspires-dev/services/default/versions/v1" name = "apps/ftc-ml-firstinspires-dev/services/default/versions/v1" # (9 unchanged attributes hidden) ! automatic_scaling { ! max_concurrent_requests = 10 -> 20 ! max_idle_instances = 3 -> 2 ! min_pending_latency = "1s" -> "0.1s" # (2 unchanged attributes hidden) ! standard_scheduler_settings { ! min_instances = 2 -> 1 ! target_cpu_utilization = 0.5 -> 0.8 # (2 unchanged attributes hidden) } } ! deployment { ! zip { ! source_url = "https://storage.googleapis.com/ftc-ml-firstinspires-dev-gae-source/4cfd8239004034f9f4eb8674c67e4ae5.zip" -> "https://storage.googleapis.com/ftc-ml-firstinspires-dev-gae-source/08ec777ffaad031764fc5b0caf9d14d8.zip" # (1 unchanged attribute hidden) } } - handlers { - auth_fail_action = "AUTH_FAIL_ACTION_REDIRECT" -> null - login = "LOGIN_OPTIONAL" -> null - security_level = "SECURE_OPTIONAL" -> null - url_regex = ".*" -> null - script { - script_path = "auto" -> null } } # (8 unchanged blocks hidden) } # module.dev.google_cloudfunctions_function.perform-action will be updated in-place ! resource "google_cloudfunctions_function" "perform-action" { id = "projects/ftc-ml-firstinspires-dev/locations/us-central1/functions/perform_action" name = "perform_action" ! source_archive_object = "fdf9d465f8206b66c7c21cebe412ae8b.zip" -> "b6d102d2c96183f1142d24b3fc9a00e9.zip" # (13 unchanged attributes hidden) # (2 unchanged blocks hidden) } # module.dev.google_storage_bucket_object.app-server-archive must be replaced -/+ resource "google_storage_bucket_object" "app-server-archive" { ! content_type = "application/zip" -> (known after apply) ! crc32c = "un+2pg==" -> (known after apply) ! detect_md5hash = "TP2COQBANPn064Z0xn5K5Q==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gae-source-4cfd8239004034f9f4eb8674c67e4ae5.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "TP2COQBANPn064Z0xn5K5Q==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/4cfd8239004034f9f4eb8674c67e4ae5.zip?generation=1637116899296101&alt=media" -> (known after apply) - metadata = {} -> null ! name = "4cfd8239004034f9f4eb8674c67e4ae5.zip" -> "08ec777ffaad031764fc5b0caf9d14d8.zip" # forces replacement ! output_name = "4cfd8239004034f9f4eb8674c67e4ae5.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/4cfd8239004034f9f4eb8674c67e4ae5.zip" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (2 unchanged attributes hidden) } # module.dev.google_storage_bucket_object.cloud-function-archive must be replaced -/+ resource "google_storage_bucket_object" "cloud-function-archive" { ! content_type = "application/zip" -> (known after apply) ! crc32c = "+GAkeA==" -> (known after apply) ! detect_md5hash = "/fnUZfgga2bHwhzr5BKuiw==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gcf-source-fdf9d465f8206b66c7c21cebe412ae8b.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "/fnUZfgga2bHwhzr5BKuiw==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/fdf9d465f8206b66c7c21cebe412ae8b.zip?generation=1637116899301174&alt=media" -> (known after apply) - metadata = {} -> null ! name = "fdf9d465f8206b66c7c21cebe412ae8b.zip" -> "b6d102d2c96183f1142d24b3fc9a00e9.zip" # forces replacement ! output_name = "fdf9d465f8206b66c7c21cebe412ae8b.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/fdf9d465f8206b66c7c21cebe412ae8b.zip" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (2 unchanged attributes hidden) } Plan: 2 to add, 2 to change, 2 to destroy. ```