Skip to content

Commit fe59078

Browse files
committed
retry transient errors when downloading artefacts
1 parent 5f975f6 commit fe59078

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

hail/python/benchmark/hail/fixtures.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77

88
import hail as hl
9+
from hailtop.utils import async_to_blocking, retry_transient_errors
910

1011

1112
@pytest.fixture(scope='session')
@@ -23,20 +24,23 @@ def resource_dir(request, tmpdir_factory):
2324
gs_curl_root = 'https://storage.googleapis.com/hail-common/benchmark'
2425

2526

26-
def __download(data_dir, filename):
27+
async def __download(data_dir, filename):
2728
url = os.path.join(gs_curl_root, filename)
2829
logging.info(f'downloading: {filename}')
29-
# Note: the below does not work on batch due to docker/ssl problems
30-
# dest = os.path.join(data_dir, filename)
31-
# urlretrieve(url, dest)
3230
subprocess.check_call(['curl', url, '-Lfs', '--output', f'{data_dir / filename}'])
3331
logging.info(f'done: {filename}')
3432

3533

3634
def localize(path: Path):
3735
if not path.exists():
3836
path.parent.mkdir(parents=True, exist_ok=True)
39-
__download(path.parent, path.name)
37+
async_to_blocking(
38+
retry_transient_errors(
39+
__download,
40+
path.parent,
41+
path.name,
42+
)
43+
)
4044

4145
return path
4246

0 commit comments

Comments
 (0)