FIRST-Tech-Challenge / fmltc

FIRST Machine Learning Toolchain
Other
38 stars 14 forks source link

Reduced time for deploying to app engine #272

Closed lizlooney closed 1 year ago

lizlooney commented 1 year ago

Moved code that is used for app engine into a separate subdirectory so that app engine doesn't need to depend on tensorflow or opencv.

Some of the python files in the app_engine subdirectory are also used for the cloud function.

Changed layout.html to load WithSupportFromGoogleCloud.png from cloud storage.

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: + create ! 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/5d703a45cb5b4c8b8452aeecb4a49d1c.zip" -> "https://storage.googleapis.com/ftc-ml-firstinspires-dev-gae-source/3c3a2bb1f41915350e2980cfbdfb83c7.zip" # (1 unchanged attribute hidden) } } ! handlers { ! url_regex = "/(.*\\.png)" -> "/(.*\\.txt)" # (3 unchanged attributes hidden) ! static_files { ! mime_type = "image/png" -> "plain/text" ! upload_path_regex = "static/(.*\\.png)" -> "static/(.*\\.txt)" # (5 unchanged attributes hidden) } } ! handlers { + redirect_http_response_code = "REDIRECT_HTTP_RESPONSE_CODE_301" ! security_level = "SECURE_OPTIONAL" -> "SECURE_ALWAYS" ! url_regex = "/(.*\\.txt)" -> "/.*" # (2 unchanged attributes hidden) + script { + script_path = "auto" } - static_files { - application_readable = false -> null - expiration = "0s" -> null - http_headers = {} -> null - mime_type = "plain/text" -> null - path = "static/\\1" -> null - require_matching_file = false -> null - upload_path_regex = "static/(.*\\.txt)" -> null } } ! handlers { - redirect_http_response_code = "REDIRECT_HTTP_RESPONSE_CODE_301" -> null ! security_level = "SECURE_ALWAYS" -> "SECURE_OPTIONAL" ! url_regex = "/.*" -> ".*" # (2 unchanged attributes hidden) # (1 unchanged block 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 } } - 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 } } # (5 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 = "12cc55ee9623c7217fe1199349d4b942.zip" -> "ae146d1f6283f0301161464144dc2201.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 = "IkVZpA==" -> (known after apply) ! detect_md5hash = "XXA6RctbTIuEUq7stKSdHA==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gae-source-5d703a45cb5b4c8b8452aeecb4a49d1c.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "XXA6RctbTIuEUq7stKSdHA==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/5d703a45cb5b4c8b8452aeecb4a49d1c.zip?generation=1662170227757712&alt=media" -> (known after apply) - metadata = {} -> null ! name = "5d703a45cb5b4c8b8452aeecb4a49d1c.zip" -> "3c3a2bb1f41915350e2980cfbdfb83c7.zip" # forces replacement ! output_name = "5d703a45cb5b4c8b8452aeecb4a49d1c.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gae-source/o/5d703a45cb5b4c8b8452aeecb4a49d1c.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" { ! content_type = "application/css" -> "text/javascript" # forces replacement ! crc32c = "dXtlXg==" -> (known after apply) ! detect_md5hash = "9jlHl3OsxRFQF8nBoHClvw==" -> "different hash" - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-compiled/js/fmltc.js" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "9jlHl3OsxRFQF8nBoHClvw==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev/o/compiled%2Fjs%2Ffmltc.js?generation=1662170227763697&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 # (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 = "2vN4+g==" -> (known after apply) ! detect_md5hash = "EsxV7pYjxyF/4RmTSdS5Qg==" -> "different hash" # forces replacement - event_based_hold = false -> null ! id = "ftc-ml-firstinspires-dev-gcf-source-12cc55ee9623c7217fe1199349d4b942.zip" -> (known after apply) + kms_key_name = (known after apply) ! md5hash = "EsxV7pYjxyF/4RmTSdS5Qg==" -> (known after apply) ! media_link = "https://storage.googleapis.com/download/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/12cc55ee9623c7217fe1199349d4b942.zip?generation=1662170227747196&alt=media" -> (known after apply) - metadata = {} -> null ! name = "12cc55ee9623c7217fe1199349d4b942.zip" -> "ae146d1f6283f0301161464144dc2201.zip" # forces replacement ! output_name = "12cc55ee9623c7217fe1199349d4b942.zip" -> (known after apply) ! self_link = "https://www.googleapis.com/storage/v1/b/ftc-ml-firstinspires-dev-gcf-source/o/12cc55ee9623c7217fe1199349d4b942.zip" -> (known after apply) ! storage_class = "STANDARD" -> (known after apply) - temporary_hold = false -> null # (2 unchanged attributes hidden) } # module.dev.google_storage_bucket_object.with_support_from_google_cloud will be created + resource "google_storage_bucket_object" "with_support_from_google_cloud" { + bucket = "ftc-ml-firstinspires-dev" + content_type = "image/png" + crc32c = (known after apply) + detect_md5hash = "different hash" + id = (known after apply) + kms_key_name = (known after apply) + md5hash = (known after apply) + media_link = (known after apply) + name = "static/WithSupportFromGoogleCloud.png" + output_name = (known after apply) + self_link = (known after apply) + source = "./../../server/static/WithSupportFromGoogleCloud.png" + storage_class = (known after apply) } # 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: 5 to add, 2 to change, 4 to destroy. ```