@@ -49,11 +49,10 @@ def print_ray_versions_and_modes():
49
49
4. custom: Define your own preference
50
50
''' )
51
51
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' ):
55
54
# 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"
57
56
# check if the file already exist
58
57
if (not os .path .exists (file_path )) or overwrite :
59
58
fd = open (file_path , "w+" )
@@ -199,19 +198,19 @@ def total_config(ray_version):
199
198
def fetch_configs_from_git (ray_versions , res_modes , overwrite ):
200
199
# get configs from file or git for each ray_version
201
200
for ray_version in ray_versions :
202
- out_dir = "configs"
201
+ out_dir = "configs/" + ray_version
203
202
# create dir if not present
204
203
if not os .path .exists (out_dir ):
205
204
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 )
207
206
# wget it from git if file not present
208
207
if not os .path .exists (out_filename ):
209
208
url = 'https://raw.githubusercontent.com/ray-project/ray/ray-%s/src/ray/common/ray_config_def.h' % ray_version
210
209
wget .download (url , out = out_filename )
211
210
parse_config_file (out_filename , ray_version )
212
211
total_config (ray_version )
213
212
for res_mode in res_modes :
214
- dump_conf (ray_version , res_mode , overwrite )
213
+ dump_conf (ray_version , res_mode , overwrite , out_dir )
215
214
print_colored (OK , "All conf files saved!\n DONE!" )
216
215
217
216
# generate config json string for system-cm yaml
0 commit comments