pybiolib 1.2.218__py3-none-any.whl → 1.2.223__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,6 +78,7 @@ class HttpClient:
78
78
  retries: int = 5,
79
79
  timeout_in_seconds: Optional[int] = None,
80
80
  response_path: Optional[str] = None,
81
+ retry_on_http_500: Optional[bool] = False,
81
82
  ) -> HttpResponse:
82
83
  if not HttpClient.ssl_context:
83
84
  HttpClient.ssl_context = _create_ssl_context()
@@ -112,6 +113,9 @@ class HttpClient:
112
113
  if error.code == 429:
113
114
  logger_no_user_data.warning(f'HTTP {method} request failed with status 429 for "{url}"')
114
115
  last_error = error
116
+ elif error.code == 500 and retry_on_http_500:
117
+ logger_no_user_data.warning(f'HTTP {method} request failed with status 500 for "{url}"')
118
+ last_error = error
115
119
  elif error.code == 502:
116
120
  logger_no_user_data.warning(f'HTTP {method} request failed with status 502 for "{url}"')
117
121
  last_error = error
@@ -1,6 +1,6 @@
1
- from enum import Enum
2
1
  import random
3
2
  import string
3
+ from enum import Enum
4
4
 
5
5
  from biolib.biolib_logging import logger
6
6
 
@@ -29,7 +29,7 @@ def get_package_type(package):
29
29
  return 'StdoutAndStderr'
30
30
 
31
31
  else:
32
- raise Exception(f"Unexpected package type {package_type}")
32
+ raise Exception(f'Unexpected package type {package_type}')
33
33
 
34
34
 
35
35
  class SystemExceptionCodes(Enum):
@@ -68,6 +68,8 @@ class SystemExceptionCodes(Enum):
68
68
  FAILED_TO_ALLOCATE_JOB_TO_COMPUTE_NODE = 32
69
69
  NO_MODULES_FOUND_ON_JOB = 33
70
70
  FAILED_TO_INITIALIZE_DOCKER_EXECUTOR = 34
71
+ COMPUTE_NODE_SHUTDOWN = 35
72
+ COMPUTE_NODE_SHUTDOWN_DUE_TO_HEALTH_CHECK_FAILURE = 36
71
73
 
72
74
 
73
75
  SystemExceptionCodeMap = {
@@ -106,6 +108,8 @@ SystemExceptionCodeMap = {
106
108
  32: 'Failed to allocate job to compute node',
107
109
  33: 'No modules found on job',
108
110
  34: 'Failed to initialize docker executor',
111
+ 35: 'Compute node shutdown',
112
+ 36: 'Compute node shutdown due to health check failure',
109
113
  }
110
114
 
111
115
 
biolib/utils/__init__.py CHANGED
@@ -93,6 +93,7 @@ def _download_chunk(input_tuple: DownloadChunkInputTuple) -> bytes:
93
93
  headers={'range': f'bytes={start}-{end}'},
94
94
  timeout_in_seconds=300, # timeout after 5 min
95
95
  retries=20,
96
+ retry_on_http_500=True,
96
97
  )
97
98
  except Exception as exception:
98
99
  logger_no_user_data.exception("Hit error downloading chunk")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.2.218
3
+ Version: 1.2.223
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -10,7 +10,7 @@ biolib/_internal/data_record/remote_storage_endpoint.py,sha256=eCptuZ4DMAPnaNCVD
10
10
  biolib/_internal/file_utils.py,sha256=4jT6j7bB21c0JNn5BfnyWQib_zt0CVtJ_TiOFOStRcE,2604
11
11
  biolib/_internal/fuse_mount/__init__.py,sha256=B_tM6RM2dBw-vbpoHJC4X3tOAaN1H2RDvqYJOw3xFwg,55
12
12
  biolib/_internal/fuse_mount/experiment_fuse_mount.py,sha256=08aUdEq_bvqLBft_gSLjOClKDy5sBnMts1RfJf7AP_U,7012
13
- biolib/_internal/http_client.py,sha256=Q8tUvXL9rxTrPgNxoI8VGTGI8-AgF2ZF0___s8kCGkY,5440
13
+ biolib/_internal/http_client.py,sha256=C0bHqVrenT3ifZ3k0FdzBZR7ZxDXKBUG148KRxheAyk,5701
14
14
  biolib/_internal/lfs/__init__.py,sha256=gSWo_xg61UniYgD7yNYxeT4I9uaXBCBSi3_nmZjnPpE,35
15
15
  biolib/_internal/lfs/cache.py,sha256=pQS2np21rdJ6I3DpoOutnzPHpLOZgUIS8TMltUJk_k4,2226
16
16
  biolib/_internal/libs/__init__.py,sha256=Jdf4tNPqe_oIIf6zYml6TiqhL_02Vyqwge6IELrAFhw,98
@@ -93,7 +93,7 @@ biolib/compute_node/job_worker/utils.py,sha256=wgxcIA8yAhUPdCwyvuuJ0JmreyWmmUoBO
93
93
  biolib/compute_node/remote_host_proxy.py,sha256=1EZnB0WWG359Yy22xBoqRqGEmmlA12rpiG5u8B2381M,16533
94
94
  biolib/compute_node/socker_listener_thread.py,sha256=T5_UikA3MB9bD5W_dckYLPTgixh72vKUlgbBvj9dbM0,1601
95
95
  biolib/compute_node/socket_sender_thread.py,sha256=YgamPHeUm2GjMFGx8qk-99WlZhEs-kAb3q_2O6qByig,971
96
- biolib/compute_node/utils.py,sha256=M7i_WTyxbFM3Lri9RWZ_8FeQNYrQIWpKGLfp2I55oeY,4677
96
+ biolib/compute_node/utils.py,sha256=fWtFIcGatek1NaVOT9Vaey6UFp8GKLYGLAVu8jgOwi8,4861
97
97
  biolib/compute_node/webserver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  biolib/compute_node/webserver/gunicorn_flask_application.py,sha256=jPfR_YvNBekLUXWo_vHFV-FIwlb8s8tacKmGHvh93qc,914
99
99
  biolib/compute_node/webserver/webserver.py,sha256=o4kOAStsqThUtKlnRE-U5TP0JIYntuySDjU7PH310xg,6620
@@ -114,14 +114,14 @@ biolib/templates/example_app.py,sha256=EB3E3RT4SeO_ii5nVQqJpi5KDGNE_huF1ub-e5ZFv
114
114
  biolib/typing_utils.py,sha256=ntzrlyTkUaO2OtccLYzCAGztGdca0WT5fikJUmSkT-Y,148
115
115
  biolib/user/__init__.py,sha256=Db5wtxLfFz3ID9TULSSTo77csw9tO6RtxMRvV5cqKEE,39
116
116
  biolib/user/sign_in.py,sha256=XTAmRPKfmg7VAaB8cT5wcmfxoPXeHqY8LmDiADF7zbw,2064
117
- biolib/utils/__init__.py,sha256=rOUFayiY9h23ytSZgCNc7kEHorqFWxvYmt789Zb5mCM,5754
117
+ biolib/utils/__init__.py,sha256=VtuTFu8zWZwJzfYhVEpPdlhvTA2JkHCboqqQA-VNkpA,5790
118
118
  biolib/utils/app_uri.py,sha256=Yq_-_VGugQhMMo6mM5f0G9yNlLkr0WK4j0Nrf3FE4xQ,2171
119
119
  biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3100
120
120
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
121
121
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
122
122
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
123
- pybiolib-1.2.218.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
- pybiolib-1.2.218.dist-info/METADATA,sha256=j5zDe_qsU-YkwN5wtvp2Sw_B85g67nzkQ7SaU94gn6o,1558
125
- pybiolib-1.2.218.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
126
- pybiolib-1.2.218.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
- pybiolib-1.2.218.dist-info/RECORD,,
123
+ pybiolib-1.2.223.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
+ pybiolib-1.2.223.dist-info/METADATA,sha256=hZM7P1p0YB5LlIem0gje4vnfobOPyQ8bss7gST75qgs,1558
125
+ pybiolib-1.2.223.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
126
+ pybiolib-1.2.223.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
+ pybiolib-1.2.223.dist-info/RECORD,,