Make it possible to run ray examples as projects (#5816)

This commit is contained in:
Philipp Moritz
2019-10-03 14:52:37 -07:00
committed by GitHub
parent 972dddd776
commit 0dee225ce1
23 changed files with 392 additions and 5 deletions
+9
View File
@@ -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__
+11
View File
@@ -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"
+1 -1
View File
@@ -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),
)