mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 18:29:08 +08:00
Make it possible to run ray examples as projects (#5816)
This commit is contained in:
@@ -96,6 +96,15 @@ class ProjectDefinition:
|
||||
if wildcards and "choices" in param:
|
||||
choices[name] = copy.deepcopy(param["choices"])
|
||||
param["choices"] = param["choices"] + ["*"]
|
||||
if "type" in param:
|
||||
types = {"int": int, "str": str, "float": float}
|
||||
if param["type"] in types:
|
||||
param["type"] = types[param["type"]]
|
||||
else:
|
||||
raise ValueError(
|
||||
"Parameter {} has type {} which is not supported. "
|
||||
"Type must be one of {}".format(
|
||||
name, param["type"], list(types.keys())))
|
||||
parser.add_argument("--" + name, **param)
|
||||
|
||||
parsed_args = parser.parse_args(list(args)).__dict__
|
||||
|
||||
@@ -13,6 +13,17 @@
|
||||
"description": "The URL of the repo this project is part of",
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"description": "Relevant tags for this project",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"documentation": {
|
||||
"description": "Link to the documentation of this project",
|
||||
"type": "string"
|
||||
},
|
||||
"cluster": {
|
||||
"description": "Path to a .yaml cluster configuration file (relative to the project root)",
|
||||
"type": "string"
|
||||
|
||||
@@ -238,7 +238,7 @@ class SessionRunner(object):
|
||||
stop=False,
|
||||
start=False,
|
||||
override_cluster_name=self.session_name,
|
||||
port_forward=None,
|
||||
port_forward=config.get("port_forward", None),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user