11import json
2- import sys
2+ import os
33
44from util .constants import (
55 DOCKER_COMPOSE ,
1010from util .docker_helper import get_credential_ip , get_host_ip
1111
1212
13- def process_docker_compose_template (refinery_dir : str , is_windows : bool ) -> str :
13+ def process_docker_compose_template (
14+ refinery_dir : str , minio_endpoint : str = None
15+ ) -> str :
1416 credential_ip = get_credential_ip ()
15- host_ip = get_host_ip ()
16-
1717 cred_endpoint = f"http://{ credential_ip } :7053"
18- minio_endpoint = f"http://{ host_ip } :7053"
18+
19+ if minio_endpoint is None :
20+ host_ip = get_host_ip ()
21+ minio_endpoint = f"http://{ host_ip } :7053"
1922
2023 with open (DOCKER_COMPOSE_TEMPLATE , "r" ) as f :
2124 template = f .read ()
@@ -25,18 +28,8 @@ def process_docker_compose_template(refinery_dir: str, is_windows: bool) -> str:
2528
2629 with open (SETTINGS , "r" ) as f :
2730 settings = json .load (f )
28- path_sep = "\\ " if is_windows else "/"
29- for volume , path in settings .items ():
30- if path .startswith (".." ):
31- print ("Path in settings.json must not start with '..'!" , flush = True )
32- sys .exit (1 )
33- if path [0 ] == "." : # relative path
34- path = path [1 :]
35- if path [0 ] != path_sep :
36- path = path_sep + path [1 :]
37- settings [volume ] = refinery_dir + path
38- else :
39- settings [volume ] = path
31+ for volume , rel_path in settings .items ():
32+ settings [volume ] = os .path .normpath (os .path .join (refinery_dir , rel_path ))
4033
4134 docker_compose = template .format (
4235 ** versions ,
0 commit comments