Skip to content

Commit 26f8f82

Browse files
author
pintaoz
committed
Update cluster creation template url with versioning
1 parent c5edf2d commit 26f8f82

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

doc/cli/cluster_management/cli_cluster_management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ The `config.yaml` file supports the following parameters:
358358
| `create_s3_endpoint_stack` | BOOLEAN | Create S3 Endpoint stack | true |
359359
| `enable_hp_inference_feature` | BOOLEAN | Enable inference operator | false |
360360
| `stage` | TEXT | Deployment stage ("gamma" or "prod") | "prod" |
361-
| `custom_bucket_name` | TEXT | S3 bucket name for templates | "sagemaker-hyperpod-cluster-stack-bucket" |
361+
| `custom_bucket_name` | TEXT | S3 bucket name for templates | "aws-sagemaker-hyperpod-cluster" |
362362
| `create_life_cycle_script_stack` | BOOLEAN | Create Life Cycle Script Stack | true |
363363
| `create_s3_bucket_stack` | BOOLEAN | Create S3 Bucket Stack | true |
364364
| `s3_bucket_name` | TEXT | S3 bucket for cluster lifecycle scripts | "s3-bucket" |

hyperpod-cluster-stack-template/hyperpod_cluster_stack_template/v1_0/model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ClusterStackBase(BaseModel):
3535
create_s3_endpoint_stack: Optional[bool] = Field(True, description="Boolean to Create S3 Endpoint stack")
3636
enable_hp_inference_feature: Optional[bool] = Field(False, description="Boolean to enable inference operator in Hyperpod cluster")
3737
stage: Optional[str] = Field("prod", description="Deployment stage used in S3 bucket naming for inference operator. Valid values: \"gamma\", \"prod\"")
38-
custom_bucket_name: str = Field("sagemaker-hyperpod-cluster-stack-bucket", description="S3 bucket name for templates")
38+
custom_bucket_name: str = Field("aws-sagemaker-hyperpod-cluster", description="S3 bucket name for templates")
3939
create_life_cycle_script_stack: Optional[bool] = Field(True, description="Boolean to Create Life Cycle Script Stack")
4040
create_s3_bucket_stack: Optional[bool] = Field(True, description="Boolean to Create S3 Bucket Stack")
4141
s3_bucket_name: Optional[str] = Field("s3-bucket", description="The name of the S3 bucket used to store the cluster lifecycle scripts")
@@ -51,6 +51,7 @@ class ClusterStackBase(BaseModel):
5151
file_system_type_version: Optional[float] = Field(2.15, description="File system type version for the FSx file system")
5252
storage_capacity: Optional[int] = Field(1200, description="Storage capacity for the FSx file system in GiB")
5353
fsx_file_system_id: Optional[str] = Field("", description="Existing FSx file system ID")
54+
template_version: str = Field("1", description="Version number of cluster creation template")
5455

5556
@field_validator('kubernetes_version', mode='before')
5657
@classmethod
@@ -120,7 +121,7 @@ def to_config(self, region: str = None):
120121

121122
# Set fixed defaults
122123
defaults = {
123-
'custom_bucket_name': 'sagemaker-hyperpod-cluster-stack-bucket',
124+
'custom_bucket_name': 'aws-sagemaker-hyperpod-cluster',
124125
'github_raw_url': 'https://raw.githubusercontent.com/aws-samples/awsome-distributed-training/refs/heads/main/1.architectures/7.sagemaker-hyperpod-eks/LifecycleScripts/base-config/on_create.sh',
125126
'helm_repo_url': 'https://github.com/aws/sagemaker-hyperpod-cli.git',
126127
'helm_repo_path': 'helm_chart/HyperPodHelmChart'

hyperpod-cluster-stack-template/hyperpod_cluster_stack_template/v1_0/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
"title": "Stage"
440440
},
441441
"custom_bucket_name": {
442-
"default": "sagemaker-hyperpod-cluster-stack-bucket",
442+
"default": "aws-sagemaker-hyperpod-cluster",
443443
"description": "S3 bucket name for templates",
444444
"title": "Custom Bucket Name",
445445
"type": "string"

src/sagemaker/hyperpod/cluster_management/hp_cluster_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ def create(self,
112112
stack_name = f"HyperpodClusterStack-{str(uuid.uuid4())[:5]}"
113113
# Use the fixed bucket name from the model
114114
bucket_name = self.custom_bucket_name
115-
template_key = f"1.1/main-stack-eks-based-template.yaml"
115+
template_key = f"{self.template_version}/main-stack-eks-based-template.yaml"
116116

117117
try:
118118
# Use TemplateURL for large templates (>51KB)
119-
template_url = f"https://{bucket_name}.s3.amazonaws.com/{template_key}"
119+
template_url = f"https://{bucket_name}-{region}-{self.stage}.s3.amazonaws.com/{template_key}"
120120
response = cf.create_stack(
121121
StackName=stack_name,
122122
TemplateURL=template_url,

0 commit comments

Comments
 (0)