Skip to content
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
9 changes: 5 additions & 4 deletions src/codeflare_sdk/cluster/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from dataclasses import dataclass
from dataclasses import dataclass, field

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

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
# The value of `resources` is a string-integer mapping.
# Currently, `resources` must be provided in the specific format demonstrated below:
# resources: '"{\"Custom1\": 1, \"Custom2\": 5}"'
num-gpus: 0
num-gpus: '0'
#pod template
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion src/codeflare_sdk/utils/generate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def update_nodes(item, appwrapper_name, min_cpu, max_cpu, min_memory, max_memory
worker["replicas"] = workers
worker["minReplicas"] = workers
worker["maxReplicas"] = workers
worker["rayStartParams"]["num-gpus"] = int(gpu)
worker["rayStartParams"]["num-gpus"] = str(int(gpu))

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