Skip to content

Commit 6241cd0

Browse files
committed
Merge branch 'main' into run-clever
2 parents 537a673 + 4cbeb0e commit 6241cd0

File tree

18 files changed

+881
-648
lines changed

18 files changed

+881
-648
lines changed

.github/workflows/generate_requirements_for_clever_cloud.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
- name: Install dependencies
3434
run: poetry install
3535

36+
- name: Install the export plugin
37+
run: poetry self add poetry-plugin-export
3638

3739
- name: Export requirements.txt
3840
run: |

boaviztapi/data/archetypes/cloud/aws.csv

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,24 @@ g5.12xlarge,48,192,3800,0,4,g5.48xlarge,
238238
g5.16xlarge,64,256,1900,0,1,g5.48xlarge,
239239
g5.24xlarge,96,384,3800,0,4,g5.48xlarge,
240240
g5.48xlarge,192,768,7600,0,8,g5.48xlarge,
241+
g6.xlarge,4,16,250,0,1,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
242+
g6.2xlarge,8,32,450,0,1,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
243+
g6.4xlarge,16,64,600,0,1,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
244+
g6.8xlarge,32,128,900,0,1,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
245+
g6.16xlarge,64,256,1880,0,1,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
246+
g6.12xlarge,48,192,3760,0,4,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
247+
g6.24xlarge,96,384,3760,0,4,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
248+
g6.48xlarge,192,768,7520,0,8,g6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
249+
g6e.xlarge,4,32,250,0,1,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
250+
g6e.2xlarge,8,64,450,0,1,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
251+
g6e.4xlarge,16,128,600,0,1,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
252+
g6e.8xlarge,32,256,900,0,1,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
253+
g6e.16xlarge,64,192,1900,0,1,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
254+
g6e.12xlarge,48,384,3800,0,4,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
255+
g6e.24xlarge,96,768,3800,0,4,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
256+
g6e.48xlarge,192,1536,7600,0,8,g6e.48xlarge,https://aws.amazon.com/ec2/instance-types/g6e/
257+
gr6.4xlarge,16,64,600,0,1,gr6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
258+
gr6.8xlarge,32,128,900,0,1,gr6.48xlarge,https://aws.amazon.com/ec2/instance-types/g6/
241259
g5g.xlarge,4,8,0,0,1,g5g.metal,
242260
g5g.2xlarge,8,16,0,0,1,g5g.metal,
243261
g5g.4xlarge,16,32,0,0,1,g5g.metal,
@@ -1013,4 +1031,4 @@ i8g.8xlarge,32,256,7500,0,0,i8g.metal-24xl,
10131031
i8g.12xlarge,48,384,11250,0,0,i8g.metal-24xl,
10141032
i8g.16xlarge,64,512,15000,0,0,i8g.metal-24xl,
10151033
i8g.24xlarge,96,768,22500,0,0,i8g.metal-24xl,
1016-
i8g.metal-24xl,96,768,22500,0,0,i8g.metal-24xl,
1034+
i8g.metal-24xl,96,768,22500,0,0,i8g.metal-24xl,

boaviztapi/data/archetypes/cloud/gcp.csv

Lines changed: 267 additions & 267 deletions
Large diffs are not rendered by default.

boaviztapi/data/archetypes/cloud/providers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ provider.name,provider.description
22
aws,Amazon Web Services
33
azure,Microsoft Azure
44
scaleway,Scaleway
5-
gcp, Google Cloud Platform
5+
gcp,Google Cloud Platform

boaviztapi/data/archetypes/server.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ c7gn.16xlarge,AWS,rack,1,,,Annapurna Labs Graviton3E,,4,32,0,0,0,0,0,,0,2;2;2,2.
7676
c7i.48xlarge,AWS,rack,6,,,Intel Xeon Platinum 8488C,,12,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
7777
g5.48xlarge,AWS,rack,2,,,AMD EPYC 7R32,,24,32,2,3800,0,0,8,NVIDIA A10G,24,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
7878
g5g.metal,AWS,rack,1,,,Annapurna Labs Graviton2,,4,32,0,0,0,0,2,NVIDIA T4G Tensor Core,16,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
79+
g6.48xlarge,AWS,rack,2,,,AMD EPYC 7R13,,24,32,8,940,0,0,8,NVIDIA L4,24,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM and PSU configuration were not verified
80+
g6e.48xlarge,AWS,rack,2,,,AMD EPYC 7R13,,6,256,4,1900,0,0,8,NVIDIA L40S,48,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM and PSU configuration were not verified
81+
gr6.48xlarge,AWS,rack,2,,,AMD EPYC 7R32,,1,256,2,450,0,0,1,NVIDIA L4,24,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM and PSU configuration were not verified
7982
hpc7g.16xlarge,AWS,rack,1,,,Annapurna Labs Graviton3,,4,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
8083
i4g.16xlarge,AWS,rack,1,,,Annapurna Labs Graviton2,,16,32,4,3750,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
8184
i4i.metal,AWS,rack,2,,,Intel Xeon Platinum 8375C,,32,32,8,3750,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
@@ -101,6 +104,7 @@ r7a.metal-48xl,AWS,rack,2,,,AMD EPYC 9R14,,48,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;
101104
r7g.metal,AWS,rack,1,,,Annapurna Labs Graviton3,,16,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
102105
r7gd.16xlarge,AWS,rack,1,,,Annapurna Labs Graviton3,,16,32,2,1900,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
103106
r7iz.32xlarge,AWS,rack,2,,,Intel Xeon Gold 6455B,,32,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
107+
r7i.metal-48xl,AWS,rack,2,,,Intel Xeon Platinum 8488C,,6,256,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,
104108
trn1.32xlarge,AWS,rack,2,,,Intel Xeon Platinum 8375C,,16,32,4,1900,0,0,16,AWS Inferentia,32,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
105109
vt1.24xlarge,AWS,rack,2,,,Intel Xeon Platinum 8259CL,,6,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
106110
x2idn.metal,AWS,rack,2,,,Intel Xeon Platinum 8375C,,64,32,2,1900,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,52560,0.33;0.2;0.6,RAM configuration was not verified
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
requests==2.32.3
1+
requests==2.32.4

boaviztapi/main.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,10 @@
2424
from boaviztapi.routers.cloud_router import cloud_router
2525
from boaviztapi.routers.terminal_router import terminal_router
2626
from boaviztapi.routers.utils_router import utils_router
27+
from boaviztapi.utils.get_version import get_version_from_pyproject
2728

2829
from fastapi.responses import HTMLResponse
2930

30-
def get_version_from_pyproject():
31-
# List of potential locations for the pyproject.toml file
32-
potential_paths = [
33-
os.path.join(os.path.dirname(__file__), '../pyproject.toml'),
34-
os.path.join(os.path.dirname(__file__), 'pyproject.toml'),
35-
]
36-
37-
for path in potential_paths:
38-
if os.path.exists(path):
39-
with open(path, 'r') as f:
40-
return toml.loads(f.read())['tool']['poetry']['version']
41-
42-
# Raise an error if the file is not found in any of the locations
43-
raise FileNotFoundError("pyproject.toml not found in expected locations")
4431

4532
# Serverless frameworks adds a 'stage' prefix to the route used to serve applications
4633
# We have to manage it to expose openapi doc on aws and generate proper links.

boaviztapi/routers/utils_router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from boaviztapi.routers.openapi_doc.descriptions import country_code, cpu_family, cpu_model_range, ssd_manufacturer, \
1212
ram_manufacturer, case_type, name_to_cpu, cpu_names, impacts_criteria
1313
from boaviztapi.service.factor_provider import get_available_countries
14+
from boaviztapi.utils.get_version import get_version_from_pyproject
1415

1516
utils_router = APIRouter(
1617
prefix='/v1/utils',
@@ -26,8 +27,7 @@
2627

2728
@utils_router.get('/version', description="Get the version of the API")
2829
async def version():
29-
return toml.loads(open(os.path.join(os.path.dirname(__file__), '../../pyproject.toml'), 'r').read())['tool']['poetry'][
30-
'version']
30+
return get_version_from_pyproject()
3131

3232
@utils_router.get('/country_code', description=country_code)
3333
async def utils_get_all_countries():

boaviztapi/service/archetype.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ def get_cloud_instance_archetype(archetype_name: str, provider: str) -> Union[di
5050

5151

5252
def get_archetype(archetype_name: str, csv_path: str) -> Union[dict, bool]:
53-
reader = csv.DictReader(open(csv_path, encoding='utf-8'))
54-
for row in reader:
55-
if row["id"] == archetype_name:
56-
return row2json(row)
53+
with open(csv_path, encoding='utf-8') as csvfile:
54+
reader = csv.DictReader(csvfile)
55+
for row in reader:
56+
if row["id"].strip() == archetype_name.strip():
57+
return row2json(row)
5758
return False
5859

5960

boaviztapi/service/factor_provider.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import os
22
from pathlib import Path
33

4-
import pandas as pd
54
import yaml
65
from boaviztapi import data_dir
76

87
config_file = os.path.join(data_dir, 'factors.yml')
9-
impact_factors = yaml.safe_load(Path(config_file).read_text())
8+
impact_factors = yaml.load(Path(config_file).read_text(), Loader=yaml.CSafeLoader)
109

1110

1211
def get_impact_factor(item, impact_type) -> dict:

0 commit comments

Comments
 (0)