@@ -112,7 +112,11 @@ def __init__(
112
112
self .container = None
113
113
114
114
def process (
115
- self , processing_inputs , processing_output_config , environment , processing_job_name
115
+ self ,
116
+ processing_inputs ,
117
+ processing_output_config ,
118
+ environment ,
119
+ processing_job_name ,
116
120
):
117
121
"""Run a processing job locally using docker-compose.
118
122
@@ -139,7 +143,11 @@ def process(
139
143
for host in self .hosts :
140
144
_create_processing_config_file_directories (self .container_root , host )
141
145
self .write_processing_config_files (
142
- host , environment , processing_inputs , processing_output_config , processing_job_name
146
+ host ,
147
+ environment ,
148
+ processing_inputs ,
149
+ processing_output_config ,
150
+ processing_job_name ,
143
151
)
144
152
145
153
self ._generate_compose_file (
@@ -381,7 +389,12 @@ def retrieve_artifacts(self, compose_data, output_data_config, job_name):
381
389
return os .path .join (output_data , "model.tar.gz" )
382
390
383
391
def write_processing_config_files (
384
- self , host , environment , processing_inputs , processing_output_config , processing_job_name
392
+ self ,
393
+ host ,
394
+ environment ,
395
+ processing_inputs ,
396
+ processing_output_config ,
397
+ processing_job_name ,
385
398
):
386
399
"""Write the config files for the processing containers.
387
400
@@ -1080,8 +1093,14 @@ def _ecr_login_if_needed(boto_session, image):
1080
1093
token = raw_token .decode ("utf-8" ).strip ("AWS:" )
1081
1094
ecr_url = auth ["authorizationData" ][0 ]["proxyEndpoint" ]
1082
1095
1083
- cmd = "docker login -u AWS -p %s %s" % (token , ecr_url )
1084
- subprocess .check_output (cmd .split ())
1096
+ # Log in to ecr, but use communicate to not print creds to the console
1097
+ cmd = f"docker login { ecr_url } -u AWS --password-stdin" .split ()
1098
+ proc = subprocess .Popen (
1099
+ cmd ,
1100
+ stdin = subprocess .PIPE ,
1101
+ )
1102
+
1103
+ proc .communicate (input = token .encode ())
1085
1104
1086
1105
return True
1087
1106
0 commit comments