Skip to content

Commit e675067

Browse files
committed
save config files in configs/RAY_VERSION dir
1 parent 53e7f9a commit e675067

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

utils/ray-res-config.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ def print_ray_versions_and_modes():
4949
4. custom: Define your own preference
5050
''')
5151

52-
# Generates .conf files in configs folder in the working directory
53-
# TODO: generate ray-version dir under configs directory for better file oganization
54-
def dump_conf(ray_version, res_mode, overwrite, dirname='configs/'):
52+
# Generates .conf files in configs/RAY_VERSION folder in the working directory
53+
def dump_conf(ray_version, res_mode, overwrite, dirname='configs'):
5554
# dump the default configs in a file to let others edit further
56-
file_path = dirname+"ray-"+ray_version+"-"+res_mode+".conf"
55+
file_path = dirname+"/ray-"+ray_version+"-"+res_mode+".conf"
5756
# check if the file already exist
5857
if (not os.path.exists(file_path)) or overwrite:
5958
fd = open(file_path, "w+")
@@ -199,19 +198,19 @@ def total_config(ray_version):
199198
def fetch_configs_from_git(ray_versions, res_modes, overwrite):
200199
# get configs from file or git for each ray_version
201200
for ray_version in ray_versions:
202-
out_dir = "configs"
201+
out_dir = "configs/"+ray_version
203202
# create dir if not present
204203
if not os.path.exists(out_dir):
205204
os.makedirs(out_dir)
206-
out_filename = "%s/ray-%s-config-def.h" % (out_dir,ray_version)
205+
out_filename = "%s/ray-%s-config-def.h" % (out_dir, ray_version)
207206
# wget it from git if file not present
208207
if not os.path.exists(out_filename):
209208
url = 'https://raw.githubusercontent.com/ray-project/ray/ray-%s/src/ray/common/ray_config_def.h' % ray_version
210209
wget.download(url, out=out_filename)
211210
parse_config_file(out_filename, ray_version)
212211
total_config(ray_version)
213212
for res_mode in res_modes:
214-
dump_conf(ray_version, res_mode, overwrite)
213+
dump_conf(ray_version, res_mode, overwrite, out_dir)
215214
print_colored(OK, "All conf files saved!\nDONE!")
216215

217216
# generate config json string for system-cm yaml

0 commit comments

Comments
 (0)