-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating pcluster to 3.5.1 and to pydantic > 2
- Loading branch information
Showing
6 changed files
with
163 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
devtools | ||
colorlog | ||
pydantic | ||
pydantic==2.3.0 | ||
pydantic-core==2.6.3 | ||
boto3 | ||
boto3-stubs[essential] | ||
datasize | ||
humanize | ||
rich-click | ||
pandas | ||
cookiecutter | ||
aws-parallelcluster==3.3.1 | ||
aws-parallelcluster==3.5.1 | ||
typer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
black | ||
watchdog | ||
pytest | ||
versioneer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Tests for `aws_pcluster_helpers` package.""" | ||
|
||
import unittest | ||
|
||
from aws_pcluster_helpers import ( | ||
PClusterConfig, | ||
PClusterConfigFiles, | ||
InstanceTypesData, | ||
PClusterInstanceTypes, | ||
InstanceTypesMappings, | ||
size_in_gib, | ||
) | ||
from aws_pcluster_helpers.utils.logging import setup_logger | ||
from aws_pcluster_helpers.models.config import ( | ||
ENV_PCLUSTER_CONFIG_FILE, | ||
ENV_INSTANCE_TYPES_DATA_FILE, | ||
ENV_INSTANCE_TYPE_MAPPINGS_FILE, | ||
) | ||
from aws_pcluster_helpers.models.sinfo import SInfoTable, SinfoRow | ||
import yaml | ||
import json | ||
import os | ||
from devtools import PrettyFormat, pprint, pformat, debug | ||
from rich.console import Console | ||
|
||
from aws_pcluster_helpers.commands import cli_sinfo | ||
from aws_pcluster_helpers.commands import cli_gen_nxf_slurm_config | ||
|
||
instance_types_data_file = os.path.join( | ||
os.path.dirname(__file__), "..", "instance-types-data.json" | ||
) | ||
instance_type_mapping_file = os.path.join( | ||
os.path.dirname(__file__), "..", "instance_name_type_mappings.json" | ||
) | ||
pcluster_config_file = os.path.join( | ||
os.path.dirname(__file__), "../", "pcluster_config.yml" | ||
) | ||
os.environ[ENV_INSTANCE_TYPE_MAPPINGS_FILE] = instance_type_mapping_file | ||
os.environ[ENV_INSTANCE_TYPES_DATA_FILE] = instance_types_data_file | ||
os.environ[ENV_PCLUSTER_CONFIG_FILE] = pcluster_config_file | ||
|
||
logger = setup_logger(logger_name="tests", log_level="DEBUG") | ||
|
||
|
||
def test_files(): | ||
assert os.path.exists(instance_type_mapping_file) | ||
assert os.path.exists(pcluster_config_file) | ||
assert os.path.exists(instance_types_data_file) | ||
|
||
|
||
def test_sinfo(): | ||
sinfo = SInfoTable() | ||
table = sinfo.get_table() | ||
console = Console() | ||
console.print(table) | ||
|
||
|
||
def test_load_pcluster_config(): | ||
pcluster_config = PClusterConfig.from_yaml(pcluster_config_file) | ||
assert pcluster_config | ||
|
||
|
||
def test_load_instance_types_data(): | ||
pcluster_instance_types = PClusterInstanceTypes.from_json(instance_types_data_file) | ||
# debug(pcluster_instance_types) | ||
assert pcluster_instance_types | ||
|
||
|
||
def test_load_instance_types_mapping(): | ||
instance_types_mappings = InstanceTypesMappings.from_json( | ||
instance_type_mapping_file | ||
) | ||
assert instance_types_mappings |