#281 Updated container naming rules#283
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces a centralized helper for generating Azure Container Instances (ACI) container group names that stay within Azure’s 63-character limit, then updates call sites to use it.
Changes:
- Added
_container_group_name(experiment_id)to enforce the 63-char max with truncation + short hash suffix. - Updated container group name construction in benchmark runs and cleanup to use the helper.
- Added
hashlibimport to support hashing for long names.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,4 +1,5 @@ | |||
| import json | |||
| import hashlib | |||
| if len(name) <= 63: | ||
| return name | ||
|
|
||
| digest = hashlib.sha1(experiment_id.encode()).hexdigest()[:8] |
Comment on lines
+133
to
+140
| name = f"benchmark-{experiment_id}" | ||
| if len(name) <= 63: | ||
| return name | ||
|
|
||
| digest = hashlib.sha1(experiment_id.encode()).hexdigest()[:8] | ||
| budget = 63 - len("benchmark-") - 1 - len(digest) | ||
| truncated = experiment_id[:budget].rstrip("-") | ||
| return f"benchmark-{truncated}-{digest}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request improves how container group names are generated and handled, especially to ensure they do not exceed Azure's 63-character limit. The main changes introduce a helper function to generate compliant container group names, update all relevant usages, and add a hashing mechanism for long names.
Container group name handling:
_container_group_namefunction inmain.pythat generates container group names compliant with Azure's 63-character limit, using a truncated experiment ID and an 8-character SHA-1 hash suffix if needed._container_group_namefunction, including in_run_container_benchmarkand_clear_all_container_instances. [1] [2]Dependency updates:
import hashlibto support the new hashing logic for container group names.