FIRST-Tech-Challenge / fmltc

FIRST Machine Learning Toolchain
Other
38 stars 14 forks source link

Fixed admin action for deleting blobs #277

Closed lizlooney closed 1 year ago

lizlooney commented 1 year ago

Sharded the expunge blob storage admin action into 16 separate cloud functions, one for each letter that a team_uuid can begin with.

In blob_storage.expunge_blob_storage, fixed code that incorrectly set max_results, and delete blobs 100 at a time to avoid the cloud function timeout.

github-actions[bot] commented 1 year 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 { ! min_pending_latency = "0.100s" -> "0.1s" # (4 unchanged attributes hidden) # (1 unchanged block hidden) } ! deployment { ! zip { ! source_url = "https://storage.googleapis.com/ftc-ml-firstinspires-dev-gae-source/46f5515190910ba51b4b89e942cd35eb.zip" -> "https://storage.googleapis.com/ftc-ml-firstinspires-dev-gae-source/989e878bd177aeef154f6ae3c6119ed6.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 = "9c1e531dc2380f62c382fae27c405089.zip" -> "0be7af6fcc9ae8adeead95182fb70912.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 = "0Y/S5Q==" -> (known after apply) ! detect_md5hash = "RvVRUZCRC6UbS4npQs016w==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gae-source-46f5515190910ba51b4b89e942cd35eb.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "RvVRUZCRC6UbS4npQs016w==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/46f5515190910ba51b4b89e942cd35eb.zip?generation=1662749872778587&alt=media" -> (known after apply) - metadata = {} -> null ! name = "46f5515190910ba51b4b89e942cd35eb.zip" -> "989e878bd177aeef154f6ae3c6119ed6.zip" # forces replacement ! output_name = "46f5515190910ba51b4b89e942cd35eb.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/46f5515190910ba51b4b89e942cd35eb.zip" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (2 unchanged attributes hidden) } # module.dev.google_storage_bucket_object.closure_js must be replaced -/+ resource "google_storage_bucket_object" "closure_js" { ! crc32c = "Y+sBsw==" -> (known after apply) ! detect_md5hash = "h5dOk1PHXZ15tndiqxl8+Q==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-compiled/js/fmltc.js" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "h5dOk1PHXZ15tndiqxl8+Q==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev/o/compiled%2Fjs%2Ffmltc.js?generation=1662746781243396&alt=media" -> (known after apply) - metadata = {} -> null name = "compiled/js/fmltc.js" ! output_name = "compiled/js/fmltc.js" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev/o/compiled%2Fjs%2Ffmltc.js" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (3 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 = "vdw2MQ==" -> (known after apply) ! detect_md5hash = "nB5THcI4D2LDgvrifEBQiQ==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gcf-source-9c1e531dc2380f62c382fae27c405089.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "nB5THcI4D2LDgvrifEBQiQ==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/9c1e531dc2380f62c382fae27c405089.zip?generation=1662749872815473&alt=media" -> (known after apply) - metadata = {} -> null ! name = "9c1e531dc2380f62c382fae27c405089.zip" -> "0be7af6fcc9ae8adeead95182fb70912.zip" # forces replacement ! output_name = "9c1e531dc2380f62c382fae27c405089.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/9c1e531dc2380f62c382fae27c405089.zip" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (2 unchanged attributes hidden) } # module.dev.module.serverless-connector.google_vpc_access_connector.connector_beta["central-serverless"] must be replaced -/+ resource "google_vpc_access_connector" "connector_beta" { ! id = "projects/ftc-ml-firstinspires-dev/locations/us-central1/connectors/central-serverless" -> (known after apply) ! max_instances = 7 -> (known after apply) ! min_instances = 2 -> (known after apply) name = "central-serverless" - network = "ml-redis-vpc-dev" -> null # forces replacement ! self_link = "projects/ftc-ml-firstinspires-dev/locations/us-central1/connectors/central-serverless" -> (known after apply) ! state = "READY" -> (known after apply) # (5 unchanged attributes hidden) ! subnet { name = "serverless-subnet" ! project_id = "ftc-ml-firstinspires-dev" -> (known after apply) } } Plan: 4 to add, 2 to change, 4 to destroy. ```