LocalBackend

class hailtop.batch.backend.LocalBackend(tmp_dir='/tmp/', gsa_key_file=None, extra_docker_run_flags=None)

Bases: Backend[None]

Backend that executes batches on a local computer. .. rubric:: Examples

>>> local_backend = LocalBackend(tmp_dir='/tmp/user/')
>>> b = Batch(backend=local_backend)
Parameters:
  • tmp_dir (str) – Temporary directory to use.

  • gsa_key_file (Optional[str]) – Mount a file with a gsa key to /gsa-key/key.json. Only used if a job specifies a docker image. This option will override the value set by the environment variable HAIL_BATCH_GSA_KEY_FILE.

  • extra_docker_run_flags (Optional[str]) – Additional flags to pass to docker run. Only used if a job specifies a docker image. This option will override the value set by the environment variable HAIL_BATCH_EXTRA_DOCKER_RUN_FLAGS.

Methods

_async_run

Execute a batch.

async _async_run(batch, dry_run, verbose, delete_scratch_on_exit, **backend_kwargs)

Execute a batch.

Warning

This method should not be called directly. Instead, use batch.Batch.run().

Parameters:
  • batch (Batch) – Batch to execute.

  • dry_run (bool) – If True, don’t execute code.

  • verbose (bool) – If True, print debugging output.

  • delete_scratch_on_exit (bool) – If True, delete temporary directories with intermediate files.

Return type:

None