Skip to content

Commit 757d4ec

Browse files
mollyheamazonrsareddy0329
authored andcommitted
Init experience template agnostic change (TODO: CFN) (#241)
* decouple template from src code * update unit tests for init * remove field validator from SDK pydantic model, fix minor parsing problem with list, update kubernetes_version type from str to float * Update pyproject.toml for cluster stack template to include json, update read_only to be boolean * change type handler from class to module functions, change some public function to private, update unit tests * update create for pytorch job template, remove redundant integ test code for init
1 parent 6ed3031 commit 757d4ec

File tree

19 files changed

+1365
-875
lines changed

19 files changed

+1365
-875
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
from hyperpod_cluster_stack_template.v1_0 import model as v1
14+
15+
SCHEMA_REGISTRY = {
16+
"1.0": v1.ClusterStackBase
17+
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic import BaseModel, Field
1+
from pydantic import BaseModel, Field, field_validator
22
from typing import Optional, Literal, List, Any, Union
33

44
class ClusterStackBase(BaseModel):
@@ -51,3 +51,9 @@ class ClusterStackBase(BaseModel):
5151
storage_capacity: Optional[int] = Field(1200, description="Storage capacity for the FSx file system in GiB")
5252
fsx_file_system_id: Optional[str] = Field("", description="Existing FSx file system ID")
5353

54+
@field_validator('kubernetes_version', mode='before')
55+
@classmethod
56+
def validate_kubernetes_version(cls, v):
57+
if v is not None:
58+
return str(v)
59+
return v

0 commit comments

Comments
 (0)