Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan King committed Feb 1, 2024
1 parent 7874df0 commit 69f281a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
21 changes: 12 additions & 9 deletions hail/python/hailtop/batch/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,12 @@ class ServiceBackend(Backend[bc.Batch]):
Create and use a backend that bills to the Hail Batch billing project named "my-billing-account"
and stores temporary intermediate files in "gs://my-bucket/temporary-files".
>>> service_backend = ServiceBackend(
>>> import hailtop.batch as hb
>>> service_backend = hb.ServiceBackend(
... billing_project='my-billing-account',
... remote_tmpdir='gs://my-bucket/temporary-files/'
... ) # doctest: +SKIP
>>> b = Batch(backend=service_backend) # doctest: +SKIP
>>> b = hb.Batch(backend=service_backend) # doctest: +SKIP
>>> j = b.new_job() # doctest: +SKIP
>>> j.command('echo hello world!') # doctest: +SKIP
>>> b.run() # doctest: +SKIP
Expand All @@ -434,7 +435,8 @@ class ServiceBackend(Backend[bc.Batch]):
configuration file::
cat >my-batch-script.py >>EOF
b = Batch(backend=ServiceBackend())
import hailtop.batch as hb
b = hb.Batch(backend=ServiceBackend())
j = b.new_job()
j.command('echo hello world!')
b.run()
Expand All @@ -446,7 +448,8 @@ class ServiceBackend(Backend[bc.Batch]):
Same as above, but also specify the use of the :class:`.ServiceBackend` via configuration file::
cat >my-batch-script.py >>EOF
b = Batch()
import hailtop.batch as hb
b = hb.Batch()
j = b.new_job()
j.command('echo hello world!')
b.run()
Expand All @@ -459,14 +462,14 @@ class ServiceBackend(Backend[bc.Batch]):
Create a backend which stores temporary intermediate files in
"https://my-account.blob.core.windows.net/my-container/tempdir".
>>> service_backend = ServiceBackend(
>>> service_backend = hb.ServiceBackend(
... billing_project='my-billing-account',
... remote_tmpdir='https://my-account.blob.core.windows.net/my-container/tempdir'
... ) # doctest: +SKIP
Require all jobs in all batches in this backend to execute in us-central1::
>>> b = Batch(backend=ServiceBackend(regions=['us-central1']))
>>> b = hb.Batch(backend=hb.ServiceBackend(regions=['us-central1']))
Same as above, but using a configuration file::
Expand All @@ -480,16 +483,16 @@ class ServiceBackend(Backend[bc.Batch]):
Permit jobs to execute in *either* us-central1 or us-east1::
>>> b = Batch(backend=ServiceBackend(regions=['us-central1', 'us-east1']))
>>> b = hb.Batch(backend=hb.ServiceBackend(regions=['us-central1', 'us-east1']))
Same as a bove, but using a configuration file::
hailctl config set batch/regions us-central1,us-east1
Allow reading or writing to buckets even though they are "cold" storage:
>>> b = Batch(
... backend=ServiceBackend(
>>> b = hb.Batch(
... backend=hb.ServiceBackend(
... gcs_bucket_allow_list=['cold-bucket', 'cold-bucket2'],
... ),
... )
Expand Down
5 changes: 3 additions & 2 deletions hail/python/hailtop/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Batch:
--------
Create a batch object:
>>> p = Batch()
>>> import hailtop.batch as hb
>>> p = hb.Batch()
Create a new job that prints "hello":
Expand All @@ -37,7 +38,7 @@ class Batch:
Require all jobs in this batch to execute in us-central1:
>>> b = Batch(backend=ServiceBackend(), regions=['us-central1'])
>>> b = hb.Batch(backend=hb.ServiceBackend(), default_regions=['us-central1'])
Notes
-----
Expand Down

0 comments on commit 69f281a

Please sign in to comment.