Skip to content

Commit

Permalink
Move Image Features to AzureImageSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalca committed Apr 29, 2024
1 parent d5a5f7b commit 751e829
Show file tree
Hide file tree
Showing 5 changed files with 428 additions and 261 deletions.
2 changes: 1 addition & 1 deletion lisa/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def create_setting(

@classmethod
def create_image_requirement(
cls, *args: Any, **kwargs: Any
cls, image: schema.ImageSchema
) -> Optional[schema.FeatureSettings]:
"""
It's called in the platform to check if an image restricts the feature or not.
Expand Down
9 changes: 5 additions & 4 deletions lisa/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,6 @@ class NodeSpace(search_space.RequirementMixin, TypedSchema, ExtendableSchemaMixi
),
)

# Platform may add image features to
# keep track of platform requirements.
_image_features: Optional[Dict[str, Any]] = None

def __post_init__(self, *args: Any, **kwargs: Any) -> None:
# clarify types to avoid type errors in properties.
self._features: Optional[search_space.SetSpace[FeatureSettings]]
Expand Down Expand Up @@ -1624,6 +1620,11 @@ class ImageSchema:
pass


class ArchitectureType(str, Enum):
x64 = "x64"
Arm64 = "Arm64"


def load_by_type(schema_type: Type[T], raw_runbook: Any, many: bool = False) -> T:
"""
Convert dict, list or base typed schema to specified typed schema.
Expand Down
Loading

0 comments on commit 751e829

Please sign in to comment.