def test_large_command(self): backend = ServiceBackend( remote_tmpdir=f'gs://{HAIL_TEST_GCS_BUCKET}/temporary-files') b = Batch(backend=backend) j1 = b.new_job() long_str = secrets.token_urlsafe(15 * 1024) j1.command(f'echo "{long_str}"') b.run()
def test_service_backend_bucket_parameter(self): backend = ServiceBackend(bucket=HAIL_TEST_GCS_BUCKET) b = Batch(backend=backend) j1 = b.new_job() j1.command(f'echo hello > {j1.ofile}') j2 = b.new_job() j2.command(f'cat {j1.ofile}') b.run()
def test_service_backend_remote_tempdir_with_no_trailing_slash(self): backend = ServiceBackend( remote_tmpdir=f'gs://{HAIL_TEST_GCS_BUCKET}/temporary-files/') b = Batch(backend=backend) j1 = b.new_job() j1.command(f'echo hello > {j1.ofile}') j2 = b.new_job() j2.command(f'cat {j1.ofile}') b.run()
def test_big_batch_which_uses_slow_path(self): backend = ServiceBackend( remote_tmpdir=f'{self.remote_tmpdir}/temporary-files') b = Batch(backend=backend) # 8 * 256 * 1024 = 2 MiB > 1 MiB max bunch size for i in range(8): j1 = b.new_job() long_str = secrets.token_urlsafe(256 * 1024) j1.command(f'echo "{long_str}"') batch = b.run() assert not batch.submission_info.used_fast_create batch_status = batch.status() assert batch_status['state'] == 'success', str((batch.debug_info()))
def test_backend_context_manager(self): with LocalBackend() as backend: b = Batch(backend=backend) b.run()