Skip to content

Commit 04da353

Browse files
authored
Add a tag for the latest released image SHA for autopatch images (#4491)
* Add a tag for the latest released image SHA for autopatch images * test with PT inference autopatch build * only include SHA after the colon * test with PT arm64 inference autopatch build * Restore ['dlc_developer_config.toml'] dlc_developer_config.toml: ('Restore to ' 'https://raw.githubusercontent.com/aws/deep-learning-containers/master/dlc_developer_config.toml')
1 parent d18d984 commit 04da353

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/patch_helper.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import boto3
33
import concurrent.futures
44
import json
5+
from datetime import datetime
56

67
import constants
78

@@ -283,6 +284,12 @@ def conduct_autopatch_build_setup(pre_push_image_object: DockerImage, download_p
283284
)
284285
pre_push_image_object.info = info
285286
pre_push_image_object.context = context
287+
288+
# add latest released image SHA as an additional tag
289+
datetime_str = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
290+
sha_after_colon = latest_released_image_sha.split(":")[1]
291+
pre_push_image_object.additional_tags.append(f"lastsha-{datetime_str}-{sha_after_colon}")
292+
286293
return constants.SUCCESS
287294

288295

0 commit comments

Comments
 (0)