fix: mitigate 429 errors in cloud function execution for validation reports #883
+134
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This PR adds a cloud task to the infrastructure to handle tasks that can be executed within two hours and has a rate of 8 concurrent requests. The call from the gtfs_validator_execution workflow to the process-validation-report function is wrapped with the added cloud task.
From our AI friend
This pull request includes several changes to the infrastructure and workflow configurations to improve the handling of cloud tasks and permissions. The most important changes include adding new resources for cloud task queues, updating IAM permissions, and modifying the workflow for task enqueuing and handling.
Infrastructure Changes:
x_number_of_concurrent_instance
to define the number of concurrent instances. (infra/functions-python/main.tf
, infra/functions-python/main.tfR26-R27)google_cloud_tasks_queue
resource) to handle failed cloud tasks with specific rate limits and retry configurations. (infra/functions-python/main.tf
, infra/functions-python/main.tfR351-R390)google_cloud_tasks_queue
resource) with defined rate limits and retry configurations for cloud tasks. (infra/functions-python/main.tf
, infra/functions-python/main.tfR351-R390)IAM Permissions:
infra/workflows/main.tf
, infra/workflows/main.tfR55-R80)Workflow Modifications:
gtfs_validator_execution.yml
workflow to extract the environment from the project ID and use it to define the cloud task queue name. (workflows/gtfs_validator_execution.yml
, workflows/gtfs_validator_execution.ymlR22-R24)workflows/gtfs_validator_execution.yml
, workflows/gtfs_validator_execution.ymlL224-R297)Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.sh
to make sure you didn't break anything