def runTest(self): while(True): job_status = get_job_status(self.job.job_id) if(job_status.status.lower() == 'finished'): break elif(job_status.status.lower() == 'error'): raise BitcodinError('An error occured while waiting for job to be FINISHED', 'Job status changed to ERROR!') sleep(2) transfer = transfer_job(self.job.job_id, self.output.output_id)
def runTest(self): start_time = time() time_limit = 1200 while True: job_status = get_job_status(self.job.job_id) if(job_status.status.lower() == 'finished'): break elif(job_status.status.lower() == 'error'): raise BitcodinError('An error occured while waiting for job to be FINISHED', 'Job status changed to ERROR!') elif(time() - start_time > time_limit): raise BitcodinError('Timeout of job duration exceeded!', 'Job took too long!') sleep(2) transfer = transfer_job(self.job.job_id, self.output.output_id)
def runTest(self): start_time = time() time_limit = 1200 while(True): job_status = get_job_status(self.job.job_id) if(job_status.status.lower() == 'finished'): break elif(job_status.status.lower() == 'error'): raise BitcodinError('An error occured while waiting for job to be FINISHED', 'Job status changed to ERROR!') elif(time() - start_time > time_limit): raise BitcodinError('Timeout of job duration exceeded!', 'Job took too long!') sleep(2) transfer = transfer_job(self.job.job_id, self.output.output_id)
def runTest(self): start_time = time() time_limit = 1200 while True: job_status = get_job_status(self.job.job_id) if job_status.status.lower() == 'finished': break elif job_status.status.lower() == 'error': raise BitcodinError('An error occured while waiting for job to be FINISHED', 'Job status changed to ERROR!') elif time() - start_time > time_limit: raise BitcodinError('Timeout of job duration exceeded!', 'Job took too long!') sleep(2) with self.assertRaises(BitcodinNotFoundError): transfer = transfer_job(self.job.job_id, 0)
def runTest(self): start_time = time() time_limit = 1200 while True: job_status = get_job_status(self.job.job_id) if job_status.status.lower() == 'finished': break elif job_status.status.lower() == 'error': raise BitcodinError( 'An error occured while waiting for job to be FINISHED', 'Job status changed to ERROR!') elif time() - start_time > time_limit: raise BitcodinError('Timeout of job duration exceeded!', 'Job took too long!') sleep(2) with self.assertRaises(BitcodinNotFoundError): transfer = transfer_job(self.job.job_id, 0)
def runTest(self): with self.assertRaises(BitcodinNotFoundError): transfer = transfer_job(self.job.job_id, 0)
job_result = bitcodin.create_job(job) while job_result.status != 'Finished' and job_result.status != 'Error': job_result = bitcodin.get_job(job_result.job_id) print(job_result.to_json()) sleep(5) print(job_result.to_json()) print("Job Finished!") output_obj = bitcodin.S3Output( name='MY S3 Output Profile', host='YOUR AWS HOST', access_key='YOUR AWS ACCESS KEY', secret_key='YOUR AWS SECRET KEY', bucket='YOUR AWS BUCKET NAME', prefix='PATH/TO/MY/DESIRED/OUTPUT/DESTINATION/', region='YOUR AWS REGION', make_public=False ) output_result = bitcodin.create_output(output_obj) print("Transferring job...") transfer_job = bitcodin.transfer_job(job_result.job_id, output_result.output_id) print("Transfer Job created: %s" % transfer_job) print("Show transfer jobs...") transfer_jobs = bitcodin.list_transfer_jobs(job_result.job_id) for transfer in transfer_jobs: print("Transfer Job: %s" % transfer.to_json())