Skip to content

Commit 0f47b6d

Browse files
update appwapper generator (#13)
1 parent fb5f440 commit 0f47b6d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/codeflare_sdk/cluster/config.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from dataclasses import dataclass
1+
from dataclasses import dataclass, field
22

33
@dataclass
44
class ClusterConfiguration:
55
name: str
6-
head_info: list = []
7-
machine_types: list = [] #["m4.xlarge", "g4dn.xlarge"]
6+
head_info: list = field(default_factory=list)
7+
machine_types: list = field(default_factory=list) #["m4.xlarge", "g4dn.xlarge"]
88
min_cpus: int = 1
99
max_cpus: int = 1
1010
min_worker: int = 1
@@ -14,5 +14,6 @@ class ClusterConfiguration:
1414
gpu: int = 0
1515
template: str = "src/codeflare_sdk/templates/new-template.yaml"
1616
instascale: bool = False
17-
envs: dict = {}
17+
envs: dict = field(default_factory=dict)
1818
image: str = "ghcr.io/ibm-ai-foundation/base:ray1.13.0-py38-gpu-pytorch1.12.0cu116-20220826-202124"
19+

src/codeflare_sdk/templates/new-template.yml src/codeflare_sdk/templates/new-template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ spec:
9898
# The value of `resources` is a string-integer mapping.
9999
# Currently, `resources` must be provided in the specific format demonstrated below:
100100
# resources: '"{\"Custom1\": 1, \"Custom2\": 5}"'
101-
num-gpus: 0
101+
num-gpus: '0'
102102
#pod template
103103
template:
104104
spec:

src/codeflare_sdk/utils/generate_yaml.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def update_nodes(item, appwrapper_name, min_cpu, max_cpu, min_memory, max_memory
108108
worker["replicas"] = workers
109109
worker["minReplicas"] = workers
110110
worker["maxReplicas"] = workers
111-
worker["rayStartParams"]["num-gpus"] = int(gpu)
111+
worker["rayStartParams"]["num-gpus"] = str(int(gpu))
112112

113113
for comp in [head, worker]:
114114
spec = comp.get("template").get("spec")

0 commit comments

Comments
 (0)