@@ -157,7 +157,6 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
157157 {'key' : 'secret' , 'value' : secret , 'return_text' : True },
158158 {'key' : 'size' , 'value' : size , 'return_text' : True },
159159 {'key' : 'branch' , 'value' : branch , 'return_text' : True },
160- {'key' : 'container_id' , 'value' : None , 'return_text' : True },
161160 {'key' : 'spec_file' , 'value' : spec_file , 'return_text' : True }]
162161
163162 # Default spec file is Singularity
@@ -255,8 +254,7 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
255254 "repo_url" : params ['repo_url' ],
256255 "commit" : params ['commit' ],
257256 "repo_id" : params ['repo_id' ],
258- "secret" : params ['secret' ],
259- "container_id" : params ['container_id' ]}
257+ "secret" : params ['secret' ]}
260258
261259 # Did the user specify a specific log file?
262260 logfile = get_build_metadata (key = 'logfile' )
@@ -285,8 +283,8 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
285283 shutil .rmtree (build_dir )
286284
287285
288- def finish_build (logfile ,singularity_version = None ,repo_url = None ,bucket_name = None ,commit = None , verbose = True , repo_id = None ,
289- logging_response_url = None ,secret = None ,token = None ):
286+ def finish_build (logfile = None ,singularity_version = None ,repo_url = None ,bucket_name = None ,commit = None ,
287+ logging_url = None ,secret = None ,token = None , verbose = True , repo_id = None ):
290288 '''finish_build will finish the build by way of sending the log to the same bucket.
291289 :param build_dir: directory to do the build in. If not specified,
292290 will use temporary.
@@ -298,7 +296,7 @@ def finish_build(logfile,singularity_version=None,repo_url=None,bucket_name=None
298296 :param singularity_version: the version of singularity installed
299297 :param verbose: print out extra details as we go (default True)
300298 :param secret: a secret to match to the correct container
301- :param logging_response_url : the logging response url to send the response back to.
299+ :param logging_url : the logging response url to send the response back to.
302300 :: note: this function is currently configured to work with Google Compute
303301 Engine metadata api, and should (will) be customized if needed to work elsewhere
304302 '''
@@ -311,13 +309,14 @@ def finish_build(logfile,singularity_version=None,repo_url=None,bucket_name=None
311309 singularity_version = get_singularity_version (singularity_version )
312310
313311 # Get variables from the instance metadata API
314- metadata = [{'key' : 'logging_url' , 'value' : logging_response_url , 'return_text' : True },
312+ metadata = [{'key' : 'logging_url' , 'value' : logging_url , 'return_text' : True },
315313 {'key' : 'repo_url' , 'value' : repo_url , 'return_text' : False },
316314 {'key' : 'repo_id' , 'value' : repo_id , 'return_text' : True },
317315 {'key' : 'token' , 'value' : token , 'return_text' : False },
318316 {'key' : 'commit' , 'value' : commit , 'return_text' : True },
319317 {'key' : 'bucket_name' , 'value' : bucket_name , 'return_text' : True },
320- {'key' : 'secret' , 'value' : secret , 'return_text' : True }]
318+ {'key' : 'secret' , 'value' : secret , 'return_text' : True },
319+ {'key' : 'logfile' , 'value' : logfile , 'return_text' : True }]
321320
322321 if bucket_name == None :
323322 bucket_name = "singularity-hub"
@@ -334,16 +333,16 @@ def finish_build(logfile,singularity_version=None,repo_url=None,bucket_name=None
334333 log_file = upload_file (storage_service ,
335334 bucket = bucket ,
336335 bucket_path = image_path ,
337- file_name = logfile )
336+ file_name = params [ ' logfile' ] )
338337
339338 # Finally, package everything to send back to shub
340339 response = {"log" : json .dumps (log_file ),
341340 "repo_url" : params ['repo_url' ],
342341 "commit" : params ['commit' ],
342+ "logfile" : params ['logfile' ],
343343 "repo_id" : params ['repo_id' ],
344344 "secret" : params ['secret' ]}
345345
346-
347346 if params ['token' ] != None :
348347 response ['token' ] = params ['token' ]
349348
@@ -394,7 +393,7 @@ def get_build_params(metadata):
394393 bot .logger .warning ('%s not found in function call.' ,item ['key' ])
395394 response = get_build_metadata (key = item ['key' ])
396395 item ['value' ] = response
397- params [item ['key' ]] = item ['value' ]
396+ params [item ['key' ]] = item ['value' ]
398397 if item ['key' ] != 'credential' :
399398 bot .logger .info ('%s is set to %s' ,item ['key' ],item ['value' ])
400399 return params
0 commit comments