Skip to content

Commit

Permalink
change 'priority' to 'dispatch priority'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClifford committed Jun 21, 2023
1 parent 7e7a311 commit b1d1d16
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create_app_wrapper(self):
instascale = self.config.instascale
instance_types = self.config.machine_types
env = self.config.envs
priority = self.config.priority
dispatch_priority = self.config.dispatch_priority
return generate_appwrapper(
name=name,
namespace=namespace,
Expand All @@ -99,7 +99,7 @@ def create_app_wrapper(self):
instascale=instascale,
instance_types=instance_types,
env=env,
priority=priority,
dispatch_priority=dispatch_priority,
)

# creates a new cluster with the provided or default spec
Expand Down
2 changes: 1 addition & 1 deletion src/codeflare_sdk/cluster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ class ClusterConfiguration:
instascale: bool = False
envs: dict = field(default_factory=dict)
image: str = "ghcr.io/foundation-model-stack/base:ray2.1.0-py38-gpu-pytorch1.12.0cu116-20221213-193103"
priority: str = "low"
dispatch_priority: str = "default"
14 changes: 7 additions & 7 deletions src/codeflare_sdk/utils/generate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def generate_appwrapper(
instascale: bool,
instance_types: list,
env,
priority: str,
dispatch_priority: str,
):
user_yaml = read_template(template)
appwrapper_name, cluster_name = gen_names(name)
Expand All @@ -246,7 +246,7 @@ def generate_appwrapper(
route_item = resources["resources"].get("GenericItems")[1]
update_names(user_yaml, item, appwrapper_name, cluster_name, namespace)
update_labels(user_yaml, instascale, instance_types)
update_priority(user_yaml, item, priority)
update_priority(user_yaml, item, dispatch_priority)
update_scheduling_spec(user_yaml, workers)
update_custompodresources(
item, min_cpu, max_cpu, min_memory, max_memory, gpu, workers
Expand Down Expand Up @@ -345,10 +345,10 @@ def main(): # pragma: no cover
help="Set the kubernetes namespace you want to deploy your cluster to. Default. If left blank, uses the 'default' namespace",
)
parser.add_argument(
"--priority",
"--dispatch-priority",
required=False,
default="low",
help="Set the priority of the cluster. Default is 'low'. Options are 'low', 'default', 'high'",
default="default",
help="Set the dispatch priority of the framework cluster. Options are 'low', 'default', and 'high'",
)

args = parser.parse_args()
Expand All @@ -364,7 +364,7 @@ def main(): # pragma: no cover
instascale = args.instascale
instance_types = args.instance_types
namespace = args.namespace
priority = args.priority
dispatch_priority = args.dispatch_priority
env = {}

outfile = generate_appwrapper(
Expand All @@ -381,7 +381,7 @@ def main(): # pragma: no cover
instascale,
instance_types,
env,
priority,
dispatch_priority,
)
return outfile

Expand Down
4 changes: 2 additions & 2 deletions tests/test-case-cmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: unit-cmd-cluster
namespace: default
spec:
priority: 1
priority: 5
resources:
GenericItems:
- custompodresources:
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
do echo waiting for myservice; sleep 2; done
image: busybox:1.28
name: init-myservice
priorityClassName: low-priority
priorityClassName: default-priority
replicas: 1
- generictemplate:
apiVersion: route.openshift.io/v1
Expand Down
4 changes: 2 additions & 2 deletions tests/test-case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: unit-test-cluster
namespace: ns
spec:
priority: 1
priority: 5
resources:
GenericItems:
- custompodresources:
Expand Down Expand Up @@ -156,7 +156,7 @@ spec:
do echo waiting for myservice; sleep 2; done
image: busybox:1.28
name: init-myservice
priorityClassName: low-priority
priorityClassName: default-priority
replicas: 1
- generictemplate:
apiVersion: route.openshift.io/v1
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_config_creation():
gpu=7,
instascale=True,
machine_types=["cpu.small", "gpu.large"],
priority="low",
dispatch_priority="default",
)

assert config.name == "unit-test-cluster" and config.namespace == "ns"
Expand All @@ -228,7 +228,7 @@ def test_config_creation():
assert config.template == f"{parent}/src/codeflare_sdk/templates/base-template.yaml"
assert config.instascale
assert config.machine_types == ["cpu.small", "gpu.large"]
assert config.priority == "low"
assert config.dispatch_priority == "default"
return config


Expand Down

0 comments on commit b1d1d16

Please sign in to comment.