Skip to content
Snippets Groups Projects
Commit 6b077fb4 authored by Jae-Joon Lee's avatar Jae-Joon Lee
Browse files

check for resources

parent 94de23d8
Branches
Tags
No related merge requests found
......@@ -22,7 +22,10 @@ if not os.path.exists(fn):
print("file downloaded")
ray.init("auto")
runtime_env = {"working_dir": ".", "excludes": ["data", "__pycache__"]}
print(runtime_env)
ray.init("auto", runtime_env=runtime_env)
# Load the data and put it on the shared memory
fn = "data/zodicube2_4x6_21Mar.npy"
......@@ -59,8 +62,14 @@ releases_info["releases"].append(dict(release_name="kasi20211021pre01",
release_date="2021-10-21",
api_prefix=api_prefix))
ray_actor_options = dict()
n_spherex_resources = len([node for node in ray.nodes() if "spherex" in node["Resources"]])
if n_spherex_resources:
ray_actor_options["resources"] = dict(spherex=1)
print(ray_actor_options)
@serve.deployment(route_prefix=api_prefix)
@serve.deployment(route_prefix=api_prefix, ray_actor_options=ray_actor_options)
class ReleaseHandler:
def __init__(self, qc_handle):
self.qc_handle = qc_handle
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment