cpg-utils 5.1.0__tar.gz → 5.2.0__tar.gz

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.
Files changed (28) hide show
  1. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/PKG-INFO +1 -1
  2. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/cromwell.py +6 -0
  3. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/hail_batch.py +17 -0
  4. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils.egg-info/PKG-INFO +1 -1
  5. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/setup.py +1 -1
  6. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/LICENSE +0 -0
  7. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/README.md +0 -0
  8. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/__init__.py +0 -0
  9. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/cloud.py +0 -0
  10. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/cloudpath_hail_az.py +0 -0
  11. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/config.py +0 -0
  12. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/constants.py +0 -0
  13. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/cromwell_model.py +0 -0
  14. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/dataproc.py +0 -0
  15. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/git.py +0 -0
  16. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/membership.py +0 -0
  17. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/py.typed +0 -0
  18. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils/slack.py +0 -0
  19. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils.egg-info/SOURCES.txt +0 -0
  20. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils.egg-info/dependency_links.txt +0 -0
  21. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils.egg-info/requires.txt +0 -0
  22. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/cpg_utils.egg-info/top_level.txt +0 -0
  23. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/pyproject.toml +0 -0
  24. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/setup.cfg +0 -0
  25. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/test/__init__.py +0 -0
  26. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/test/test_config.py +0 -0
  27. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/test/test_cromwell.py +0 -0
  28. {cpg-utils-5.1.0 → cpg-utils-5.2.0}/test/test_doctests.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cpg-utils
3
- Version: 5.1.0
3
+ Version: 5.2.0
4
4
  Summary: Library of convenience functions specific to the CPG
5
5
  Home-page: https://github.com/populationgenomics/cpg-utils
6
6
  License: MIT
@@ -483,6 +483,9 @@ def watch_workflow( # noqa: C901
483
483
  and (datetime.now() - start).total_seconds() >= time_limit_seconds
484
484
  ):
485
485
  # time to die, Mr. Cromwell
486
+ logger.info(
487
+ f'This job has exceeded the max permitted runtime ({time_limit_seconds}s), and will be aborted',
488
+ )
486
489
  auth_header = {'Authorization': f'Bearer {_get_cromwell_oauth_token()}'}
487
490
  r = requests.post(abort_url, headers=auth_header, timeout=10)
488
491
  if not r.ok:
@@ -491,6 +494,9 @@ def watch_workflow( # noqa: C901
491
494
  )
492
495
  _remaining_exceptions -= 1
493
496
  continue
497
+ # quit if we successfully aborted
498
+ logger.info(f'Successfully aborted workflow {workflow_id}')
499
+ return
494
500
 
495
501
  if _remaining_exceptions <= 0:
496
502
  raise CromwellError('Unreachable')
@@ -15,6 +15,7 @@ from deprecated import deprecated
15
15
 
16
16
  import hail as hl
17
17
  import hailtop.batch as hb
18
+ from hail.backend.service_backend import ServiceBackend as InternalServiceBackend
18
19
  from hail.utils.java import Env
19
20
  from hailtop.config import get_deploy_config
20
21
 
@@ -307,6 +308,15 @@ def make_job_name(
307
308
  return name
308
309
 
309
310
 
311
+ _default_override_revision = None
312
+
313
+
314
+ class DefaultOverrideServiceBackend(InternalServiceBackend):
315
+ @property
316
+ def jar_spec(self) -> dict:
317
+ return {'type': 'git_revision', 'value': _default_override_revision}
318
+
319
+
310
320
  def init_batch(**kwargs: Any):
311
321
  """
312
322
  Initializes the Hail Query Service from within Hail Batch.
@@ -331,6 +341,13 @@ def init_batch(**kwargs: Any):
331
341
  ),
332
342
  )
333
343
 
344
+ if revision := config_retrieve(['workflow', 'default_jar_spec_revision'], False):
345
+ global _default_override_revision
346
+ _default_override_revision = revision
347
+ backend = Env.backend()
348
+ if isinstance(backend, InternalServiceBackend):
349
+ backend.__class__ = DefaultOverrideServiceBackend
350
+
334
351
 
335
352
  def copy_common_env(job: hb.batch.job.Job) -> None:
336
353
  """Copies common environment variables that we use to run Hail jobs.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cpg-utils
3
- Version: 5.1.0
3
+ Version: 5.2.0
4
4
  Summary: Library of convenience functions specific to the CPG
5
5
  Home-page: https://github.com/populationgenomics/cpg-utils
6
6
  License: MIT
@@ -8,7 +8,7 @@ with open('README.md') as f:
8
8
  setup(
9
9
  name='cpg-utils',
10
10
  # This tag is automatically updated by bumpversion
11
- version='5.1.0',
11
+ version='5.2.0',
12
12
  description='Library of convenience functions specific to the CPG',
13
13
  long_description=long_description,
14
14
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes