cloudos-cli 2.81.0__tar.gz → 2.81.1__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 (70) hide show
  1. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/PKG-INFO +12 -2
  2. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/README.md +11 -1
  3. cloudos_cli-2.81.1/cloudos_cli/_version.py +1 -0
  4. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/clos.py +3 -3
  5. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/jobs/cli.py +2 -1
  6. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/jobs/job.py +52 -4
  7. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/PKG-INFO +12 -2
  8. cloudos_cli-2.81.0/cloudos_cli/_version.py +0 -1
  9. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/LICENSE +0 -0
  10. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/__init__.py +0 -0
  11. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/__main__.py +0 -0
  12. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/bash/__init__.py +0 -0
  13. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/bash/cli.py +0 -0
  14. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/configure/__init__.py +0 -0
  15. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/configure/cli.py +0 -0
  16. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/configure/configure.py +0 -0
  17. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/constants.py +0 -0
  18. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/cost/__init__.py +0 -0
  19. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/cost/cost.py +0 -0
  20. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/cromwell/__init__.py +0 -0
  21. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/cromwell/cli.py +0 -0
  22. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/datasets/__init__.py +0 -0
  23. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/datasets/cli.py +0 -0
  24. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/datasets/datasets.py +0 -0
  25. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/import_wf/__init__.py +0 -0
  26. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/import_wf/import_wf.py +0 -0
  27. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/jobs/__init__.py +0 -0
  28. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/link/__init__.py +0 -0
  29. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/link/cli.py +0 -0
  30. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/link/link.py +0 -0
  31. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/logging/__init__.py +0 -0
  32. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/logging/logger.py +0 -0
  33. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/procurement/__init__.py +0 -0
  34. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/procurement/cli.py +0 -0
  35. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/procurement/images.py +0 -0
  36. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/projects/__init__.py +0 -0
  37. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/projects/cli.py +0 -0
  38. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/queue/__init__.py +0 -0
  39. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/queue/cli.py +0 -0
  40. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/queue/queue.py +0 -0
  41. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/related_analyses/__init__.py +0 -0
  42. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/related_analyses/related_analyses.py +0 -0
  43. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/__init__.py +0 -0
  44. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/array_job.py +0 -0
  45. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/cli_helpers.py +0 -0
  46. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/cloud.py +0 -0
  47. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/details.py +0 -0
  48. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/errors.py +0 -0
  49. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/last_wf.py +0 -0
  50. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/requests.py +0 -0
  51. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/utils/resources.py +0 -0
  52. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/workflows/__init__.py +0 -0
  53. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli/workflows/cli.py +0 -0
  54. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/SOURCES.txt +0 -0
  55. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/dependency_links.txt +0 -0
  56. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/entry_points.txt +0 -0
  57. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/requires.txt +0 -0
  58. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/cloudos_cli.egg-info/top_level.txt +0 -0
  59. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/setup.cfg +0 -0
  60. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/setup.py +0 -0
  61. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/__init__.py +0 -0
  62. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/functions_for_pytest.py +0 -0
  63. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_cli_project_create.py +0 -0
  64. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_cost/__init__.py +0 -0
  65. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_cost/test_job_cost.py +0 -0
  66. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_error_messages.py +0 -0
  67. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_logging/__init__.py +0 -0
  68. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_logging/test_logger.py +0 -0
  69. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/tests/test_related_analyses/__init__.py +0 -0
  70. {cloudos_cli-2.81.0 → cloudos_cli-2.81.1}/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.81.0
3
+ Version: 2.81.1
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
@@ -554,6 +554,16 @@ cloudos job run \
554
554
  --resumable
555
555
  ```
556
556
 
557
+ Azure Blob example:
558
+
559
+ ```bash
560
+ cloudos job run \
561
+ --profile my_profile \
562
+ --workflow-name rnatoy \
563
+ --params-file az://6480f3db916489d248956a5f.blob.core.windows.net/cloudos-66607e71e8cffa9985592c10/dataset/697b7341c69bacdd8b0b700d/rnatoy_params.json \
564
+ --resumable
565
+ ```
566
+
557
567
  Example JSON params file:
558
568
 
559
569
  ```json
@@ -577,7 +587,7 @@ annot:
577
587
 
578
588
  > NOTE: options `--job-config`, `--parameter` and `--params-file` are completely compatible and complementary, so you can use a `--job-config` or `--params-file` and add additional parameters using `--parameter` in the same call.
579
589
 
580
- > NOTE: when using `--params-file`, the value must be an S3 URI or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
590
+ > NOTE: when using `--params-file`, the value must be an S3 URI, an Azure Blob URI (`az://<account>.blob.core.windows.net/<container>/<blob>`), or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
581
591
 
582
592
  If everything went well, you should see something like:
583
593
 
@@ -519,6 +519,16 @@ cloudos job run \
519
519
  --resumable
520
520
  ```
521
521
 
522
+ Azure Blob example:
523
+
524
+ ```bash
525
+ cloudos job run \
526
+ --profile my_profile \
527
+ --workflow-name rnatoy \
528
+ --params-file az://6480f3db916489d248956a5f.blob.core.windows.net/cloudos-66607e71e8cffa9985592c10/dataset/697b7341c69bacdd8b0b700d/rnatoy_params.json \
529
+ --resumable
530
+ ```
531
+
522
532
  Example JSON params file:
523
533
 
524
534
  ```json
@@ -542,7 +552,7 @@ annot:
542
552
 
543
553
  > NOTE: options `--job-config`, `--parameter` and `--params-file` are completely compatible and complementary, so you can use a `--job-config` or `--params-file` and add additional parameters using `--parameter` in the same call.
544
554
 
545
- > NOTE: when using `--params-file`, the value must be an S3 URI or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
555
+ > NOTE: when using `--params-file`, the value must be an S3 URI, an Azure Blob URI (`az://<account>.blob.core.windows.net/<container>/<blob>`), or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
546
556
 
547
557
  If everything went well, you should see something like:
548
558
 
@@ -0,0 +1 @@
1
+ __version__ = '2.81.1'
@@ -1236,7 +1236,7 @@ class Cloudos:
1236
1236
  if not queue_id:
1237
1237
  raise ValueError(f"Queue with name '{filter_queue}' not found in workspace '{workspace_id}'")
1238
1238
 
1239
- all_jobs = [job for job in all_jobs if job.get("batch", {}).get("jobQueue", {}).get("id") == queue_id]
1239
+ all_jobs = [job for job in all_jobs if job.get("batch", {}).get("jobQueue", {}) == queue_id]
1240
1240
  else:
1241
1241
  raise ValueError(f"The environment is not a batch environment so queues do not exist. Please remove the --filter-queue option.")
1242
1242
  except Exception as e:
@@ -1284,7 +1284,7 @@ class Cloudos:
1284
1284
  'nextflowVersion',
1285
1285
  'batch.enabled',
1286
1286
  'storageSizeInGb',
1287
- 'batch.jobQueue.id',
1287
+ 'batch.jobQueue',
1288
1288
  'usesFusionFileSystem'
1289
1289
  ]
1290
1290
  df_full = pd.json_normalize(r)
@@ -1416,7 +1416,7 @@ class Cloudos:
1416
1416
  "nextflowVersion": "Nextflow version",
1417
1417
  "batch.enabled": "Executor",
1418
1418
  "storageSizeInGb": "Storage size",
1419
- "batch.jobQueue.id": "Job queue ID",
1419
+ "batch.jobQueue": "Job queue ID",
1420
1420
  "usesFusionFileSystem": "Accelerated file staging"
1421
1421
  }
1422
1422
 
@@ -68,7 +68,8 @@ def job():
68
68
  help=('A file containing the parameters to pass to the job call. ' +
69
69
  'It should be a .json or .yaml file with a dictionary structure ' +
70
70
  'where keys are parameter names and values are parameter values. ' +
71
- 'This expects an S3 URI file path or a File Explorer relative path ' +
71
+ 'This expects an S3 URI, Azure Blob URI (az://<account>.blob.core.windows.net/<container>/<blob>) ' +
72
+ 'or a File Explorer relative path ' +
72
73
  '(e.g., Data/params_file.json) and does not work with local files.'))
73
74
  @click.option('-p',
74
75
  '--parameter',
@@ -11,6 +11,7 @@ from cloudos_cli.utils.requests import retry_requests_post, retry_requests_get,
11
11
  from pathlib import Path
12
12
  from urllib.parse import urlparse
13
13
  import base64
14
+ import re
14
15
  from cloudos_cli.utils.array_job import classify_pattern, get_file_or_folder_id, extract_project
15
16
  import os
16
17
  import click
@@ -183,11 +184,7 @@ class Job(Cloudos):
183
184
  if len(params_file) != 1:
184
185
  raise ValueError('Please, provide a single file for --params-file.')
185
186
  params_file = params_file[0]
186
-
187
- ext = os.path.splitext(params_file)[1].lower()
188
187
  allowed_ext = {'.json', '.yaml', '.yml'}
189
- if ext not in allowed_ext:
190
- raise ValueError('Please, provide a .json or .yaml file for --params-file.')
191
188
 
192
189
  if params_file.startswith('s3://'):
193
190
  parsed = urlparse(params_file)
@@ -196,6 +193,9 @@ class Job(Cloudos):
196
193
  if not bucket or not s3_key:
197
194
  raise ValueError('Invalid S3 URL. Please, provide a full s3://bucket/key path.')
198
195
  name = s3_key.rstrip('/').split('/')[-1]
196
+ ext = os.path.splitext(name)[1].lower()
197
+ if ext not in allowed_ext:
198
+ raise ValueError('Please, provide a .json or .yaml file for --params-file.')
199
199
  return {
200
200
  "parametersFile": {
201
201
  "dataItemEmbedded": {
@@ -209,9 +209,57 @@ class Job(Cloudos):
209
209
  }
210
210
  }
211
211
 
212
+ if params_file.startswith('az://'):
213
+ parsed = urlparse(params_file)
214
+ if parsed.query:
215
+ raise ValueError('Azure URL with query parameters is not supported for --params-file.')
216
+
217
+ host = parsed.netloc
218
+ if not host.endswith('.blob.core.windows.net'):
219
+ raise ValueError('Invalid Azure URL. Expected format: az://<account>.blob.core.windows.net/<container>/<blobName>')
220
+
221
+ blob_storage_account_name = host[:-len('.blob.core.windows.net')]
222
+ path_parts = parsed.path.lstrip('/').split('/', 1)
223
+ if len(path_parts) != 2:
224
+ raise ValueError('Invalid Azure URL. Expected format: az://<account>.blob.core.windows.net/<container>/<blobName>')
225
+
226
+ blob_container_name, blob_name = path_parts
227
+ blob_name = blob_name.rstrip('/')
228
+ if not blob_storage_account_name or not blob_container_name or not blob_name:
229
+ raise ValueError('Invalid Azure URL. Expected format: az://<account>.blob.core.windows.net/<container>/<blobName>')
230
+
231
+ blob_leaf = blob_name.split('/')[-1]
232
+ uuid_suffix_match = re.match(r'^(.*)_([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$', blob_leaf)
233
+ if uuid_suffix_match:
234
+ name = uuid_suffix_match.group(1)
235
+ else:
236
+ name = blob_leaf
237
+
238
+ ext = os.path.splitext(name)[1].lower()
239
+ if ext not in allowed_ext:
240
+ raise ValueError('Please, provide a .json or .yaml file for --params-file.')
241
+
242
+ return {
243
+ "parametersFile": {
244
+ "dataItemEmbedded": {
245
+ "data": {
246
+ "name": name,
247
+ "blobStorageAccountName": blob_storage_account_name,
248
+ "blobContainerName": blob_container_name,
249
+ "blobName": blob_name
250
+ },
251
+ "type": "AzureBlobFile"
252
+ }
253
+ }
254
+ }
255
+
212
256
  if not self.project_name:
213
257
  raise ValueError('Please, provide --project-name to resolve --params-file paths.')
214
258
 
259
+ ext = os.path.splitext(params_file)[1].lower()
260
+ if ext not in allowed_ext:
261
+ raise ValueError('Please, provide a .json or .yaml file for --params-file.')
262
+
215
263
  normalized_path = params_file.lstrip('/')
216
264
  allowed_prefixes = ('Data', 'Analyses Results', 'Cohorts')
217
265
  if not normalized_path.startswith(allowed_prefixes):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.81.0
3
+ Version: 2.81.1
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
@@ -554,6 +554,16 @@ cloudos job run \
554
554
  --resumable
555
555
  ```
556
556
 
557
+ Azure Blob example:
558
+
559
+ ```bash
560
+ cloudos job run \
561
+ --profile my_profile \
562
+ --workflow-name rnatoy \
563
+ --params-file az://6480f3db916489d248956a5f.blob.core.windows.net/cloudos-66607e71e8cffa9985592c10/dataset/697b7341c69bacdd8b0b700d/rnatoy_params.json \
564
+ --resumable
565
+ ```
566
+
557
567
  Example JSON params file:
558
568
 
559
569
  ```json
@@ -577,7 +587,7 @@ annot:
577
587
 
578
588
  > NOTE: options `--job-config`, `--parameter` and `--params-file` are completely compatible and complementary, so you can use a `--job-config` or `--params-file` and add additional parameters using `--parameter` in the same call.
579
589
 
580
- > NOTE: when using `--params-file`, the value must be an S3 URI or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
590
+ > NOTE: when using `--params-file`, the value must be an S3 URI, an Azure Blob URI (`az://<account>.blob.core.windows.net/<container>/<blob>`), or a File Explorer relative path (e.g., `Data/file.json`). Local file paths are not supported.
581
591
 
582
592
  If everything went well, you should see something like:
583
593
 
@@ -1 +0,0 @@
1
- __version__ = '2.81.0'
File without changes
File without changes
File without changes