4
4
# pylint: disable=too-many-arguments,too-many-locals
5
5
6
6
from typing import Optional
7
+
7
8
from .queries import gpus
8
9
from .queries import pods as pod_queries
9
10
from .graphql import run_graphql_query
@@ -14,19 +15,19 @@ def get_gpus() -> dict:
14
15
'''
15
16
Get all GPU types
16
17
'''
17
- raw_return = run_graphql_query (gpus .QUERY_GPU_TYPES )
18
- cleaned_return = raw_return ["data" ]["gpuTypes" ]
18
+ raw_response = run_graphql_query (gpus .QUERY_GPU_TYPES )
19
+ cleaned_return = raw_response ["data" ]["gpuTypes" ]
19
20
return cleaned_return
20
21
21
22
22
23
def get_gpu (gpu_id : str ):
23
24
'''
24
25
Get a specific GPU type
25
-
26
+
26
27
:param gpu_id: the id of the gpu
27
28
'''
28
- raw_return = run_graphql_query (gpus .generate_gpu_query (gpu_id ))
29
- cleaned_return = raw_return ["data" ]["gpuTypes" ][0 ]
29
+ raw_response = run_graphql_query (gpus .generate_gpu_query (gpu_id ))
30
+ cleaned_return = raw_response ["data" ]["gpuTypes" ][0 ]
30
31
return cleaned_return
31
32
32
33
def get_pods () -> dict :
@@ -56,7 +57,7 @@ def create_pod(name : str, image_name : str, gpu_type_id : str, cloud_type : str
56
57
:param volume_in_gb: how big should the pod volume be
57
58
:param ports: the ports to open in the pod, example format - "8888/http,666/tcp"
58
59
:param volume_mount_path: where to mount the volume?
59
- :param env: the environment variables to inject into the pod,
60
+ :param env: the environment variables to inject into the pod,
60
61
for example {EXAMPLE_VAR:"example_value", EXAMPLE_VAR2:"example_value 2"}, will
61
62
inject EXAMPLE_VAR and EXAMPLE_VAR2 into the pod with the mentioned values
62
63
0 commit comments