Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false
steps:
- name: Checkout repository to $GITHUB_WORKSPACE
Expand Down Expand Up @@ -58,4 +58,4 @@ jobs:

- name: Run ShellCheck
if: runner.os == 'Linux' && matrix.python-version == '3.8'
uses: ludeeus/action-shellcheck@0.5.0
uses: ludeeus/action-shellcheck@0.5.0
2 changes: 1 addition & 1 deletion lisa/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _get_environment_id() -> int:
class EnvironmentMessage(MessageBase):
type: str = "Environment"
name: str = ""
runbook: schema.Environment = schema.Environment()
runbook: schema.Environment = field(default_factory=schema.Environment)
status: EnvironmentStatus = EnvironmentStatus.New


Expand Down
3 changes: 2 additions & 1 deletion lisa/features/nvme.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import re
from dataclasses import dataclass, field
from functools import partial
from typing import Any, List, Type

from dataclasses_json import dataclass_json
Expand Down Expand Up @@ -93,7 +94,7 @@ def _get_device_from_ls(self, force_run: bool = False) -> None:
class NvmeSettings(FeatureSettings):
type: str = "Nvme"
disk_count: search_space.CountSpace = field(
default=search_space.IntRange(min=0),
default_factory=partial(search_space.IntRange, min=0),
metadata=field_metadata(decoder=search_space.decode_count_space),
)

Expand Down
8 changes: 4 additions & 4 deletions lisa/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,21 +714,21 @@ class NodeSpace(search_space.RequirementMixin, TypedSchema, ExtendableSchemaMixi
name: str = ""
is_default: bool = field(default=False)
node_count: search_space.CountSpace = field(
default=search_space.IntRange(min=1),
default_factory=partial(search_space.IntRange, min=1),
metadata=field_metadata(decoder=search_space.decode_count_space),
)
core_count: search_space.CountSpace = field(
default=search_space.IntRange(min=1),
default_factory=partial(search_space.IntRange, min=1),
metadata=field_metadata(decoder=search_space.decode_count_space),
)
memory_mb: search_space.CountSpace = field(
default=search_space.IntRange(min=512),
default_factory=partial(search_space.IntRange, min=512),
metadata=field_metadata(decoder=search_space.decode_count_space),
)
disk: Optional[DiskOptionSettings] = None
network_interface: Optional[NetworkInterfaceOptionSettings] = None
gpu_count: search_space.CountSpace = field(
default=search_space.IntRange(min=0),
default_factory=partial(search_space.IntRange, min=0),
metadata=field_metadata(decoder=search_space.decode_count_space),
)
# all features on requirement should be included.
Expand Down
5 changes: 3 additions & 2 deletions selftests/test_search_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import logging
import unittest
from dataclasses import dataclass
from dataclasses import dataclass, field
from functools import partial
from typing import Any, List, Optional, TypeVar

from lisa.search_space import (
Expand All @@ -30,7 +31,7 @@ class MockSchema:

@dataclass
class MockItem(RequirementMixin):
number: CountSpace = IntRange(min=1, max=5)
number: CountSpace = field(default_factory=partial(IntRange, min=1, max=5))

def check(self, capability: Any) -> ResultReason:
assert isinstance(capability, MockItem), f"actual: {type(capability)}"
Expand Down