-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_ray.py
More file actions
45 lines (40 loc) · 1.44 KB
/
submit_ray.py
File metadata and controls
45 lines (40 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
from ray.job_submission import JobSubmissionClient
from local_setting import mosek_license
# If using a remote cluster, replace 127.0.0.1 with the head node's IP address or set up port forwarding.
client = JobSubmissionClient("http://localhost:8265")
# Stop all running jobs
for job in client.list_jobs():
if job.status == "RUNNING":
client.stop_job(job.submission_id)
# Submit a job
for file_name in ("experiment_log_tracking_arg.py",):
job_id = client.submit_job(
# Entrypoint shell command to execute
entrypoint=" ".join([
"python3", file_name,
"--experiment_season", "summer",
"--experiment_climate", "5b",
"--log_days", "14",
"--w", "4",
"--icnn_random", "0",
"--rl_lambda", "50",
"--icnn_size", "60",
"--dir_prefix", "/home/ray",
"--coef_ls", "0",
"--savedir_suffix", "_test",
"--verbose", "0",
"--multiprocessing"
# "--lse"
]),
# Path to the local directory that contains the script.py file
runtime_env={
"working_dir": "./",
"excludes": ["EnergyPlus*", ".git*", "log_data*"],
"pip": "requirements.txt",
"env_vars": {
"PIP_EXTRA_INDEX_URL": os.environ.get("PIP_EXTRA_INDEX_URL", ''),
"MOSEKLM_LICENSE_FILE": mosek_license,
}
}
)