feat: Switch internal service deploy command to deploy image digest under the hood (DBTP-3150) - #1564
feat: Switch internal service deploy command to deploy image digest under the hood (DBTP-3150)#1564DeveloperConnor wants to merge 3 commits into
Conversation
|
Your PR has commits that are missing the Signed-off-by trailer. This is likely due to the pre-commit hook not being configured on your local machine. The usual fix for this issue is to run |
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Your PR has commits that are missing the Signed-off-by trailer. This is likely due to the pre-commit hook not being configured on your local machine. The usual fix for this issue is to run |
| image_uri="563763463626.dkr.ecr.eu-west-2.amazonaws.com/some-app/web:latest" | ||
| ) | ||
|
|
||
| assert digest == "sha256:123456" |
There was a problem hiding this comment.
Can we assert that batch_get_image got called with the right arguments too (so that the regex matching is testing)?
| assert register_task_def_kwargs["service"] == "web" | ||
| assert register_task_def_kwargs["image_tag"] == "tag-123" | ||
| assert register_task_def_kwargs["task_definition"] == {"fakeTaskDefinition": "FAKE"} | ||
| assert register_task_def_kwargs["task_definition"] == { |
There was a problem hiding this comment.
Would be good to test the value of register_task_def_kwargs["image_digest"]
| - [platform-helper secrets](#platform-helper-secrets) | ||
| - [platform-helper secrets create](#platform-helper-secrets-create) | ||
| - [platform-helper secrets copy](#platform-helper-secrets-copy) | ||
| - [platform-helper secrets list](#platform-helper-secrets-list) |
There was a problem hiding this comment.
why is this being added back in? Do you need to regenerate the docs?
There was a problem hiding this comment.
Nice spot, shouldn't be there
|
Once we upgrade our test tier (and maybe low tier) services, we should maybe run the codebase pipelines before rolling out to higher tiers |
| for container in task_definition["containerDefinitions"]: | ||
| if container["name"] == service: | ||
| image_digest = self.ecr_provider.get_image_digest_for_uri( | ||
| f"{container['image']}:{image_tag}" |
There was a problem hiding this comment.
so the containerDefinitions.image field in the task def doesn't already contain the tag?
| return image_ref | ||
|
|
||
| def get_image_digest_for_uri(self, image_uri: str) -> str: | ||
| pattern = ( |
There was a problem hiding this comment.
what if it is like great, where they already use a sha?
123456789.dkr.ecr.eu-west-2.amazonaws.com/great/subfolder@sha256:123456789blablablaetcetcetc
Addresses https://uktrade.atlassian.net/browse/DBTP-3150.
platform-helper internal service deploynow deploys image digest to the ECS task definition, instead of tag. See ticket for further details behind reasoning.Added unit test case to cover the new method, also manually tested by deploying to ECS and validating the resulting task definition.
Checklist:
Title:
feat: Add new feature (DBTP-1234)orchore: Correct typo (off-ticket)Description:
Tasks:
Reviewer Checklist