Skip to content

Commit 0d7c810

Browse files
update jumpstart and pytorch template for release (#248)
1 parent 1590894 commit 0d7c810

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

hyperpod-jumpstart-inference-template/hyperpod_jumpstart_inference_template/v1_0/model.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
from sagemaker.hyperpod.inference.config.hp_jumpstart_endpoint_config import (
1818
Model,
1919
SageMakerEndpoint,
20-
Server
20+
Server,
21+
TlsConfig
2122
)
2223
from sagemaker.hyperpod.inference.hp_jumpstart_endpoint import HPJumpStartEndpoint
2324

@@ -86,8 +87,12 @@ def to_domain(self) -> HPJumpStartEndpoint:
8687
instance_type=self.instance_type,
8788
)
8889
sage_ep = SageMakerEndpoint(name=self.endpoint_name)
90+
tls = (
91+
TlsConfig(tls_certificate_output_s3_uri=self.tls_certificate_output_s3_uri)
92+
)
8993
return HPJumpStartEndpoint(
9094
model=model,
9195
server=server,
9296
sage_maker_endpoint=sage_ep,
97+
tls_config=tls
9398
)

hyperpod-jumpstart-inference-template/hyperpod_jumpstart_inference_template/v1_0/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
}
7979
],
8080
"default": null,
81-
"description": "S3 URI to write the TLS certificate (optional)",
81+
"description": "S3 URI to write the TLS certificate",
8282
"title": "Tls Certificate Output S3 Uri"
8383
}
8484
},

hyperpod-pytorch-job-template/hyperpod_pytorch_job_template/v1_0/model.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
class VolumeConfig(BaseModel):
1818
model_config = ConfigDict(extra="forbid")
19-
2019
name: str = Field(
2120
...,
2221
description="Volume name",
@@ -38,7 +37,7 @@ class VolumeConfig(BaseModel):
3837
description="PVC claim name (required for pvc volumes)",
3938
min_length=1
4039
)
41-
read_only: Optional[bool] = Field(None, description="Read-only flag for pvc volumes")
40+
read_only: Optional[Literal['true', 'false']] = Field(None, description="Read-only flag for pvc volumes")
4241

4342
@field_validator('mount_path', 'path')
4443
@classmethod
@@ -108,10 +107,11 @@ class PyTorchJobConfig(BaseModel):
108107
description="Number of nodes",
109108
ge=1
110109
)
111-
tasks_per_node: Optional[str] = Field(
112-
default="auto",
110+
tasks_per_node: Optional[int] = Field(
111+
default=None,
113112
alias="tasks_per_node",
114-
description="Number of workers per node; supported values: [auto,cpu, gpu, int]",
113+
description="Number of tasks per node",
114+
ge=1
115115
)
116116
label_selector: Optional[Dict[str, str]] = Field(
117117
default=None,
@@ -282,7 +282,7 @@ def to_domain(self) -> Dict:
282282
elif vol.type == "pvc":
283283
pvc_config = PersistentVolumeClaim(
284284
claim_name=vol.claim_name,
285-
read_only=vol.read_only if vol.read_only is not None else False
285+
read_only=vol.read_only == "true" if vol.read_only else False
286286
)
287287
volume_obj = Volumes(name=vol.name, persistent_volume_claim=pvc_config)
288288
volumes.append(volume_obj)
@@ -357,4 +357,4 @@ def to_domain(self) -> Dict:
357357
"labels": metadata_labels,
358358
"spec": job_kwargs,
359359
}
360-
return result
360+
return result

hyperpod-pytorch-job-template/hyperpod_pytorch_job_template/v1_0/schema.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@
5454
"read_only": {
5555
"anyOf": [
5656
{
57-
"type": "boolean"
57+
"enum": [
58+
"true",
59+
"false"
60+
],
61+
"type": "string"
5862
},
5963
{
6064
"type": "null"
@@ -197,14 +201,15 @@
197201
"tasks_per_node": {
198202
"anyOf": [
199203
{
200-
"type": "string"
204+
"minimum": 1,
205+
"type": "integer"
201206
},
202207
{
203208
"type": "null"
204209
}
205210
],
206-
"default": "auto",
207-
"description": "Number of workers per node; supported values: [auto,cpu, gpu, int]",
211+
"default": null,
212+
"description": "Number of tasks per node",
208213
"title": "Tasks Per Node"
209214
},
210215
"label_selector": {

hyperpod-pytorch-job-template/hyperpod_pytorch_job_template/v1_1/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class PyTorchJobConfig(BaseModel):
110110
min_length=1
111111
)
112112
node_count: Optional[int] = Field(
113-
default=None,
113+
default=1,
114114
alias="node_count",
115115
description="Number of nodes",
116116
ge=1

hyperpod-pytorch-job-template/hyperpod_pytorch_job_template/v1_1/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
"type": "null"
203203
}
204204
],
205-
"default": null,
205+
"default": 1,
206206
"description": "Number of nodes",
207207
"title": "Node Count"
208208
},

0 commit comments

Comments
 (0)