Skip to content

Commit

Permalink
[batch] reads HAIL_BATCH_REGIONS environment variable correctly (#1…
Browse files Browse the repository at this point in the history
…3239)

`hailtop.batch.ServiceBackend` uses `get_user_config().get` to read the
`HAIL_BATCH_REGIONS` environment variable, when it should use
`configuration_of`. This change fixes that.
  • Loading branch information
iris-garden authored Jul 21, 2023
1 parent dae3778 commit 7f718fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hail/python/hailtop/batch/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from rich.progress import track

from hailtop import pip_version
from hailtop.config import configuration_of, get_deploy_config, get_user_config, get_remote_tmpdir
from hailtop.config import configuration_of, get_deploy_config, get_remote_tmpdir
from hailtop.utils.rich_progress_bar import SimpleRichProgressBar
from hailtop.utils import parse_docker_image_reference, async_to_blocking, bounded_gather, url_scheme
from hailtop.batch.hail_genetics_images import HAIL_GENETICS_IMAGES
Expand Down Expand Up @@ -482,8 +482,7 @@ def __init__(self,
'MY_BILLING_PROJECT`')
self._batch_client = BatchClient(billing_project, _token=token)

user_config = get_user_config()
self.remote_tmpdir = get_remote_tmpdir('ServiceBackend', bucket=bucket, remote_tmpdir=remote_tmpdir, user_config=user_config)
self.remote_tmpdir = get_remote_tmpdir('ServiceBackend', bucket=bucket, remote_tmpdir=remote_tmpdir)

gcs_kwargs: Dict[str, Any]
if google_project is not None:
Expand All @@ -502,7 +501,7 @@ def __init__(self,
self.__fs: RouterAsyncFS = RouterAsyncFS(gcs_kwargs=gcs_kwargs)

if regions is None:
regions_from_conf = user_config.get('batch', 'regions', fallback=None)
regions_from_conf = configuration_of('batch', 'regions', None, None)
if regions_from_conf is not None:
assert isinstance(regions_from_conf, str)
regions = regions_from_conf.split(',')
Expand Down

0 comments on commit 7f718fb

Please sign in to comment.