terralab-cli 3.2.5__tar.gz → 3.2.7__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.
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/PKG-INFO +2 -2
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/pyproject.toml +2 -2
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/pipeline_runs_commands.py +27 -3
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/pipelines_commands.py +1 -1
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/constants.py +1 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/pipeline_runs_logic.py +13 -5
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/LICENSE +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/README.md +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/.terralab-cli-config +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/__init__.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/auth_helper.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/cli.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/client.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/__init__.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/account_commands.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/auth_commands.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/commands/quotas_commands.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/config.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/log.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/__init__.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/account_logic.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/auth_logic.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/pipelines_logic.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/logic/quotas_logic.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/sam_helper.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/utils.py +0 -0
- {terralab_cli-3.2.5 → terralab_cli-3.2.7}/terralab/version_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: terralab-cli
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.7
|
|
4
4
|
Summary: Command line interface for interacting with the Terra Scientific Pipelines Service, or Teaspoons.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Terra Scientific Services
|
|
@@ -20,7 +20,7 @@ Requires-Dist: prompt-toolkit (>=3.0.51,<4.0.0)
|
|
|
20
20
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
21
21
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
22
22
|
Requires-Dist: tabulate (>=0.9,<0.11)
|
|
23
|
-
Requires-Dist: terra-scientific-pipelines-service-api-client (==
|
|
23
|
+
Requires-Dist: terra-scientific-pipelines-service-api-client (==4.0.0)
|
|
24
24
|
Requires-Dist: tqdm (>=4.67.0,<5.0.0)
|
|
25
25
|
Requires-Dist: tzlocal (>=5.2,<6.0)
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "terralab-cli"
|
|
3
3
|
# version is auto-incremented. do not edit.
|
|
4
|
-
version = "3.2.
|
|
4
|
+
version = "3.2.7"
|
|
5
5
|
description = "Command line interface for interacting with the Terra Scientific Pipelines Service, or Teaspoons."
|
|
6
6
|
authors = ["Terra Scientific Services <teaspoons-developers@broadinstitute.org>"]
|
|
7
7
|
readme = "README.md"
|
|
@@ -14,7 +14,7 @@ terralab = "terralab.cli:cli"
|
|
|
14
14
|
|
|
15
15
|
[tool.poetry.dependencies]
|
|
16
16
|
python = "^3.12"
|
|
17
|
-
terra-scientific-pipelines-service-api-client = "
|
|
17
|
+
terra-scientific-pipelines-service-api-client = "4.0.0"
|
|
18
18
|
python-dotenv = "^1.0.1"
|
|
19
19
|
click = "^8.1.7"
|
|
20
20
|
colorlog = "^6.9.0"
|
|
@@ -7,7 +7,12 @@ import uuid
|
|
|
7
7
|
import click
|
|
8
8
|
from teaspoons_client import AsyncPipelineRunResponseV2, DataDeliveryReport, PipelineRun # type: ignore[attr-defined]
|
|
9
9
|
|
|
10
|
-
from terralab.constants import
|
|
10
|
+
from terralab.constants import (
|
|
11
|
+
FAILED_KEY,
|
|
12
|
+
SUPPORT_EMAIL_TEXT,
|
|
13
|
+
SUCCEEDED_KEY,
|
|
14
|
+
TERMS_OF_SERVICE_URL,
|
|
15
|
+
)
|
|
11
16
|
from terralab.log import (
|
|
12
17
|
indented,
|
|
13
18
|
add_blankline_before,
|
|
@@ -38,10 +43,21 @@ LOGGER = logging.getLogger(__name__)
|
|
|
38
43
|
@click.option(
|
|
39
44
|
"--description", type=str, default="", help="optional description for the job"
|
|
40
45
|
)
|
|
46
|
+
@click.option(
|
|
47
|
+
"agree_to_terms",
|
|
48
|
+
"--agreeToTerms",
|
|
49
|
+
is_flag=True,
|
|
50
|
+
help=f"Agree to the terms of service ({TERMS_OF_SERVICE_URL}). This is required to run a pipeline.",
|
|
51
|
+
prompt=f"Please agree to the terms of service ({TERMS_OF_SERVICE_URL}) to run a pipeline. Do you agree?",
|
|
52
|
+
)
|
|
41
53
|
@click.argument("inputs", nargs=-1, type=click.UNPROCESSED)
|
|
42
54
|
@handle_api_exceptions
|
|
43
55
|
def submit(
|
|
44
|
-
pipeline_name: str,
|
|
56
|
+
pipeline_name: str,
|
|
57
|
+
version: int,
|
|
58
|
+
inputs: tuple[str, ...],
|
|
59
|
+
description: str,
|
|
60
|
+
agree_to_terms: bool,
|
|
45
61
|
) -> None:
|
|
46
62
|
"""Submit a job for a PIPELINE_NAME pipeline
|
|
47
63
|
|
|
@@ -54,8 +70,16 @@ def submit(
|
|
|
54
70
|
# validate inputs
|
|
55
71
|
pipelines_logic.validate_pipeline_inputs(pipeline_name, version, inputs_dict)
|
|
56
72
|
|
|
73
|
+
if not agree_to_terms:
|
|
74
|
+
LOGGER.error(
|
|
75
|
+
add_blankline_before(
|
|
76
|
+
"You must agree to the terms of service to run a pipeline. Use the --agreeToTerms flag to indicate your agreement."
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
exit(1)
|
|
80
|
+
|
|
57
81
|
submitted_job_id = pipeline_runs_logic.prepare_upload_start_pipeline_run(
|
|
58
|
-
pipeline_name, version, inputs_dict, description
|
|
82
|
+
pipeline_name, version, inputs_dict, description, agree_to_terms
|
|
59
83
|
)
|
|
60
84
|
|
|
61
85
|
LOGGER.info(f"Successfully started {pipeline_name} job {submitted_job_id}")
|
|
@@ -109,6 +109,6 @@ def details(pipeline_name: str, version: int) -> None:
|
|
|
109
109
|
inputs_string_for_usage = " ".join(inputs_for_usage)
|
|
110
110
|
LOGGER.info(
|
|
111
111
|
add_blankline_before(
|
|
112
|
-
f"{pad_column('Example usage', 20)}terralab submit {pipeline_info.pipeline_name} {inputs_string_for_usage} --description 'YOUR JOB DESCRIPTION HERE'"
|
|
112
|
+
f"{pad_column('Example usage', 20)}terralab submit {pipeline_info.pipeline_name} {inputs_string_for_usage} --description 'YOUR JOB DESCRIPTION HERE' --agreeToTerms"
|
|
113
113
|
)
|
|
114
114
|
)
|
|
@@ -20,3 +20,4 @@ MAX_FILE_UPLOAD_SIZE_BYTES = 50 * 1025 * 1024 * 1024 # 50GB
|
|
|
20
20
|
# support text
|
|
21
21
|
SUPPORT_EMAIL = "scientific-services-support@broadinstitute.org"
|
|
22
22
|
SUPPORT_EMAIL_TEXT = f"For help troubleshooting, email {SUPPORT_EMAIL}"
|
|
23
|
+
TERMS_OF_SERVICE_URL = "https://services.terra.bio/#pipelines/terms-of-service"
|
|
@@ -11,7 +11,7 @@ from teaspoons_client import ( # type: ignore[attr-defined]
|
|
|
11
11
|
PipelineRun,
|
|
12
12
|
PipelineRunOutputSignedUrlsResponse,
|
|
13
13
|
PipelineRunsApi,
|
|
14
|
-
|
|
14
|
+
PreparePipelineRunRequestBodyV2,
|
|
15
15
|
PreparePipelineRunResponseV2,
|
|
16
16
|
StartDataDeliveryRequestBody,
|
|
17
17
|
StartPipelineRunRequestBody,
|
|
@@ -37,24 +37,26 @@ def prepare_pipeline_run(
|
|
|
37
37
|
pipeline_version: int,
|
|
38
38
|
pipeline_inputs: dict[str, Any],
|
|
39
39
|
description: str,
|
|
40
|
+
agree_to_terms: bool,
|
|
40
41
|
) -> dict[str, str] | None:
|
|
41
42
|
"""Call the preparePipelineRunV2 Teaspoons endpoint.
|
|
42
43
|
Return a dictionary of {input_name: signed_url} if inputs are local, else (cloud inputs) return None.
|
|
43
44
|
"""
|
|
44
|
-
prepare_pipeline_run_request_body:
|
|
45
|
-
|
|
45
|
+
prepare_pipeline_run_request_body: PreparePipelineRunRequestBodyV2 = (
|
|
46
|
+
PreparePipelineRunRequestBodyV2(
|
|
46
47
|
jobId=job_id,
|
|
47
48
|
pipelineName=pipeline_name,
|
|
48
49
|
pipelineVersion=pipeline_version,
|
|
49
50
|
pipelineInputs=pipeline_inputs,
|
|
50
51
|
description=description,
|
|
52
|
+
agreeToTerms=agree_to_terms,
|
|
51
53
|
)
|
|
52
54
|
)
|
|
53
55
|
|
|
54
56
|
with ClientWrapper() as api_client:
|
|
55
57
|
pipeline_runs_client = PipelineRunsApi(api_client=api_client)
|
|
56
58
|
response: PreparePipelineRunResponseV2 = (
|
|
57
|
-
pipeline_runs_client.
|
|
59
|
+
pipeline_runs_client.prepare_pipeline_run_v3(
|
|
58
60
|
prepare_pipeline_run_request_body
|
|
59
61
|
)
|
|
60
62
|
)
|
|
@@ -143,6 +145,7 @@ def prepare_upload_start_pipeline_run(
|
|
|
143
145
|
pipeline_version: int,
|
|
144
146
|
pipeline_inputs: dict[str, Any],
|
|
145
147
|
description: str,
|
|
148
|
+
agree_to_terms: bool,
|
|
146
149
|
) -> str:
|
|
147
150
|
"""Prepare pipeline run, upload input files if input files are local, and start pipeline run.
|
|
148
151
|
Returns the uuid of the job."""
|
|
@@ -151,7 +154,12 @@ def prepare_upload_start_pipeline_run(
|
|
|
151
154
|
LOGGER.info(f"Generated job_id {job_id}")
|
|
152
155
|
|
|
153
156
|
file_input_upload_urls: dict[str, str] | None = prepare_pipeline_run(
|
|
154
|
-
pipeline_name,
|
|
157
|
+
pipeline_name,
|
|
158
|
+
job_id,
|
|
159
|
+
pipeline_version,
|
|
160
|
+
pipeline_inputs,
|
|
161
|
+
description,
|
|
162
|
+
agree_to_terms,
|
|
155
163
|
)
|
|
156
164
|
|
|
157
165
|
if file_input_upload_urls:
|
|
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
|