cloudos-cli 2.87.1__tar.gz → 2.88.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 (78) hide show
  1. {cloudos_cli-2.87.1/cloudos_cli.egg-info → cloudos_cli-2.88.0}/PKG-INFO +25 -1
  2. cloudos_cli-2.87.1/PKG-INFO → cloudos_cli-2.88.0/README.md +24 -35
  3. cloudos_cli-2.88.0/cloudos_cli/_version.py +1 -0
  4. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/constants.py +6 -2
  5. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/jobs/cli.py +18 -45
  6. cloudos_cli-2.88.0/cloudos_cli/utils/nextflow_version.py +128 -0
  7. cloudos_cli-2.87.1/README.md → cloudos_cli-2.88.0/cloudos_cli.egg-info/PKG-INFO +59 -0
  8. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli.egg-info/SOURCES.txt +2 -0
  9. cloudos_cli-2.88.0/tests/test_nextflow_version.py +177 -0
  10. cloudos_cli-2.87.1/cloudos_cli/_version.py +0 -1
  11. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/LICENSE +0 -0
  12. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/__init__.py +0 -0
  13. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/__main__.py +0 -0
  14. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/bash/__init__.py +0 -0
  15. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/bash/cli.py +0 -0
  16. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/clos.py +0 -0
  17. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/configure/__init__.py +0 -0
  18. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/configure/cli.py +0 -0
  19. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/configure/configure.py +0 -0
  20. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/cost/__init__.py +0 -0
  21. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/cost/cost.py +0 -0
  22. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/cromwell/__init__.py +0 -0
  23. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/cromwell/cli.py +0 -0
  24. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/datasets/__init__.py +0 -0
  25. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/datasets/cli.py +0 -0
  26. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/datasets/datasets.py +0 -0
  27. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/import_wf/__init__.py +0 -0
  28. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/import_wf/import_wf.py +0 -0
  29. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/interactive_session/__init__.py +0 -0
  30. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/interactive_session/cli.py +0 -0
  31. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/interactive_session/interactive_session.py +0 -0
  32. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/jobs/__init__.py +0 -0
  33. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/jobs/job.py +0 -0
  34. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/link/__init__.py +0 -0
  35. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/link/cli.py +0 -0
  36. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/link/link.py +0 -0
  37. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/logging/__init__.py +0 -0
  38. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/logging/logger.py +0 -0
  39. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/procurement/__init__.py +0 -0
  40. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/procurement/cli.py +0 -0
  41. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/procurement/images.py +0 -0
  42. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/projects/__init__.py +0 -0
  43. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/projects/cli.py +0 -0
  44. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/queue/__init__.py +0 -0
  45. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/queue/cli.py +0 -0
  46. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/queue/queue.py +0 -0
  47. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/related_analyses/__init__.py +0 -0
  48. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/related_analyses/related_analyses.py +0 -0
  49. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/__init__.py +0 -0
  50. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/array_job.py +0 -0
  51. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/cli_helpers.py +0 -0
  52. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/cloud.py +0 -0
  53. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/details.py +0 -0
  54. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/errors.py +0 -0
  55. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/last_wf.py +0 -0
  56. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/requests.py +0 -0
  57. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/utils/resources.py +0 -0
  58. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/workflows/__init__.py +0 -0
  59. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli/workflows/cli.py +0 -0
  60. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
  61. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
  62. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli.egg-info/requires.txt +0 -0
  63. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/cloudos_cli.egg-info/top_level.txt +0 -0
  64. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/setup.cfg +0 -0
  65. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/setup.py +0 -0
  66. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/__init__.py +0 -0
  67. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/functions_for_pytest.py +0 -0
  68. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_cli_project_create.py +0 -0
  69. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_cost/__init__.py +0 -0
  70. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_cost/test_job_cost.py +0 -0
  71. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_error_messages.py +0 -0
  72. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_interactive_session/__init__.py +0 -0
  73. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_interactive_session/test_create_session.py +0 -0
  74. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_interactive_session/test_list_sessions.py +0 -0
  75. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_logging/__init__.py +0 -0
  76. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_logging/test_logger.py +0 -0
  77. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_related_analyses/__init__.py +0 -0
  78. {cloudos_cli-2.87.1 → cloudos_cli-2.88.0}/tests/test_related_analyses/test_related_analyses.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.87.1
3
+ Version: 2.88.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -687,6 +687,29 @@ When there are duplicate `--workflow-name` in the platform, you can add the `--l
687
687
 
688
688
  _For example, the pipeline `lifebit-process` was imported on May 23 2025 and again on May 30 2025; with the `--last` flag, it will use the import of May 30, 2025._
689
689
 
690
+ **Nextflow Version Support**
691
+
692
+ CloudOS CLI supports multiple Nextflow versions, with intelligent defaults based on your workflow type and execution platform.
693
+
694
+ **Default Version Behavior:**
695
+
696
+ The default Nextflow version is automatically selected based on your workflow type and execution platform:
697
+
698
+ - **Azure Platform**: Always uses `22.11.1-edge` regardless of workflow type
699
+ - **Platform Workflows** (AWS/HPC): Uses `22.10.8` (Lifebit provided workflows and modules)
700
+ - **User-Imported Workflows** (AWS/HPC): AWS uses `24.04.4`; HPC uses `22.10.8`
701
+
702
+ **Specifying a Custom Version:**
703
+
704
+ You can override the default by using the `--nextflow-version` parameter:
705
+
706
+ ```bash
707
+ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos_cli/examples/rnatoy.config --nextflow-version 25.04.8 --resumable
708
+ ```
709
+
710
+ > [!NOTE]
711
+ > **Azure Platform Behavior**: If you specify a Nextflow version not supported by Azure (anything other than 22.11.1-edge), CloudOS CLI will display a warning and automatically use 22.11.1-edge instead. Your job will proceed without error.
712
+
690
713
  **AWS Executor Support**
691
714
 
692
715
  CloudOS supports [AWS batch](https://www.nextflow.io/docs/latest/executor.html?highlight=executors#aws-batch) executor by default.
@@ -705,6 +728,7 @@ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos
705
728
  CloudOS can also be configured to use Microsoft Azure compute platforms. If your CloudOS is configured to use Azure, you will need to take into consideration the following:
706
729
 
707
730
  - When sending jobs to CloudOS using `cloudos job run` command, please use the option `--execution-platform azure`
731
+ - Azure only supports Nextflow version `22.11.1-edge`. If you specify a different version, CloudOS CLI will display a warning and automatically use `22.11.1-edge` instead
708
732
  - Due to the lack of AWS batch queues in Azure, `cloudos queue list` command is not working
709
733
 
710
734
  Other than that, `cloudos-cli` will work very similarly. For instance, this is a typical send job command:
@@ -1,38 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: cloudos_cli
3
- Version: 2.87.1
4
- Summary: Python package for interacting with CloudOS
5
- Home-page: https://github.com/lifebit-ai/cloudos-cli
6
- Author: David Piñeyro
7
- Author-email: david.pineyro@lifebit.ai
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Operating System :: POSIX :: Linux
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: click>=8.0.1
15
- Requires-Dist: rich-click>=1.8.2
16
- Requires-Dist: pandas>=1.3.4
17
- Requires-Dist: numpy>=1.26.4
18
- Requires-Dist: requests>=2.26.0
19
- Provides-Extra: test
20
- Requires-Dist: pytest; extra == "test"
21
- Requires-Dist: mock; extra == "test"
22
- Requires-Dist: responses; extra == "test"
23
- Requires-Dist: requests_mock; extra == "test"
24
- Dynamic: author
25
- Dynamic: author-email
26
- Dynamic: classifier
27
- Dynamic: description
28
- Dynamic: description-content-type
29
- Dynamic: home-page
30
- Dynamic: license-file
31
- Dynamic: provides-extra
32
- Dynamic: requires-dist
33
- Dynamic: requires-python
34
- Dynamic: summary
35
-
36
1
  # cloudos-cli
37
2
 
38
3
  [![CI_tests](https://github.com/lifebit-ai/cloudos-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/lifebit-ai/cloudos-cli/actions/workflows/ci.yml)
@@ -687,6 +652,29 @@ When there are duplicate `--workflow-name` in the platform, you can add the `--l
687
652
 
688
653
  _For example, the pipeline `lifebit-process` was imported on May 23 2025 and again on May 30 2025; with the `--last` flag, it will use the import of May 30, 2025._
689
654
 
655
+ **Nextflow Version Support**
656
+
657
+ CloudOS CLI supports multiple Nextflow versions, with intelligent defaults based on your workflow type and execution platform.
658
+
659
+ **Default Version Behavior:**
660
+
661
+ The default Nextflow version is automatically selected based on your workflow type and execution platform:
662
+
663
+ - **Azure Platform**: Always uses `22.11.1-edge` regardless of workflow type
664
+ - **Platform Workflows** (AWS/HPC): Uses `22.10.8` (Lifebit provided workflows and modules)
665
+ - **User-Imported Workflows** (AWS/HPC): AWS uses `24.04.4`; HPC uses `22.10.8`
666
+
667
+ **Specifying a Custom Version:**
668
+
669
+ You can override the default by using the `--nextflow-version` parameter:
670
+
671
+ ```bash
672
+ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos_cli/examples/rnatoy.config --nextflow-version 25.04.8 --resumable
673
+ ```
674
+
675
+ > [!NOTE]
676
+ > **Azure Platform Behavior**: If you specify a Nextflow version not supported by Azure (anything other than 22.11.1-edge), CloudOS CLI will display a warning and automatically use 22.11.1-edge instead. Your job will proceed without error.
677
+
690
678
  **AWS Executor Support**
691
679
 
692
680
  CloudOS supports [AWS batch](https://www.nextflow.io/docs/latest/executor.html?highlight=executors#aws-batch) executor by default.
@@ -705,6 +693,7 @@ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos
705
693
  CloudOS can also be configured to use Microsoft Azure compute platforms. If your CloudOS is configured to use Azure, you will need to take into consideration the following:
706
694
 
707
695
  - When sending jobs to CloudOS using `cloudos job run` command, please use the option `--execution-platform azure`
696
+ - Azure only supports Nextflow version `22.11.1-edge`. If you specify a different version, CloudOS CLI will display a warning and automatically use `22.11.1-edge` instead
708
697
  - Due to the lack of AWS batch queues in Azure, `cloudos queue list` command is not working
709
698
 
710
699
  Other than that, `cloudos-cli` will work very similarly. For instance, this is a typical send job command:
@@ -0,0 +1 @@
1
+ __version__ = '2.88.0'
@@ -6,13 +6,17 @@ JOB_FAILED = 'failed'
6
6
  JOB_ABORTED = 'aborted'
7
7
 
8
8
  # Nextflow version constants
9
- AWS_NEXTFLOW_VERSIONS = ['22.10.8', '24.04.4']
9
+ AWS_NEXTFLOW_VERSIONS = ['22.10.8', '24.04.4', '25.04.8', '25.10.4']
10
10
  AZURE_NEXTFLOW_VERSIONS = ['22.11.1-edge']
11
11
  HPC_NEXTFLOW_VERSIONS = ['22.10.8']
12
- AWS_NEXTFLOW_LATEST = '24.04.4'
12
+ AWS_NEXTFLOW_LATEST = '25.10.4'
13
13
  AZURE_NEXTFLOW_LATEST = '22.11.1-edge'
14
14
  HPC_NEXTFLOW_LATEST = '22.10.8'
15
15
 
16
+ # Nextflow version defaults by workflow type
17
+ PLATFORM_WORKFLOW_NEXTFLOW_VERSION = '22.10.8' # For Lifebit Platform workflows (modules)
18
+ USER_WORKFLOW_NEXTFLOW_VERSION = '24.04.4' # For user-imported workflows
19
+
16
20
  # Job abort states
17
21
  ABORT_JOB_STATES = ['running', 'initializing']
18
22
 
@@ -11,6 +11,7 @@ from cloudos_cli.clos import Cloudos
11
11
  from cloudos_cli.utils.errors import BadRequestException
12
12
  from cloudos_cli.utils.resources import ssl_selector
13
13
  from cloudos_cli.utils.details import create_job_details, create_job_list_table
14
+ from cloudos_cli.utils.nextflow_version import resolve_nextflow_version
14
15
  from cloudos_cli.cost.cost import CostViewer
15
16
  from cloudos_cli.related_analyses.related_analyses import related_analyses
16
17
  from cloudos_cli.configure.configure import with_profile_config, CLOUDOS_URL
@@ -18,12 +19,6 @@ from cloudos_cli.link import Link
18
19
  from cloudos_cli.constants import (
19
20
  JOB_COMPLETED,
20
21
  REQUEST_INTERVAL_CROMWELL,
21
- AWS_NEXTFLOW_VERSIONS,
22
- AZURE_NEXTFLOW_VERSIONS,
23
- HPC_NEXTFLOW_VERSIONS,
24
- AWS_NEXTFLOW_LATEST,
25
- AZURE_NEXTFLOW_LATEST,
26
- HPC_NEXTFLOW_LATEST,
27
22
  ABORT_JOB_STATES
28
23
  )
29
24
  import json
@@ -88,9 +83,9 @@ def job():
88
83
  'to use with your job.'))
89
84
  @click.option('--nextflow-version',
90
85
  help=('Nextflow version to use when executing the workflow in CloudOS. ' +
91
- 'Default=22.10.8.'),
92
- type=click.Choice(['22.10.8', '24.04.4', '22.11.1-edge', 'latest']),
93
- default='22.10.8')
86
+ 'Defaults to 22.10.8 for Platform Workflows or 24.04.4 for user-imported Workflows.'),
87
+ type=click.Choice(['22.10.8', '24.04.4', '25.04.8', '25.10.4', '22.11.1-edge', 'latest']),
88
+ default=None)
94
89
  @click.option('--git-commit',
95
90
  help=('The git commit hash to run for ' +
96
91
  'the selected pipeline. ' +
@@ -298,6 +293,16 @@ def run(ctx,
298
293
  cl = Cloudos(cloudos_url, apikey, cromwell_token)
299
294
  workflow_type = cl.detect_workflow(workflow_name, workspace_id, verify_ssl, last)
300
295
  is_module = cl.is_module(workflow_name, workspace_id, verify_ssl, last)
296
+
297
+ # Resolve and validate Nextflow version
298
+ nextflow_version = resolve_nextflow_version(
299
+ nextflow_version=nextflow_version,
300
+ execution_platform=execution_platform,
301
+ is_module=is_module,
302
+ workflow_name=workflow_name,
303
+ verbose=verbose
304
+ )
305
+
301
306
  if execution_platform == 'hpc' and workflow_type == 'wdl':
302
307
  raise ValueError(f'The workflow {workflow_name} is a WDL workflow. ' +
303
308
  'WDL is not supported on HPC execution platform.')
@@ -348,13 +353,8 @@ def run(ctx,
348
353
  f'Platform Workflow "{workflow_name}". Platform Workflows ' +
349
354
  'use their own predetermined queues.')
350
355
  job_queue_id = None
351
- if nextflow_version != '22.10.8':
352
- print(f'The selected worflow \'{workflow_name}\' ' +
353
- 'is a CloudOS module. CloudOS modules only work with ' +
354
- 'Nextflow version 22.10.8. Switching to use 22.10.8')
355
- nextflow_version = '22.10.8'
356
356
  if execution_platform == 'azure':
357
- print(f'The selected worflow \'{workflow_name}\' ' +
357
+ print(f'The selected workflow \'{workflow_name}\' ' +
358
358
  'is a CloudOS module. For these workflows, worker nodes ' +
359
359
  'are managed internally. For this reason, the options ' +
360
360
  'azure-worker-instance-type, azure-worker-instance-disk and ' +
@@ -382,33 +382,7 @@ def run(ctx,
382
382
  docker_login = True
383
383
  else:
384
384
  docker_login = False
385
- if nextflow_version == 'latest':
386
- if execution_platform == 'aws':
387
- nextflow_version = AWS_NEXTFLOW_LATEST
388
- elif execution_platform == 'azure':
389
- nextflow_version = AZURE_NEXTFLOW_LATEST
390
- else:
391
- nextflow_version = HPC_NEXTFLOW_LATEST
392
- print('You have specified Nextflow version \'latest\' for execution platform ' +
393
- f'\'{execution_platform}\'. The workflow will use the ' +
394
- f'latest version available on CloudOS: {nextflow_version}.')
395
- if execution_platform == 'aws':
396
- if nextflow_version not in AWS_NEXTFLOW_VERSIONS:
397
- print('For execution platform \'aws\', the workflow will use the default ' +
398
- '\'22.10.8\' version on CloudOS.')
399
- nextflow_version = '22.10.8'
400
- if execution_platform == 'azure':
401
- if nextflow_version not in AZURE_NEXTFLOW_VERSIONS:
402
- print('For execution platform \'azure\', the workflow will use the \'22.11.1-edge\' ' +
403
- 'version on CloudOS.')
404
- nextflow_version = '22.11.1-edge'
405
- if execution_platform == 'hpc':
406
- if nextflow_version not in HPC_NEXTFLOW_VERSIONS:
407
- print('For execution platform \'hpc\', the workflow will use the \'22.10.8\' version on CloudOS.')
408
- nextflow_version = '22.10.8'
409
- if nextflow_version != '22.10.8' and nextflow_version != '22.11.1-edge':
410
- click.secho(f'You have specified Nextflow version {nextflow_version}. This version requires the pipeline ' +
411
- 'to be written in DSL2 and does not support DSL1.', fg='yellow', bold=True)
385
+
412
386
  print('\nExecuting run...')
413
387
  if workflow_type == 'nextflow':
414
388
  print(f'\tNextflow version: {nextflow_version}')
@@ -1737,9 +1711,8 @@ def archive_unarchive_jobs(ctx,
1737
1711
  help=('A comma separated string indicating the nextflow profile/s ' +
1738
1712
  'to use with your job.'))
1739
1713
  @click.option('--nextflow-version',
1740
- help=('Nextflow version to use when executing the workflow in CloudOS. ' +
1741
- 'Default=22.10.8.'),
1742
- type=click.Choice(['22.10.8', '24.04.4', '22.11.1-edge', 'latest']))
1714
+ help=('Nextflow version to use when executing the workflow in CloudOS.'),
1715
+ type=click.Choice(['22.10.8', '24.04.4', '25.04.8', '25.10.4', '22.11.1-edge', 'latest']))
1743
1716
  @click.option('--git-branch',
1744
1717
  help=('The branch to run for the selected pipeline. ' +
1745
1718
  'If not specified it defaults to the last commit ' +
@@ -0,0 +1,128 @@
1
+ """Nextflow version resolution and validation utilities."""
2
+
3
+ import rich_click as click
4
+ from cloudos_cli.constants import (
5
+ AWS_NEXTFLOW_VERSIONS,
6
+ AZURE_NEXTFLOW_VERSIONS,
7
+ HPC_NEXTFLOW_VERSIONS,
8
+ AWS_NEXTFLOW_LATEST,
9
+ AZURE_NEXTFLOW_LATEST,
10
+ HPC_NEXTFLOW_LATEST,
11
+ PLATFORM_WORKFLOW_NEXTFLOW_VERSION,
12
+ USER_WORKFLOW_NEXTFLOW_VERSION
13
+ )
14
+
15
+
16
+ def resolve_nextflow_version(
17
+ nextflow_version,
18
+ execution_platform,
19
+ is_module,
20
+ workflow_name=None,
21
+ verbose=False
22
+ ):
23
+ """
24
+ Resolve and validate the Nextflow version for a job submission.
25
+
26
+ This function handles:
27
+ - Dynamic defaults based on execution platform and workflow type
28
+ - 'latest' version resolution
29
+ - Platform workflow version forcing
30
+ - Platform-specific version validation with appropriate warnings/errors
31
+
32
+ Args:
33
+ nextflow_version (str or None): The requested Nextflow version, or None for default
34
+ execution_platform (str): The execution platform ('aws', 'azure', or 'hpc')
35
+ is_module (bool): Whether the workflow is a Platform workflow (module)
36
+ workflow_name (str, optional): The workflow name for informative messages
37
+ verbose (bool, optional): Whether to print verbose messages
38
+
39
+ Returns:
40
+ str: The resolved and validated Nextflow version
41
+
42
+ Raises:
43
+ click.BadParameter: If an unsupported version is specified for AWS or HPC platforms
44
+ """
45
+
46
+ # Step 1: Set dynamic default if no version specified
47
+ if nextflow_version is None:
48
+ if execution_platform == 'azure':
49
+ nextflow_version = AZURE_NEXTFLOW_LATEST # Azure has fixed Nextflow version
50
+ if verbose:
51
+ print(f'\t...Using default Nextflow version {AZURE_NEXTFLOW_LATEST} for Azure')
52
+ elif execution_platform == 'hpc':
53
+ nextflow_version = HPC_NEXTFLOW_LATEST # HPC has fixed Nextflow version
54
+ if verbose:
55
+ print(f'\t...Using default Nextflow version {HPC_NEXTFLOW_LATEST} for HPC')
56
+ elif is_module:
57
+ nextflow_version = PLATFORM_WORKFLOW_NEXTFLOW_VERSION # Lifebit Platform workflows (AWS)
58
+ if verbose:
59
+ print(f'\t...Using default Nextflow version {PLATFORM_WORKFLOW_NEXTFLOW_VERSION} for Platform Workflow')
60
+ else:
61
+ nextflow_version = USER_WORKFLOW_NEXTFLOW_VERSION # User-imported workflows (AWS only)
62
+ if verbose:
63
+ print(f'\t...Using default Nextflow version {USER_WORKFLOW_NEXTFLOW_VERSION} for user-imported workflow')
64
+
65
+ # Step 2: Resolve 'latest' to actual version
66
+ if nextflow_version == 'latest':
67
+ if execution_platform == 'aws':
68
+ nextflow_version = AWS_NEXTFLOW_LATEST
69
+ elif execution_platform == 'azure':
70
+ nextflow_version = AZURE_NEXTFLOW_LATEST
71
+ else:
72
+ nextflow_version = HPC_NEXTFLOW_LATEST
73
+ print('You have specified Nextflow version \'latest\' for execution platform ' +
74
+ f'\'{execution_platform}\'. The workflow will use the ' +
75
+ f'latest version available on CloudOS: {nextflow_version}.')
76
+
77
+ # Step 3: Force correct version for Platform workflows
78
+ if is_module:
79
+ if execution_platform == 'azure':
80
+ if nextflow_version != AZURE_NEXTFLOW_LATEST:
81
+ workflow_msg = f' \'{workflow_name}\'' if workflow_name else ''
82
+ print(f'The selected workflow{workflow_msg} ' +
83
+ 'is a CloudOS Platform Workflow on Azure. Platform Workflows on Azure only work with ' +
84
+ f'Nextflow version {AZURE_NEXTFLOW_LATEST}. Switching to use {AZURE_NEXTFLOW_LATEST}')
85
+ nextflow_version = AZURE_NEXTFLOW_LATEST
86
+ else:
87
+ if nextflow_version != PLATFORM_WORKFLOW_NEXTFLOW_VERSION:
88
+ workflow_msg = f' \'{workflow_name}\'' if workflow_name else ''
89
+ print(f'The selected workflow{workflow_msg} ' +
90
+ 'is a CloudOS Platform Workflow. Platform Workflows only work with ' +
91
+ f'Nextflow version {PLATFORM_WORKFLOW_NEXTFLOW_VERSION}. Switching to use {PLATFORM_WORKFLOW_NEXTFLOW_VERSION}')
92
+ nextflow_version = PLATFORM_WORKFLOW_NEXTFLOW_VERSION
93
+
94
+ # Step 4: Validate version for execution platform
95
+ if execution_platform == 'aws':
96
+ if nextflow_version not in AWS_NEXTFLOW_VERSIONS:
97
+ available_versions = ', '.join(AWS_NEXTFLOW_VERSIONS)
98
+ raise click.BadParameter(
99
+ f'Unsupported Nextflow version \'{nextflow_version}\' for AWS execution platform. '
100
+ f'Supported versions are: {available_versions}.'
101
+ )
102
+ elif execution_platform == 'azure':
103
+ if nextflow_version not in AZURE_NEXTFLOW_VERSIONS:
104
+ available_versions = ', '.join(AZURE_NEXTFLOW_VERSIONS)
105
+ click.secho(
106
+ f'Warning: Nextflow version \'{nextflow_version}\' is not supported for Azure execution platform. '
107
+ f'Azure only supports: {available_versions}. Switching to use {AZURE_NEXTFLOW_LATEST}.',
108
+ fg='yellow', bold=True
109
+ )
110
+ nextflow_version = AZURE_NEXTFLOW_LATEST
111
+ elif execution_platform == 'hpc':
112
+ if nextflow_version not in HPC_NEXTFLOW_VERSIONS:
113
+ available_versions = ', '.join(HPC_NEXTFLOW_VERSIONS)
114
+ raise click.BadParameter(
115
+ f'Unsupported Nextflow version \'{nextflow_version}\' for HPC execution platform. '
116
+ f'HPC only supports: {available_versions}.'
117
+ )
118
+
119
+ # Step 5: Warn about DSL2 requirement for newer versions
120
+ legacy_versions = [PLATFORM_WORKFLOW_NEXTFLOW_VERSION, AZURE_NEXTFLOW_LATEST]
121
+ if nextflow_version not in legacy_versions:
122
+ click.secho(
123
+ f'The Nextflow version being used is: {nextflow_version}. This version requires the pipeline ' +
124
+ 'to be written in DSL2 and does not support DSL1.',
125
+ fg='yellow', bold=True
126
+ )
127
+
128
+ return nextflow_version
@@ -1,3 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: cloudos_cli
3
+ Version: 2.88.0
4
+ Summary: Python package for interacting with CloudOS
5
+ Home-page: https://github.com/lifebit-ai/cloudos-cli
6
+ Author: David Piñeyro
7
+ Author-email: david.pineyro@lifebit.ai
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: POSIX :: Linux
10
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: click>=8.0.1
15
+ Requires-Dist: rich-click>=1.8.2
16
+ Requires-Dist: pandas>=1.3.4
17
+ Requires-Dist: numpy>=1.26.4
18
+ Requires-Dist: requests>=2.26.0
19
+ Provides-Extra: test
20
+ Requires-Dist: pytest; extra == "test"
21
+ Requires-Dist: mock; extra == "test"
22
+ Requires-Dist: responses; extra == "test"
23
+ Requires-Dist: requests_mock; extra == "test"
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license-file
31
+ Dynamic: provides-extra
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
1
36
  # cloudos-cli
2
37
 
3
38
  [![CI_tests](https://github.com/lifebit-ai/cloudos-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/lifebit-ai/cloudos-cli/actions/workflows/ci.yml)
@@ -652,6 +687,29 @@ When there are duplicate `--workflow-name` in the platform, you can add the `--l
652
687
 
653
688
  _For example, the pipeline `lifebit-process` was imported on May 23 2025 and again on May 30 2025; with the `--last` flag, it will use the import of May 30, 2025._
654
689
 
690
+ **Nextflow Version Support**
691
+
692
+ CloudOS CLI supports multiple Nextflow versions, with intelligent defaults based on your workflow type and execution platform.
693
+
694
+ **Default Version Behavior:**
695
+
696
+ The default Nextflow version is automatically selected based on your workflow type and execution platform:
697
+
698
+ - **Azure Platform**: Always uses `22.11.1-edge` regardless of workflow type
699
+ - **Platform Workflows** (AWS/HPC): Uses `22.10.8` (Lifebit provided workflows and modules)
700
+ - **User-Imported Workflows** (AWS/HPC): AWS uses `24.04.4`; HPC uses `22.10.8`
701
+
702
+ **Specifying a Custom Version:**
703
+
704
+ You can override the default by using the `--nextflow-version` parameter:
705
+
706
+ ```bash
707
+ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos_cli/examples/rnatoy.config --nextflow-version 25.04.8 --resumable
708
+ ```
709
+
710
+ > [!NOTE]
711
+ > **Azure Platform Behavior**: If you specify a Nextflow version not supported by Azure (anything other than 22.11.1-edge), CloudOS CLI will display a warning and automatically use 22.11.1-edge instead. Your job will proceed without error.
712
+
655
713
  **AWS Executor Support**
656
714
 
657
715
  CloudOS supports [AWS batch](https://www.nextflow.io/docs/latest/executor.html?highlight=executors#aws-batch) executor by default.
@@ -670,6 +728,7 @@ cloudos job run --profile my_profile --workflow-name rnatoy --job-config cloudos
670
728
  CloudOS can also be configured to use Microsoft Azure compute platforms. If your CloudOS is configured to use Azure, you will need to take into consideration the following:
671
729
 
672
730
  - When sending jobs to CloudOS using `cloudos job run` command, please use the option `--execution-platform azure`
731
+ - Azure only supports Nextflow version `22.11.1-edge`. If you specify a different version, CloudOS CLI will display a warning and automatically use `22.11.1-edge` instead
673
732
  - Due to the lack of AWS batch queues in Azure, `cloudos queue list` command is not working
674
733
 
675
734
  Other than that, `cloudos-cli` will work very similarly. For instance, this is a typical send job command:
@@ -54,6 +54,7 @@ cloudos_cli/utils/cloud.py
54
54
  cloudos_cli/utils/details.py
55
55
  cloudos_cli/utils/errors.py
56
56
  cloudos_cli/utils/last_wf.py
57
+ cloudos_cli/utils/nextflow_version.py
57
58
  cloudos_cli/utils/requests.py
58
59
  cloudos_cli/utils/resources.py
59
60
  cloudos_cli/workflows/__init__.py
@@ -62,6 +63,7 @@ tests/__init__.py
62
63
  tests/functions_for_pytest.py
63
64
  tests/test_cli_project_create.py
64
65
  tests/test_error_messages.py
66
+ tests/test_nextflow_version.py
65
67
  tests/test_cost/__init__.py
66
68
  tests/test_cost/test_job_cost.py
67
69
  tests/test_interactive_session/__init__.py
@@ -0,0 +1,177 @@
1
+ """Tests for Nextflow version resolution utilities."""
2
+
3
+ import pytest
4
+ import rich_click as click
5
+ from unittest.mock import patch
6
+ from cloudos_cli.utils.nextflow_version import resolve_nextflow_version
7
+ from cloudos_cli.constants import (
8
+ AWS_NEXTFLOW_LATEST,
9
+ AZURE_NEXTFLOW_LATEST,
10
+ HPC_NEXTFLOW_LATEST,
11
+ PLATFORM_WORKFLOW_NEXTFLOW_VERSION,
12
+ USER_WORKFLOW_NEXTFLOW_VERSION,
13
+ AWS_NEXTFLOW_VERSIONS
14
+ )
15
+
16
+
17
+ class TestResolveNextflowVersion:
18
+ """Test cases for resolve_nextflow_version function."""
19
+
20
+ def test_default_azure_version(self):
21
+ """Test that Azure always defaults to AZURE_NEXTFLOW_LATEST."""
22
+ result = resolve_nextflow_version(
23
+ nextflow_version=None,
24
+ execution_platform='azure',
25
+ is_module=False
26
+ )
27
+ assert result == AZURE_NEXTFLOW_LATEST
28
+
29
+ def test_default_hpc_version(self):
30
+ """Test that HPC always defaults to HPC_NEXTFLOW_LATEST."""
31
+ result = resolve_nextflow_version(
32
+ nextflow_version=None,
33
+ execution_platform='hpc',
34
+ is_module=False
35
+ )
36
+ assert result == HPC_NEXTFLOW_LATEST
37
+
38
+ def test_default_aws_platform_workflow(self):
39
+ """Test that AWS Platform workflows default to PLATFORM_WORKFLOW_NEXTFLOW_VERSION."""
40
+ result = resolve_nextflow_version(
41
+ nextflow_version=None,
42
+ execution_platform='aws',
43
+ is_module=True
44
+ )
45
+ assert result == PLATFORM_WORKFLOW_NEXTFLOW_VERSION
46
+
47
+ def test_default_aws_user_workflow(self):
48
+ """Test that AWS user-imported workflows default to USER_WORKFLOW_NEXTFLOW_VERSION."""
49
+ result = resolve_nextflow_version(
50
+ nextflow_version=None,
51
+ execution_platform='aws',
52
+ is_module=False
53
+ )
54
+ assert result == USER_WORKFLOW_NEXTFLOW_VERSION
55
+
56
+ def test_latest_resolution_aws(self):
57
+ """Test that 'latest' resolves to AWS_NEXTFLOW_LATEST."""
58
+ result = resolve_nextflow_version(
59
+ nextflow_version='latest',
60
+ execution_platform='aws',
61
+ is_module=False
62
+ )
63
+ assert result == AWS_NEXTFLOW_LATEST
64
+
65
+ def test_latest_resolution_azure(self):
66
+ """Test that 'latest' resolves to AZURE_NEXTFLOW_LATEST."""
67
+ result = resolve_nextflow_version(
68
+ nextflow_version='latest',
69
+ execution_platform='azure',
70
+ is_module=False
71
+ )
72
+ assert result == AZURE_NEXTFLOW_LATEST
73
+
74
+ def test_latest_resolution_hpc(self):
75
+ """Test that 'latest' resolves to HPC_NEXTFLOW_LATEST."""
76
+ result = resolve_nextflow_version(
77
+ nextflow_version='latest',
78
+ execution_platform='hpc',
79
+ is_module=False
80
+ )
81
+ assert result == HPC_NEXTFLOW_LATEST
82
+
83
+ def test_platform_workflow_forces_azure_version(self):
84
+ """Test that Platform workflows on Azure are forced to AZURE_NEXTFLOW_LATEST."""
85
+ result = resolve_nextflow_version(
86
+ nextflow_version='24.04.4', # User tries different version
87
+ execution_platform='azure',
88
+ is_module=True,
89
+ workflow_name='test-workflow'
90
+ )
91
+ assert result == AZURE_NEXTFLOW_LATEST
92
+
93
+ def test_platform_workflow_forces_aws_version(self):
94
+ """Test that Platform workflows on AWS are forced to PLATFORM_WORKFLOW_NEXTFLOW_VERSION."""
95
+ result = resolve_nextflow_version(
96
+ nextflow_version='24.04.4', # User tries different version
97
+ execution_platform='aws',
98
+ is_module=True,
99
+ workflow_name='test-workflow'
100
+ )
101
+ assert result == PLATFORM_WORKFLOW_NEXTFLOW_VERSION
102
+
103
+ def test_valid_aws_version_accepted(self):
104
+ """Test that valid AWS versions are accepted."""
105
+ for version in AWS_NEXTFLOW_VERSIONS:
106
+ result = resolve_nextflow_version(
107
+ nextflow_version=version,
108
+ execution_platform='aws',
109
+ is_module=False
110
+ )
111
+ assert result == version
112
+
113
+ def test_invalid_aws_version_raises_error(self):
114
+ """Test that invalid AWS version raises BadParameter."""
115
+ with pytest.raises(click.BadParameter, match='Unsupported Nextflow version'):
116
+ resolve_nextflow_version(
117
+ nextflow_version='99.99.99',
118
+ execution_platform='aws',
119
+ is_module=False
120
+ )
121
+
122
+ def test_invalid_hpc_version_raises_error(self):
123
+ """Test that invalid HPC version raises BadParameter."""
124
+ with pytest.raises(click.BadParameter, match='Unsupported Nextflow version'):
125
+ resolve_nextflow_version(
126
+ nextflow_version='24.04.4', # Not supported on HPC
127
+ execution_platform='hpc',
128
+ is_module=False
129
+ )
130
+
131
+ def test_azure_invalid_version_auto_corrects(self):
132
+ """Test that Azure auto-corrects invalid versions with warning."""
133
+ with patch('cloudos_cli.utils.nextflow_version.click.secho') as mock_secho:
134
+ result = resolve_nextflow_version(
135
+ nextflow_version='24.04.4', # Not supported on Azure
136
+ execution_platform='azure',
137
+ is_module=False
138
+ )
139
+ assert result == AZURE_NEXTFLOW_LATEST
140
+ # Verify warning was displayed
141
+ mock_secho.assert_called_once()
142
+ assert 'Warning' in mock_secho.call_args[0][0]
143
+
144
+ def test_verbose_output(self, capsys):
145
+ """Test that verbose flag produces output."""
146
+ resolve_nextflow_version(
147
+ nextflow_version=None,
148
+ execution_platform='aws',
149
+ is_module=True,
150
+ verbose=True
151
+ )
152
+ captured = capsys.readouterr()
153
+ assert 'Using default Nextflow version' in captured.out
154
+
155
+ def test_dsl2_warning_for_new_versions(self):
156
+ """Test that DSL2 warning is displayed for newer versions."""
157
+ with patch('cloudos_cli.utils.nextflow_version.click.secho') as mock_secho:
158
+ resolve_nextflow_version(
159
+ nextflow_version=USER_WORKFLOW_NEXTFLOW_VERSION,
160
+ execution_platform='aws',
161
+ is_module=False
162
+ )
163
+ # Should have warning about DSL2
164
+ mock_secho.assert_called_once()
165
+ assert 'DSL2' in mock_secho.call_args[0][0]
166
+
167
+ def test_no_dsl2_warning_for_legacy_versions(self):
168
+ """Test that no DSL2 warning for legacy versions."""
169
+ with patch('cloudos_cli.utils.nextflow_version.click.secho') as mock_secho:
170
+ resolve_nextflow_version(
171
+ nextflow_version=PLATFORM_WORKFLOW_NEXTFLOW_VERSION,
172
+ execution_platform='aws',
173
+ is_module=False
174
+ )
175
+ # Should not have any warnings
176
+ mock_secho.assert_not_called()
177
+
@@ -1 +0,0 @@
1
- __version__ = '2.87.1'
File without changes
File without changes
File without changes