Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test for Azure cloud instances #300

Merged
merged 1 commit into from
Sep 20, 2024
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,5 @@ dmypy.json
# Serverless
.serverless
node_modules

boaviztAPI
39 changes: 39 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
aiofile = "==3.8.7"
anyio = "==3.7.0"
caio = "==0.9.12"
click = "==8.1.3"
colorama = "==0.4.6"
exceptiongroup = "==1.1.1"
fastapi = "==0.95.2"
h11 = "==0.14.0"
idna = "==3.4"
importlib-metadata = "==6.6.0"
mangum = "==0.17.0"
markdown = "==3.4.3"
numpy = "==1.24.3"
pandas = "==2.0.2"
pydantic = "==1.10.9"
python-dateutil = "==2.8.2"
pytz = "==2023.3"
pyyaml = "==6.0"
rapidfuzz = "==3.1.1"
scipy = "==1.9.3"
six = "==1.16.0"
sniffio = "==1.3.0"
starlette = "==0.27.0"
toml = "==0.10.2"
typing-extensions = "==4.6.3"
tzdata = "==2023.3"
uvicorn = "==0.22.0"
zipp = "==3.15.0"

[dev-packages]

[requires]
python_version = "3.12"
52 changes: 52 additions & 0 deletions tests/api/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,3 +915,55 @@ async def test_verbose_output_with_empty_usage():
)

await test.check_result()


@pytest.mark.asyncio
async def test_empty_usage_e8ads_v5():
test = CloudTest(
CloudInstanceRequest("azure", "e8ads_v5"),
ADPImpact(
ImpactOutput(0.02211, 0.0127, 0.0163, END_OF_LIFE_WARNING),
ImpactOutput(0.0006984, 2.603e-05, 0.00014),
),
GWPImpact(
ImpactOutput(291.7, 108.2, 170.0, END_OF_LIFE_WARNING),
ImpactOutput(2367.0, 45.36, 800.0),
),
PEImpact(
ImpactOutput(3713.0, 1400.0, 2200.0, END_OF_LIFE_WARNING),
ImpactOutput(1231000.0, 25.64, 30000.0, UNCERTAINTY_WARNING),
),
)

await test.check_result()


@pytest.mark.asyncio
async def test_usage_with_complex_time_workload_e8ads_v5():
test = CloudTest(
CloudInstanceRequest(
"azure",
"e8ads_v5",
usage={
"time_workload": [
{"time_percentage": 50, "load_percentage": 0},
{"time_percentage": 25, "load_percentage": 60},
{"time_percentage": 25, "load_percentage": 100},
]
},
),
ADPImpact(
ImpactOutput(0.02211, 0.0127, 0.0163, END_OF_LIFE_WARNING),
ImpactOutput(0.0006088, 2.269e-05, 0.00012),
),
GWPImpact(
ImpactOutput(291.7, 108.2, 170.0, END_OF_LIFE_WARNING),
ImpactOutput(2063.0, 39.54, 700.0),
),
PEImpact(
ImpactOutput(3713.0, 1400.0, 2200.0, END_OF_LIFE_WARNING),
ImpactOutput(1073000.0, 22.35, 20000.0, UNCERTAINTY_WARNING),
),
)

await test.check_result()
817 changes: 817 additions & 0 deletions tests/data/archetypes/cloud/azure.csv

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/data/archetypes/cloud/providers.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
provider.name,provider.description
aws,Amazon Web Services
aws,Amazon Web Services
azure,Azure
279 changes: 140 additions & 139 deletions tests/data/archetypes/server.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/data/crowdsourcing/cpu_specs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ AMD EPYC 7702P,AMD,Rome,EPYC,2000 MHz,200.0,64.0,,74.0,io_die_size () + die_size
AMD EPYC 7713,AMD,Milan,EPYC,2000 MHz,225.0,64.0,,1064.0,io_die_size (416 mm²) + die_size (8x 81 mm²),https://www.techpowerup.com/cpu-specs/epyc-7713.c2374
AMD EPYC 7713P,AMD,Milan,EPYC,2000 MHz,225.0,64.0,,1064.0,io_die_size (416 mm²) + die_size (8x 81 mm²),https://www.techpowerup.com/cpu-specs/epyc-7713p.c2375
AMD EPYC 7742,AMD,Rome,EPYC,2.25 GHz,225.0,64.0,,74.0,io_die_size () + die_size (74 mm²),https://www.techpowerup.com/cpu-specs/epyc-7742.c2245
AMD EPYC 7763,AMD,Milan,EPYC,2.45 GHz,280.0,64.0,,1064.0,io_die_size (416 mm²) + die_size (8x 81 mm²),https://www.techpowerup.com/cpu-specs/epyc-7763.c2373
AMD EPYC 7763,AMD,Milan,EPYC,2.45 GHz,280.0,64.0,128.0,1064.0,io_die_size (416 mm²) + die_size (8x 81 mm²),https://www.techpowerup.com/cpu-specs/epyc-7763.c2373
AMD EPYC 7773X,AMD,Milan-X,EPYC,2.2 GHz,280.0,64.0,,1064.0,io_die_size (416 mm²) + die_size (8x 81 mm²),https://www.techpowerup.com/cpu-specs/epyc-7773x.c2759
AMD EPYC 7F32,AMD,Rome,EPYC,3.7 GHz,180.0,8.0,,74.0,io_die_size () + die_size (74 mm²),https://www.techpowerup.com/cpu-specs/epyc-7f32.c2300
AMD EPYC 7F52,AMD,Rome,EPYC,3.5 GHz,155.0,16.0,,74.0,io_die_size () + die_size (74 mm²),https://www.techpowerup.com/cpu-specs/epyc-7f52.c2301
Expand Down
48 changes: 22 additions & 26 deletions tests/unit/test_archetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,25 @@ async def test_get_server_archetype_none():
@pytest.mark.asyncio
async def test_get_server_archetype_dellr740():
assert get_archetype("dellR740", csv_path=os.path.join(data_dir, "archetypes/server.csv")) == {
'CASE': {'case_type': {'default': 'rack'}},
'CPU': {'core_units': {'default': 24.0},
'die_size_per_core': {'default': 24.5},
'family': {},
'manufacturer': {},
'model_range': {},
'name': {},
'tdp': {},
'threads':{},
'units': {'default': 2.0}},
'HDD': {'capacity': {}, 'units': {}},
'POWER_SUPPLY': {'unit_weight': {'default': 2.99, 'max': 5.0, 'min': 1.0},
'units': {'default': 2.0, 'max': 2.0, 'min': 1.0}},
'RAM': {'capacity': {'default': 32.0},
'density': {'default': 1.79},
'units': {'default': 12.0}},
'GPU': {'memory_capacity': {}, 'name': {}, 'units': {}},
'SSD': {'capacity': {'default': 400.0},
'density': {'default': 50.6},
'units': {'default': 1.0}},
'USAGE': {'hours_life_time': {'default': 26280.0},
'other_consumption_ratio': {'default': 0.33},
'time_workload': {'default': 50.0, 'max': 100.0, 'min': 0.0},
'use_time_ratio': {'default': 1.0}},
'WARNINGS': {},
'manufacturer': {'default': 'Dell'}}
'CASE': {'case_type': {'default': 'rack'}},
'CPU': {'core_units': {'default': 24.0},
'die_size_per_core': {'default': 24.5},
'name': {},
'units': {'default': 2.0},
'vcpu': {}},
'GPU': {'memory_capacity': {}, 'name': {}, 'units': {}},
'HDD': {'capacity': {}, 'units': {}},
'POWER_SUPPLY': {'unit_weight': {'default': 2.99, 'max': 5.0, 'min': 1.0},
'units': {'default': 2.0, 'max': 2.0, 'min': 1.0}},
'RAM': {'capacity': {'default': 32.0},
'density': {'default': 1.79},
'units': {'default': 12.0}},
'SSD': {'capacity': {'default': 400.0},
'density': {'default': 50.6},
'units': {'default': 1.0}},
'USAGE': {'hours_life_time': {'default': 26280.0},
'other_consumption_ratio': {'default': 0.33},
'time_workload': {'default': 50.0, 'max': 100.0, 'min': 0.0},
'use_time_ratio': {'default': 1.0}},
'WARNINGS': {},
'manufacturer': {'default': 'Dell'}}
Loading