Skip to content

Commit 68c28f9

Browse files
mollyheamazonrsareddy0329
authored andcommitted
Bugbash fix (#246)
* decouple template from src code * remove field validator from SDK pydantic model, fix minor parsing problem with list, update kubernetes_version type from str to float * change type handler from class to module functions, change some public function to private, update unit tests * cluster-stack template agnostic change * update unit tests * update integ test * resolve circular import for cluster_stack * resolve rebase merge conflict * rename to_domain to to_config for cluster_stack * increase timeout for endpoint integ test from 15min to 20min * move jinja template to schema template * lazy loading in pytorch-job template to resolve import issue * tasks_per_node validation added, correct typo for task governance related parameter * get default namespace applied to inference for init experience, ignore pydantic warning, update logging experience * update integ test * fix integ test * Update default namespace logic, init_constants.py naming change * update unit test
1 parent 3f7c7bc commit 68c28f9

File tree

28 files changed

+250
-404
lines changed

28 files changed

+250
-404
lines changed

hyperpod-cluster-stack-template/hyperpod_cluster_stack_template/registry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from hyperpod_cluster_stack_template.v1_0 import model as v1
14+
from hyperpod_cluster_stack_template.v1_0.template import TEMPLATE_CONTENT as v1_template
1415

1516
SCHEMA_REGISTRY = {
1617
"1.0": v1.ClusterStackBase
18+
}
19+
20+
TEMPLATE_REGISTRY = {
21+
"1.0": v1_template
1722
}

src/sagemaker/hyperpod/cli/templates/cfn_cluster_creation.py renamed to hyperpod-cluster-stack-template/hyperpod_cluster_stack_template/v1_0/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CLOUDFORMATION_CLUSTER_CREATION_TEMPLATE = """### Please keep template file unchanged ###
1+
TEMPLATE_CONTENT = """### Please keep template file unchanged ###
22
Metadata:
33
AWS::CloudFormation::Interface:
44
ParameterGroups:

hyperpod-custom-inference-template/hyperpod_custom_inference_template/registry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from hyperpod_custom_inference_template.v1_0 import model as v1
14+
from hyperpod_custom_inference_template.v1_0.template import TEMPLATE_CONTENT as v1_template
1415

1516
SCHEMA_REGISTRY = {
1617
"1.0": v1.FlatHPEndpoint,
1718
}
19+
20+
TEMPLATE_REGISTRY = {
21+
"1.0": v1_template
22+
}

hyperpod-custom-inference-template/hyperpod_custom_inference_template/v1_0/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FlatHPEndpoint(BaseModel):
3636
model_config = ConfigDict(extra="forbid")
3737

3838
namespace: Optional[str] = Field(
39-
default="default",
39+
default=None,
4040
description="Kubernetes namespace",
4141
min_length=1
4242
)

hyperpod-custom-inference-template/hyperpod_custom_inference_template/v1_0/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type": "null"
1212
}
1313
],
14-
"default": "default",
14+
"default": null,
1515
"description": "Kubernetes namespace",
1616
"title": "Namespace"
1717
},

src/sagemaker/hyperpod/cli/templates/k8s_custom_endpoint_template.py renamed to hyperpod-custom-inference-template/hyperpod_custom_inference_template/v1_0/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KUBERNETES_CUSTOM_ENDPOINT_TEMPLATE = """### Please keep template file unchanged ###
1+
TEMPLATE_CONTENT = """### Please keep template file unchanged ###
22
apiVersion: hyperpod.sagemaker.aws/v1
33
kind: HPEndpoint
44
metadata:

hyperpod-jumpstart-inference-template/hyperpod_jumpstart_inference_template/registry.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from hyperpod_jumpstart_inference_template.v1_0 import model as v1
14+
from hyperpod_jumpstart_inference_template.v1_0.template import TEMPLATE_CONTENT as v1_template
1415

1516
SCHEMA_REGISTRY = {
1617
"1.0": v1.FlatHPJumpStartEndpoint,
1718
}
19+
20+
TEMPLATE_REGISTRY = {
21+
"1.0": v1_template
22+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class FlatHPJumpStartEndpoint(BaseModel):
2727
model_config = ConfigDict(extra="forbid")
2828

2929
namespace: Optional[str] = Field(
30-
default="default",
30+
default=None,
3131
description="Kubernetes namespace",
3232
min_length=1
3333
)
@@ -87,6 +87,7 @@ class FlatHPJumpStartEndpoint(BaseModel):
8787
def validate_name(self):
8888
if not self.metadata_name and not self.endpoint_name:
8989
raise ValueError("Either metadata_name or endpoint_name must be provided")
90+
return self
9091

9192

9293
def to_domain(self) -> HPJumpStartEndpoint:

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
@@ -11,7 +11,7 @@
1111
"type": "null"
1212
}
1313
],
14-
"default": "default",
14+
"default": null,
1515
"description": "Kubernetes namespace",
1616
"title": "Namespace"
1717
},

src/sagemaker/hyperpod/cli/templates/k8s_js_endpoint_template.py renamed to hyperpod-jumpstart-inference-template/hyperpod_jumpstart_inference_template/v1_0/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KUBERNETES_JS_ENDPOINT_TEMPLATE = """### Please keep template file unchanged ###
1+
TEMPLATE_CONTENT = """### Please keep template file unchanged ###
22
apiVersion: inference.sagemaker.aws.amazon.com/v1alpha1
33
kind: JumpStartModel
44
metadata:

0 commit comments

Comments
 (0)