This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add ECS worker option to use most recent revision in task definition family #370
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.
Closes #368
Adds an option to the ECS worker for using the most recent revision in the task definition family.
Using the family name from the
family
field on either the work pool or the deployment'sjob_variables
("prefect"
if left empty), the most recent revision of that family's task definition is retrieved and compared against the task definition constructed by the worker. If they are a match, the retrieved task definition's ARN is used rather than proceeding with registration of a new task definition. These steps are only taken if the task definition cache is empty or the cached definition fails to validate.This approach is similar to the one implemented in Jenkins and should reduce occurrences of task definition registration when used effectively.
It should be noted that careful
family
name management is required across deployments which share matching configuration, else new registration of task definitions not present in the worker's cache within a single family may reduce the usefulness of this option.Example
A new worker with an empty cache picks up the most recent revision from the
prefect
family since the deployment's configuration matches:Upon a second run of the deployment, the in-memory cache is used instead:
Checklist
pre-commit
checks.pre-commit install && pre-commit run --all
locally for formatting and linting.mkdocs serve
view documentation locally.