cloudos-cli 2.59.0__tar.gz → 2.60.2__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.
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/PKG-INFO +1 -1
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/__main__.py +0 -1
- cloudos_cli-2.60.2/cloudos_cli/_version.py +1 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/clos.py +4 -2
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/jobs/job.py +20 -6
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/PKG-INFO +1 -1
- cloudos_cli-2.59.0/cloudos_cli/_version.py +0 -1
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/LICENSE +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/README.md +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/configure/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/configure/configure.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/datasets/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/datasets/datasets.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/import_wf/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/import_wf/import_wf.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/jobs/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/link/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/link/link.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/logging/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/logging/logger.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/procurement/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/procurement/images.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/queue/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/queue/queue.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/array_job.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/cloud.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/details.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/errors.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/last_wf.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/requests.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli/utils/resources.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/SOURCES.txt +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/dependency_links.txt +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/entry_points.txt +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/requires.txt +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/cloudos_cli.egg-info/top_level.txt +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/setup.cfg +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/setup.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/tests/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/tests/functions_for_pytest.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/tests/test_cli_project_create.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/tests/test_logging/__init__.py +0 -0
- {cloudos_cli-2.59.0 → cloudos_cli-2.60.2}/tests/test_logging/test_logger.py +0 -0
|
@@ -1707,7 +1707,6 @@ def clone_resume(ctx,
|
|
|
1707
1707
|
elif ctx.info_name == "resume":
|
|
1708
1708
|
mode, action = "resume", "resuming"
|
|
1709
1709
|
|
|
1710
|
-
f"""{mode.capitalize()} an existing job with optional parameter overrides."""
|
|
1711
1710
|
profile = profile or ctx.default_map['job'][mode]['profile']
|
|
1712
1711
|
|
|
1713
1712
|
# Create a dictionary with required and non-required params
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.60.2'
|
|
@@ -215,9 +215,11 @@ class Cloudos:
|
|
|
215
215
|
job_workspace = r_json["team"]
|
|
216
216
|
if job_workspace != workspace_id:
|
|
217
217
|
raise ValueError("Workspace provided or configured is different from workspace where the job was executed")
|
|
218
|
-
|
|
218
|
+
|
|
219
|
+
if "resumeWorkDir" not in r_json:
|
|
220
|
+
print("[Message]: Working directories are not available. This may be because the analysis was run without resumable mode enabled, or because intermediate results have since been removed.")
|
|
219
221
|
# Check if logs field exists, if not fall back to original folder-based approach
|
|
220
|
-
|
|
222
|
+
elif "logs" in r_json:
|
|
221
223
|
# Get workdir information from logs object using the same pattern as get_job_logs
|
|
222
224
|
logs_obj = r_json["logs"]
|
|
223
225
|
cloud_name, cloud_meta, cloud_storage = find_cloud(self.cloudos_url, self.apikey, workspace_id, logs_obj)
|
|
@@ -945,8 +945,10 @@ class Job(Cloudos):
|
|
|
945
945
|
}
|
|
946
946
|
url = f"{self.cloudos_url}/api/v1/jobs/{job_id}/request-payload?teamId={self.workspace_id}"
|
|
947
947
|
r = retry_requests_get(url, headers=headers, verify=verify)
|
|
948
|
+
|
|
948
949
|
if r.status_code >= 400:
|
|
949
950
|
raise BadRequestException(r)
|
|
951
|
+
|
|
950
952
|
return json.loads(r.content)
|
|
951
953
|
|
|
952
954
|
def update_parameter_value(self, parameters, param_name, new_value):
|
|
@@ -984,7 +986,7 @@ class Job(Cloudos):
|
|
|
984
986
|
return True
|
|
985
987
|
return False
|
|
986
988
|
|
|
987
|
-
def
|
|
989
|
+
def get_field_from_jobs_endpoint(self, job_id, field=None, verify=True):
|
|
988
990
|
"""Get the resume work directory id for a job.
|
|
989
991
|
|
|
990
992
|
Parameters
|
|
@@ -1009,7 +1011,10 @@ class Job(Cloudos):
|
|
|
1009
1011
|
r = retry_requests_get(url, headers=headers, verify=verify)
|
|
1010
1012
|
if r.status_code >= 400:
|
|
1011
1013
|
raise BadRequestException(r)
|
|
1012
|
-
|
|
1014
|
+
if field in json.loads(r.content).keys():
|
|
1015
|
+
return json.loads(r.content)[field]
|
|
1016
|
+
else:
|
|
1017
|
+
raise ValueError(f"Field '{field}' not found in endpoint 'jobs'.")
|
|
1013
1018
|
|
|
1014
1019
|
def clone_or_resume_job(self,
|
|
1015
1020
|
source_job_id,
|
|
@@ -1069,6 +1074,7 @@ class Job(Cloudos):
|
|
|
1069
1074
|
str
|
|
1070
1075
|
The CloudOS job ID of the cloned/resumed job.
|
|
1071
1076
|
"""
|
|
1077
|
+
|
|
1072
1078
|
# Get the original job payload
|
|
1073
1079
|
original_payload = self.get_job_request_payload(source_job_id, verify=verify)
|
|
1074
1080
|
|
|
@@ -1078,11 +1084,12 @@ class Job(Cloudos):
|
|
|
1078
1084
|
# remove unwanted fields
|
|
1079
1085
|
del cloned_payload['_id']
|
|
1080
1086
|
del cloned_payload['resourceId']
|
|
1087
|
+
|
|
1081
1088
|
if mode == "resume":
|
|
1082
1089
|
try:
|
|
1083
|
-
cloned_payload['resumeWorkDir'] = self.
|
|
1090
|
+
cloned_payload['resumeWorkDir'] = self.get_field_from_jobs_endpoint(source_job_id, field="resumeWorkDir", verify=verify)
|
|
1084
1091
|
except Exception as e:
|
|
1085
|
-
|
|
1092
|
+
raise ValueError(f"The job was not set as resumable when originally run")
|
|
1086
1093
|
|
|
1087
1094
|
# Override job name if provided
|
|
1088
1095
|
if job_name:
|
|
@@ -1108,9 +1115,10 @@ class Job(Cloudos):
|
|
|
1108
1115
|
print("[Message]: Azure workspace only uses Nextflow version 22.11.1-edge, option '--nextflow-version' is ignored.\n")
|
|
1109
1116
|
|
|
1110
1117
|
# Override branch if provided
|
|
1118
|
+
# sometimes revision is missing from the 'request-payload' API, make sure is present
|
|
1119
|
+
if 'revision' not in cloned_payload or not cloned_payload.get('revision'):
|
|
1120
|
+
cloned_payload['revision'] = self.get_field_from_jobs_endpoint(source_job_id, field="revision", verify=verify)
|
|
1111
1121
|
if branch:
|
|
1112
|
-
if 'revision' not in cloned_payload:
|
|
1113
|
-
cloned_payload['revision'] = {}
|
|
1114
1122
|
cloned_payload['revision']['revisionType'] = 'branch'
|
|
1115
1123
|
cloned_payload['revision']['branch'] = branch
|
|
1116
1124
|
# Clear other revision types
|
|
@@ -1137,6 +1145,11 @@ class Job(Cloudos):
|
|
|
1137
1145
|
elif resumable and mode == "resume":
|
|
1138
1146
|
print("[Message]: 'resumable' option is only applicable when resuming a job, ignoring '--resumable' flag.\n")
|
|
1139
1147
|
|
|
1148
|
+
if 'command' in cloned_payload:
|
|
1149
|
+
cloned_payload['batch'] = {"enabled": False}
|
|
1150
|
+
if resumable:
|
|
1151
|
+
print("[Message]: 'resumable' option is not applicable when resuming a bash job, ignoring '--resumable' flag.\n")
|
|
1152
|
+
|
|
1140
1153
|
# Handle job queue override
|
|
1141
1154
|
if queue_name:
|
|
1142
1155
|
if cloned_payload['executionPlatform'] != 'azure':
|
|
@@ -1188,6 +1201,7 @@ class Job(Cloudos):
|
|
|
1188
1201
|
"Content-type": "application/json",
|
|
1189
1202
|
"apikey": self.apikey
|
|
1190
1203
|
}
|
|
1204
|
+
|
|
1191
1205
|
r = retry_requests_post(f"{self.cloudos_url}/api/v2/jobs?teamId={self.workspace_id}",
|
|
1192
1206
|
data=json.dumps(cloned_payload),
|
|
1193
1207
|
headers=headers,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.59.0'
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|