@@ -34,8 +34,9 @@ def run_ab_transforms(
3434 image_tag_a : str ,
3535 image_tag_b : str ,
3636 input_files : list [str ],
37- download_files : bool ,
3837 docker_client : docker .client .DockerClient | None = None ,
38+ * ,
39+ use_local_s3 : bool = False ,
3940) -> tuple [list [str ], ...]:
4041 """Run Docker containers with versioned images of Transmogrifier.
4142
@@ -60,6 +61,10 @@ def run_ab_transforms(
6061 URIs for input files on S3 are accepted.
6162 docker_client (docker.client.DockerClient | None, optional): Docker client.
6263 Defaults to None.
64+ use_local_s3 (bool): Boolean indicating whether the container should
65+ access input files from a local MinIO server (i.e., "local S3 bucket")
66+ or from AWS S3. This flag determines the appropriate environment variables
67+ to set for the Docker containers. Default is False.
6368
6469 Returns:
6570 tuple[list[str], ...]: A tuple containing two lists, where each list contains
@@ -97,7 +102,7 @@ def run_ab_transforms(
97102
98103 # run containers and collect results
99104 futures = run_all_docker_containers (
100- docker_client , input_files , run_configs , download_files
105+ docker_client , input_files , run_configs , use_local_s3 = use_local_s3
101106 )
102107 containers , exceptions = collect_container_results (futures )
103108 logger .info (
@@ -132,7 +137,8 @@ def run_all_docker_containers(
132137 docker_client : docker .client .DockerClient ,
133138 input_files : list [str ],
134139 run_configs : list [tuple ],
135- download_files : bool ,
140+ * ,
141+ use_local_s3 : bool = False ,
136142) -> list [Future ]:
137143 """Invoke Docker containers to run in parallel via threads.
138144
@@ -155,9 +161,12 @@ def run_all_docker_containers(
155161 input_file ,
156162 get_transformed_filename (filename_details ),
157163 docker_client ,
158- download_files ,
159164 )
160- tasks .append (executor .submit (run_docker_container , * args ))
165+ tasks .append (
166+ executor .submit (
167+ run_docker_container , * args , use_local_s3 = use_local_s3
168+ )
169+ )
161170
162171 logger .info (f"All { len (tasks )} containers have exited." )
163172 return tasks
@@ -170,16 +179,16 @@ def run_docker_container(
170179 input_file : str ,
171180 output_file : str ,
172181 docker_client : docker .client .DockerClient ,
173- download_files : bool ,
174182 timeout : int = CONFIG .transmogrifier_timeout ,
183+ * ,
184+ use_local_s3 : bool = False ,
175185) -> tuple [Container , Exception | None ]:
176186 """Run Transmogrifier via Docker container to transform input file.
177187
178188 The container is run in a detached state to capture a container handle for later use
179189 but this function waits for the container to exit before returning.
180190 """
181-
182- if download_files :
191+ if use_local_s3 :
183192 environment_variables = {
184193 "AWS_ENDPOINT_URL" : CONFIG .minio_s3_container_url ,
185194 "AWS_ACCESS_KEY_ID" : CONFIG .minio_root_user ,
0 commit comments