Skip to content

#281 Updated container naming rules#283

Merged
jathavaan merged 1 commit into
mainfrom
feature/281-refactor-test-matrix
May 19, 2026
Merged

#281 Updated container naming rules#283
jathavaan merged 1 commit into
mainfrom
feature/281-refactor-test-matrix

Conversation

@jathavaan
Copy link
Copy Markdown
Collaborator

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:

  • Added a new _container_group_name function in main.py that 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.
  • Updated all usages of container group name construction to use the new _container_group_name function, including in _run_container_benchmark and _clear_all_container_instances. [1] [2]

Dependency updates:

  • Added import hashlib to support the new hashing logic for container group names.

@jathavaan jathavaan self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 17:50
@jathavaan jathavaan merged commit bbb8c11 into main May 19, 2026
@jathavaan jathavaan deleted the feature/281-refactor-test-matrix branch May 19, 2026 17:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hashlib import to support hashing for long names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.py
@@ -1,4 +1,5 @@
import json
import hashlib
Comment thread main.py
if len(name) <= 63:
return name

digest = hashlib.sha1(experiment_id.encode()).hexdigest()[:8]
Comment thread main.py
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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants