cosmotech-acceleration-library 1.0.0__py3-none-any.whl → 1.1.0__py3-none-any.whl
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.
- cosmotech/coal/__init__.py +1 -1
- cosmotech/coal/azure/adx/runner.py +1 -3
- cosmotech/coal/cosmotech_api/__init__.py +10 -6
- cosmotech/coal/cosmotech_api/dataset/download/file.py +117 -104
- cosmotech/coal/cosmotech_api/dataset/download/twingraph.py +10 -13
- cosmotech/coal/cosmotech_api/dataset/upload.py +41 -0
- cosmotech/coal/cosmotech_api/runner/datasets.py +71 -19
- cosmotech/coal/cosmotech_api/runner/download.py +3 -14
- cosmotech/coal/postgresql/runner.py +3 -1
- cosmotech/coal/postgresql/store.py +3 -0
- cosmotech/coal/utils/decorator.py +25 -0
- cosmotech/coal/utils/semver.py +6 -0
- cosmotech/csm_data/commands/adx_send_data.py +7 -7
- cosmotech/csm_data/commands/adx_send_runnerdata.py +10 -10
- cosmotech/csm_data/commands/api/api.py +1 -1
- cosmotech/csm_data/commands/api/postgres_send_runner_metadata.py +23 -11
- cosmotech/csm_data/commands/api/rds_load_csv.py +8 -8
- cosmotech/csm_data/commands/api/rds_send_csv.py +6 -6
- cosmotech/csm_data/commands/api/rds_send_store.py +6 -6
- cosmotech/csm_data/commands/api/run_load_data.py +10 -10
- cosmotech/csm_data/commands/api/runtemplate_load_handler.py +5 -5
- cosmotech/csm_data/commands/api/tdl_load_files.py +6 -6
- cosmotech/csm_data/commands/api/tdl_send_files.py +7 -7
- cosmotech/csm_data/commands/api/wsf_load_file.py +10 -8
- cosmotech/csm_data/commands/api/wsf_send_file.py +10 -8
- cosmotech/csm_data/commands/az_storage_upload.py +6 -6
- cosmotech/csm_data/commands/s3_bucket_delete.py +8 -8
- cosmotech/csm_data/commands/s3_bucket_download.py +9 -9
- cosmotech/csm_data/commands/s3_bucket_upload.py +10 -10
- cosmotech/csm_data/commands/store/dump_to_azure.py +9 -9
- cosmotech/csm_data/commands/store/dump_to_postgresql.py +22 -10
- cosmotech/csm_data/commands/store/dump_to_s3.py +10 -10
- cosmotech/csm_data/commands/store/list_tables.py +3 -3
- cosmotech/csm_data/commands/store/load_csv_folder.py +3 -3
- cosmotech/csm_data/commands/store/load_from_singlestore.py +8 -8
- cosmotech/csm_data/commands/store/reset.py +2 -2
- cosmotech/csm_data/commands/store/store.py +1 -2
- cosmotech/csm_data/main.py +8 -6
- cosmotech/csm_data/utils/decorators.py +1 -1
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/api.yml +8 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/postgres_send_runner_metadata.yml +17 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_load_csv.yml +13 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_csv.yml +12 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_store.yml +12 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/run_load_data.yml +15 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/runtemplate_load_handler.yml +7 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_load_files.yml +14 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_send_files.yml +18 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_load_file.yml +10 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_send_file.yml +12 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/main.yml +9 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_data.yml +8 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_runnerdata.yml +15 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/az_storage_upload.yml +8 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_delete.yml +17 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_download.yml +18 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_upload.yml +21 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/storage/storage.yml +4 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_azure.yml +23 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_postgresql.yml +20 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_s3.yml +26 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/list_tables.yml +5 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_csv_folder.yml +5 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_from_singlestore.yml +16 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/reset.yml +4 -0
- cosmotech/translation/csm_data/en-US/csm_data/commands/store/store.yml +4 -0
- cosmotech/translation/csm_data/en-US/csm_data/commons/decorators.yml +2 -0
- cosmotech/translation/csm_data/en-US/csm_data/commons/version.yml +4 -0
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/METADATA +13 -14
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/RECORD +74 -44
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/WHEEL +1 -1
- cosmotech/coal/utils/api.py +0 -68
- cosmotech/translation/csm_data/en-US/csm-data.yml +0 -434
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/entry_points.txt +0 -0
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {cosmotech_acceleration_library-1.0.0.dist-info → cosmotech_acceleration_library-1.1.0.dist-info}/top_level.txt +0 -0
|
@@ -31,6 +31,7 @@ def dump_store_to_postgresql(
|
|
|
31
31
|
postgres_password: str,
|
|
32
32
|
table_prefix: str = "Cosmotech_",
|
|
33
33
|
replace: bool = True,
|
|
34
|
+
force_encode: bool = False,
|
|
34
35
|
) -> None:
|
|
35
36
|
"""
|
|
36
37
|
Dump Store data to a PostgreSQL database.
|
|
@@ -45,6 +46,7 @@ def dump_store_to_postgresql(
|
|
|
45
46
|
postgres_password: PostgreSQL password
|
|
46
47
|
table_prefix: Table prefix
|
|
47
48
|
replace: Whether to replace existing tables
|
|
49
|
+
force_encode: force password encoding
|
|
48
50
|
"""
|
|
49
51
|
_s = Store(store_location=store_folder)
|
|
50
52
|
|
|
@@ -72,6 +74,7 @@ def dump_store_to_postgresql(
|
|
|
72
74
|
postgres_user,
|
|
73
75
|
postgres_password,
|
|
74
76
|
replace,
|
|
77
|
+
force_encode,
|
|
75
78
|
)
|
|
76
79
|
total_rows += rows
|
|
77
80
|
_up_time = perf_counter()
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from functools import wraps
|
|
4
|
+
|
|
5
|
+
from cosmotech.coal.utils.logger import LOGGER
|
|
6
|
+
from cosmotech.orchestrator.utils.translate import T
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def timed(operation, debug=False):
|
|
10
|
+
def decorator(func):
|
|
11
|
+
@wraps(func)
|
|
12
|
+
def wrapper(*args, **kwargs):
|
|
13
|
+
process_start = time.time()
|
|
14
|
+
r = func(*args, **kwargs)
|
|
15
|
+
process_time = time.time() - process_start
|
|
16
|
+
msg = T("coal.common.timing.operation_completed").format(operation=operation, time=process_time)
|
|
17
|
+
if debug:
|
|
18
|
+
LOGGER.debug(msg)
|
|
19
|
+
else:
|
|
20
|
+
LOGGER.info(msg)
|
|
21
|
+
return r
|
|
22
|
+
|
|
23
|
+
return wrapper
|
|
24
|
+
|
|
25
|
+
return decorator
|
|
@@ -12,14 +12,14 @@ from cosmotech.csm_data.utils.decorators import web_help, translate_help
|
|
|
12
12
|
|
|
13
13
|
@click.command()
|
|
14
14
|
@web_help("csm-data/adx-send-data")
|
|
15
|
-
@translate_help("
|
|
15
|
+
@translate_help("csm_data.commands.storage.adx_send_data.description")
|
|
16
16
|
@click.option(
|
|
17
17
|
"--adx-uri",
|
|
18
18
|
envvar="AZURE_DATA_EXPLORER_RESOURCE_URI",
|
|
19
19
|
show_envvar=True,
|
|
20
20
|
required=True,
|
|
21
21
|
metavar="URI",
|
|
22
|
-
help=T("
|
|
22
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.adx_uri"),
|
|
23
23
|
)
|
|
24
24
|
@click.option(
|
|
25
25
|
"--adx-ingest-uri",
|
|
@@ -27,7 +27,7 @@ from cosmotech.csm_data.utils.decorators import web_help, translate_help
|
|
|
27
27
|
show_envvar=True,
|
|
28
28
|
required=True,
|
|
29
29
|
metavar="URI",
|
|
30
|
-
help=T("
|
|
30
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.adx_ingest_uri"),
|
|
31
31
|
)
|
|
32
32
|
@click.option(
|
|
33
33
|
"--database-name",
|
|
@@ -35,7 +35,7 @@ from cosmotech.csm_data.utils.decorators import web_help, translate_help
|
|
|
35
35
|
show_envvar=True,
|
|
36
36
|
required=True,
|
|
37
37
|
metavar="NAME",
|
|
38
|
-
help=T("
|
|
38
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.database_name"),
|
|
39
39
|
)
|
|
40
40
|
@click.option(
|
|
41
41
|
"--wait/--no-wait",
|
|
@@ -44,19 +44,19 @@ from cosmotech.csm_data.utils.decorators import web_help, translate_help
|
|
|
44
44
|
show_envvar=True,
|
|
45
45
|
default=False,
|
|
46
46
|
show_default=True,
|
|
47
|
-
help=T("
|
|
47
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.waiting_ingestion"),
|
|
48
48
|
)
|
|
49
49
|
@click.option(
|
|
50
50
|
"--tag",
|
|
51
51
|
envvar="CSM_DATA_ADX_TAG",
|
|
52
52
|
show_envvar=True,
|
|
53
53
|
default=None,
|
|
54
|
-
help=T("
|
|
54
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.adx_tag"),
|
|
55
55
|
)
|
|
56
56
|
@click.option(
|
|
57
57
|
"--store-folder",
|
|
58
58
|
envvar="CSM_PARAMETERS_ABSOLUTE_PATH",
|
|
59
|
-
help=T("
|
|
59
|
+
help=T("csm_data.commands.storage.adx_send_data.parameters.store_folder"),
|
|
60
60
|
metavar="PATH",
|
|
61
61
|
type=str,
|
|
62
62
|
show_envvar=True,
|
|
@@ -12,12 +12,12 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
12
12
|
|
|
13
13
|
@click.command()
|
|
14
14
|
@web_help("csm-data/adx-send-runner-data")
|
|
15
|
-
@translate_help("
|
|
15
|
+
@translate_help("csm_data.commands.storage.adx_send_runnerdata.description")
|
|
16
16
|
@click.option(
|
|
17
17
|
"--dataset-absolute-path",
|
|
18
18
|
envvar="CSM_DATASET_ABSOLUTE_PATH",
|
|
19
19
|
show_envvar=True,
|
|
20
|
-
help=T("
|
|
20
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.dataset_absolute_path"),
|
|
21
21
|
metavar="PATH",
|
|
22
22
|
required=True,
|
|
23
23
|
)
|
|
@@ -26,7 +26,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
26
26
|
envvar="CSM_PARAMETERS_ABSOLUTE_PATH",
|
|
27
27
|
metavar="PATH",
|
|
28
28
|
show_envvar=True,
|
|
29
|
-
help=T("
|
|
29
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.parameters_absolute_path"),
|
|
30
30
|
required=True,
|
|
31
31
|
)
|
|
32
32
|
@click.option(
|
|
@@ -35,7 +35,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
35
35
|
show_envvar=True,
|
|
36
36
|
required=True,
|
|
37
37
|
metavar="UUID",
|
|
38
|
-
help=T("
|
|
38
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.runner_id"),
|
|
39
39
|
)
|
|
40
40
|
@click.option(
|
|
41
41
|
"--adx-uri",
|
|
@@ -43,7 +43,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
43
43
|
show_envvar=True,
|
|
44
44
|
required=True,
|
|
45
45
|
metavar="URI",
|
|
46
|
-
help=T("
|
|
46
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.adx_uri"),
|
|
47
47
|
)
|
|
48
48
|
@click.option(
|
|
49
49
|
"--adx-ingest-uri",
|
|
@@ -51,7 +51,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
51
51
|
show_envvar=True,
|
|
52
52
|
required=True,
|
|
53
53
|
metavar="URI",
|
|
54
|
-
help=T("
|
|
54
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.adx_ingest_uri"),
|
|
55
55
|
)
|
|
56
56
|
@click.option(
|
|
57
57
|
"--database-name",
|
|
@@ -59,7 +59,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
59
59
|
show_envvar=True,
|
|
60
60
|
required=True,
|
|
61
61
|
metavar="NAME",
|
|
62
|
-
help=T("
|
|
62
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.database_name"),
|
|
63
63
|
)
|
|
64
64
|
@click.option(
|
|
65
65
|
"--send-parameters/--no-send-parameters",
|
|
@@ -68,7 +68,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
68
68
|
show_envvar=True,
|
|
69
69
|
default=False,
|
|
70
70
|
show_default=True,
|
|
71
|
-
help=T("
|
|
71
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.send_parameters"),
|
|
72
72
|
)
|
|
73
73
|
@click.option(
|
|
74
74
|
"--send-datasets/--no-send-datasets",
|
|
@@ -77,7 +77,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
77
77
|
show_envvar=True,
|
|
78
78
|
default=False,
|
|
79
79
|
show_default=True,
|
|
80
|
-
help=T("
|
|
80
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.send_datasets"),
|
|
81
81
|
)
|
|
82
82
|
@click.option(
|
|
83
83
|
"--wait/--no-wait",
|
|
@@ -85,7 +85,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
85
85
|
show_envvar=True,
|
|
86
86
|
default=False,
|
|
87
87
|
show_default=True,
|
|
88
|
-
help=T("
|
|
88
|
+
help=T("csm_data.commands.storage.adx_send_runnerdata.parameters.wait"),
|
|
89
89
|
)
|
|
90
90
|
def adx_send_runnerdata(
|
|
91
91
|
send_parameters: bool,
|
|
@@ -28,7 +28,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
28
28
|
@click.group(invoke_without_command=True)
|
|
29
29
|
@web_help("csm-data/api")
|
|
30
30
|
@click.pass_context
|
|
31
|
-
@translate_help("
|
|
31
|
+
@translate_help("csm_data.commands.api.api.description")
|
|
32
32
|
def api(ctx: click.Context):
|
|
33
33
|
if ctx.invoked_subcommand is None:
|
|
34
34
|
try:
|
|
@@ -12,11 +12,11 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
12
12
|
|
|
13
13
|
@click.command()
|
|
14
14
|
@web_help("csm-data/api/postgres-send-runner-metadata")
|
|
15
|
-
@translate_help("
|
|
15
|
+
@translate_help("csm_data.commands.api.postgres_send_runner_metadata.description")
|
|
16
16
|
@click.option(
|
|
17
17
|
"--organization-id",
|
|
18
18
|
envvar="CSM_ORGANIZATION_ID",
|
|
19
|
-
help=T("
|
|
19
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.organization_id"),
|
|
20
20
|
metavar="o-XXXXXXXX",
|
|
21
21
|
type=str,
|
|
22
22
|
show_envvar=True,
|
|
@@ -25,7 +25,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
25
25
|
@click.option(
|
|
26
26
|
"--workspace-id",
|
|
27
27
|
envvar="CSM_WORKSPACE_ID",
|
|
28
|
-
help=T("
|
|
28
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.workspace_id"),
|
|
29
29
|
metavar="w-XXXXXXXX",
|
|
30
30
|
type=str,
|
|
31
31
|
show_envvar=True,
|
|
@@ -34,7 +34,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
34
34
|
@click.option(
|
|
35
35
|
"--runner-id",
|
|
36
36
|
envvar="CSM_RUNNER_ID",
|
|
37
|
-
help=T("
|
|
37
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.runner_id"),
|
|
38
38
|
metavar="r-XXXXXXXX",
|
|
39
39
|
type=str,
|
|
40
40
|
show_envvar=True,
|
|
@@ -42,21 +42,21 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
42
42
|
)
|
|
43
43
|
@click.option(
|
|
44
44
|
"--table-prefix",
|
|
45
|
-
help=T("
|
|
45
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.table_prefix"),
|
|
46
46
|
metavar="PREFIX",
|
|
47
47
|
type=str,
|
|
48
48
|
default="Cosmotech_",
|
|
49
49
|
)
|
|
50
50
|
@click.option(
|
|
51
51
|
"--postgres-host",
|
|
52
|
-
help=T("
|
|
52
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_host"),
|
|
53
53
|
envvar="POSTGRES_HOST_URI",
|
|
54
54
|
show_envvar=True,
|
|
55
55
|
required=True,
|
|
56
56
|
)
|
|
57
57
|
@click.option(
|
|
58
58
|
"--postgres-port",
|
|
59
|
-
help=T("
|
|
59
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_port"),
|
|
60
60
|
envvar="POSTGRES_HOST_PORT",
|
|
61
61
|
show_envvar=True,
|
|
62
62
|
required=False,
|
|
@@ -64,32 +64,42 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
64
64
|
)
|
|
65
65
|
@click.option(
|
|
66
66
|
"--postgres-db",
|
|
67
|
-
help=T("
|
|
67
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_db"),
|
|
68
68
|
envvar="POSTGRES_DB_NAME",
|
|
69
69
|
show_envvar=True,
|
|
70
70
|
required=True,
|
|
71
71
|
)
|
|
72
72
|
@click.option(
|
|
73
73
|
"--postgres-schema",
|
|
74
|
-
help=T("
|
|
74
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_schema"),
|
|
75
75
|
envvar="POSTGRES_DB_SCHEMA",
|
|
76
76
|
show_envvar=True,
|
|
77
77
|
required=True,
|
|
78
78
|
)
|
|
79
79
|
@click.option(
|
|
80
80
|
"--postgres-user",
|
|
81
|
-
help=T("
|
|
81
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_user"),
|
|
82
82
|
envvar="POSTGRES_USER_NAME",
|
|
83
83
|
show_envvar=True,
|
|
84
84
|
required=True,
|
|
85
85
|
)
|
|
86
86
|
@click.option(
|
|
87
87
|
"--postgres-password",
|
|
88
|
-
help=T("
|
|
88
|
+
help=T("csm_data.commands.api.postgres_send_runner_metadata.parameters.postgres_password"),
|
|
89
89
|
envvar="POSTGRES_USER_PASSWORD",
|
|
90
90
|
show_envvar=True,
|
|
91
91
|
required=True,
|
|
92
92
|
)
|
|
93
|
+
@click.option(
|
|
94
|
+
"--encode-password/--no-encode-password",
|
|
95
|
+
"force_encode",
|
|
96
|
+
help=T("csm_data.commands.store.postgres_send_runner_metadata.parameters.encode_password"),
|
|
97
|
+
envvar="CSM_PSQL_FORCE_PASSWORD_ENCODING",
|
|
98
|
+
show_envvar=True,
|
|
99
|
+
default=True,
|
|
100
|
+
is_flag=True,
|
|
101
|
+
show_default=True,
|
|
102
|
+
)
|
|
93
103
|
def postgres_send_runner_metadata(
|
|
94
104
|
organization_id,
|
|
95
105
|
workspace_id,
|
|
@@ -101,6 +111,7 @@ def postgres_send_runner_metadata(
|
|
|
101
111
|
postgres_schema,
|
|
102
112
|
postgres_user,
|
|
103
113
|
postgres_password,
|
|
114
|
+
force_encode: bool,
|
|
104
115
|
):
|
|
105
116
|
# Import the function at the start of the command
|
|
106
117
|
from cosmotech.coal.postgresql import send_runner_metadata_to_postgresql
|
|
@@ -116,4 +127,5 @@ def postgres_send_runner_metadata(
|
|
|
116
127
|
postgres_schema=postgres_schema,
|
|
117
128
|
postgres_user=postgres_user,
|
|
118
129
|
postgres_password=postgres_password,
|
|
130
|
+
force_encode=force_encode,
|
|
119
131
|
)
|
|
@@ -14,7 +14,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
14
14
|
@click.option(
|
|
15
15
|
"--target-folder",
|
|
16
16
|
envvar="CSM_DATASET_ABSOLUTE_PATH",
|
|
17
|
-
help=T("
|
|
17
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.target_folder"),
|
|
18
18
|
metavar="PATH",
|
|
19
19
|
type=str,
|
|
20
20
|
show_envvar=True,
|
|
@@ -23,7 +23,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
23
23
|
@click.option(
|
|
24
24
|
"--organization-id",
|
|
25
25
|
envvar="CSM_ORGANIZATION_ID",
|
|
26
|
-
help=T("
|
|
26
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.organization_id"),
|
|
27
27
|
metavar="o-XXXXXXXX",
|
|
28
28
|
type=str,
|
|
29
29
|
show_envvar=True,
|
|
@@ -32,7 +32,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
32
32
|
@click.option(
|
|
33
33
|
"--workspace-id",
|
|
34
34
|
envvar="CSM_WORKSPACE_ID",
|
|
35
|
-
help=T("
|
|
35
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.workspace_id"),
|
|
36
36
|
metavar="w-XXXXXXXX",
|
|
37
37
|
type=str,
|
|
38
38
|
show_envvar=True,
|
|
@@ -41,7 +41,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
41
41
|
@click.option(
|
|
42
42
|
"--runner-id",
|
|
43
43
|
envvar="CSM_RUNNER_ID",
|
|
44
|
-
help=T("
|
|
44
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.runner_id"),
|
|
45
45
|
metavar="r-XXXXXXXX",
|
|
46
46
|
type=str,
|
|
47
47
|
show_envvar=True,
|
|
@@ -50,7 +50,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
50
50
|
@click.option(
|
|
51
51
|
"--run-id",
|
|
52
52
|
envvar="CSM_RUN_ID",
|
|
53
|
-
help=T("
|
|
53
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.run_id"),
|
|
54
54
|
metavar="run-XXXXXX",
|
|
55
55
|
type=str,
|
|
56
56
|
show_envvar=True,
|
|
@@ -58,7 +58,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
58
58
|
)
|
|
59
59
|
@click.option(
|
|
60
60
|
"--file-name",
|
|
61
|
-
help=T("
|
|
61
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.file_name"),
|
|
62
62
|
metavar="NAME",
|
|
63
63
|
type=str,
|
|
64
64
|
default="results",
|
|
@@ -67,14 +67,14 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
67
67
|
)
|
|
68
68
|
@click.option(
|
|
69
69
|
"--query",
|
|
70
|
-
help=T("
|
|
70
|
+
help=T("csm_data.commands.api.rds_load_csv.parameters.query"),
|
|
71
71
|
metavar="SQL_QUERY",
|
|
72
72
|
type=str,
|
|
73
73
|
default="SELECT table_name FROM information_schema.tables WHERE table_schema='public'",
|
|
74
74
|
show_default=True,
|
|
75
75
|
)
|
|
76
76
|
@web_help("csm-data/api/rds-load-csv")
|
|
77
|
-
@translate_help("
|
|
77
|
+
@translate_help("csm_data.commands.api.rds_load_csv.description")
|
|
78
78
|
def rds_load_csv(target_folder, organization_id, workspace_id, runner_id, run_id, file_name, query):
|
|
79
79
|
# Import the function at the start of the command
|
|
80
80
|
from cosmotech.coal.cosmotech_api import load_csv_from_run_data
|
|
@@ -14,7 +14,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
14
14
|
@click.option(
|
|
15
15
|
"--source-folder",
|
|
16
16
|
envvar="CSM_DATASET_ABSOLUTE_PATH",
|
|
17
|
-
help=T("
|
|
17
|
+
help=T("csm_data.commands.api.rds_send_csv.parameters.source_folder"),
|
|
18
18
|
metavar="PATH",
|
|
19
19
|
type=str,
|
|
20
20
|
show_envvar=True,
|
|
@@ -23,7 +23,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
23
23
|
@click.option(
|
|
24
24
|
"--organization-id",
|
|
25
25
|
envvar="CSM_ORGANIZATION_ID",
|
|
26
|
-
help=T("
|
|
26
|
+
help=T("csm_data.commands.api.rds_send_csv.parameters.organization_id"),
|
|
27
27
|
metavar="o-XXXXXXXX",
|
|
28
28
|
type=str,
|
|
29
29
|
show_envvar=True,
|
|
@@ -32,7 +32,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
32
32
|
@click.option(
|
|
33
33
|
"--workspace-id",
|
|
34
34
|
envvar="CSM_WORKSPACE_ID",
|
|
35
|
-
help=T("
|
|
35
|
+
help=T("csm_data.commands.api.rds_send_csv.parameters.workspace_id"),
|
|
36
36
|
metavar="w-XXXXXXXX",
|
|
37
37
|
type=str,
|
|
38
38
|
show_envvar=True,
|
|
@@ -41,7 +41,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
41
41
|
@click.option(
|
|
42
42
|
"--runner-id",
|
|
43
43
|
envvar="CSM_RUNNER_ID",
|
|
44
|
-
help=T("
|
|
44
|
+
help=T("csm_data.commands.api.rds_send_csv.parameters.runner_id"),
|
|
45
45
|
metavar="r-XXXXXXXX",
|
|
46
46
|
type=str,
|
|
47
47
|
show_envvar=True,
|
|
@@ -50,14 +50,14 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
50
50
|
@click.option(
|
|
51
51
|
"--run-id",
|
|
52
52
|
envvar="CSM_RUN_ID",
|
|
53
|
-
help=T("
|
|
53
|
+
help=T("csm_data.commands.api.rds_send_csv.parameters.run_id"),
|
|
54
54
|
metavar="run-XXXXXX",
|
|
55
55
|
type=str,
|
|
56
56
|
show_envvar=True,
|
|
57
57
|
required=True,
|
|
58
58
|
)
|
|
59
59
|
@web_help("csm-data/api/rds-send-csv")
|
|
60
|
-
@translate_help("
|
|
60
|
+
@translate_help("csm_data.commands.api.rds_send_csv.description")
|
|
61
61
|
def rds_send_csv(source_folder, organization_id, workspace_id, runner_id, run_id):
|
|
62
62
|
# Import the function at the start of the command
|
|
63
63
|
from cosmotech.coal.cosmotech_api import send_csv_to_run_data
|
|
@@ -14,7 +14,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
14
14
|
@click.option(
|
|
15
15
|
"--store-folder",
|
|
16
16
|
envvar="CSM_PARAMETERS_ABSOLUTE_PATH",
|
|
17
|
-
help=T("
|
|
17
|
+
help=T("csm_data.commands.api.rds_send_store.parameters.store_folder"),
|
|
18
18
|
metavar="PATH",
|
|
19
19
|
type=str,
|
|
20
20
|
show_envvar=True,
|
|
@@ -23,7 +23,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
23
23
|
@click.option(
|
|
24
24
|
"--organization-id",
|
|
25
25
|
envvar="CSM_ORGANIZATION_ID",
|
|
26
|
-
help=T("
|
|
26
|
+
help=T("csm_data.commands.api.rds_send_store.parameters.organization_id"),
|
|
27
27
|
metavar="o-XXXXXXXX",
|
|
28
28
|
type=str,
|
|
29
29
|
show_envvar=True,
|
|
@@ -32,7 +32,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
32
32
|
@click.option(
|
|
33
33
|
"--workspace-id",
|
|
34
34
|
envvar="CSM_WORKSPACE_ID",
|
|
35
|
-
help=T("
|
|
35
|
+
help=T("csm_data.commands.api.rds_send_store.parameters.workspace_id"),
|
|
36
36
|
metavar="w-XXXXXXXX",
|
|
37
37
|
type=str,
|
|
38
38
|
show_envvar=True,
|
|
@@ -41,7 +41,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
41
41
|
@click.option(
|
|
42
42
|
"--runner-id",
|
|
43
43
|
envvar="CSM_RUNNER_ID",
|
|
44
|
-
help=T("
|
|
44
|
+
help=T("csm_data.commands.api.rds_send_store.parameters.runner_id"),
|
|
45
45
|
metavar="r-XXXXXXXX",
|
|
46
46
|
type=str,
|
|
47
47
|
show_envvar=True,
|
|
@@ -50,14 +50,14 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
50
50
|
@click.option(
|
|
51
51
|
"--run-id",
|
|
52
52
|
envvar="CSM_RUN_ID",
|
|
53
|
-
help=T("
|
|
53
|
+
help=T("csm_data.commands.api.rds_send_store.parameters.run_id"),
|
|
54
54
|
metavar="run-XXXXXX",
|
|
55
55
|
type=str,
|
|
56
56
|
show_envvar=True,
|
|
57
57
|
required=True,
|
|
58
58
|
)
|
|
59
59
|
@web_help("csm-data/api/rds-send-store")
|
|
60
|
-
@translate_help("
|
|
60
|
+
@translate_help("csm_data.commands.api.rds_send_store.description")
|
|
61
61
|
def rds_send_store(store_folder, organization_id, workspace_id, runner_id, run_id):
|
|
62
62
|
# Import the function at the start of the command
|
|
63
63
|
from cosmotech.coal.cosmotech_api import send_store_to_run_data
|
|
@@ -16,7 +16,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
16
16
|
"--organization-id",
|
|
17
17
|
envvar="CSM_ORGANIZATION_ID",
|
|
18
18
|
show_envvar=True,
|
|
19
|
-
help=T("
|
|
19
|
+
help=T("csm_data.commands.api.run_load_data.parameters.organization_id"),
|
|
20
20
|
metavar="o-##########",
|
|
21
21
|
required=True,
|
|
22
22
|
)
|
|
@@ -24,7 +24,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
24
24
|
"--workspace-id",
|
|
25
25
|
envvar="CSM_WORKSPACE_ID",
|
|
26
26
|
show_envvar=True,
|
|
27
|
-
help=T("
|
|
27
|
+
help=T("csm_data.commands.api.run_load_data.parameters.workspace_id"),
|
|
28
28
|
metavar="w-##########",
|
|
29
29
|
required=True,
|
|
30
30
|
)
|
|
@@ -32,7 +32,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
32
32
|
"--runner-id",
|
|
33
33
|
envvar="CSM_RUNNER_ID",
|
|
34
34
|
show_envvar=True,
|
|
35
|
-
help=T("
|
|
35
|
+
help=T("csm_data.commands.api.run_load_data.parameters.runner_id"),
|
|
36
36
|
metavar="s-##########",
|
|
37
37
|
required=True,
|
|
38
38
|
)
|
|
@@ -40,7 +40,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
40
40
|
"--dataset-absolute-path",
|
|
41
41
|
envvar="CSM_DATASET_ABSOLUTE_PATH",
|
|
42
42
|
show_envvar=True,
|
|
43
|
-
help=T("
|
|
43
|
+
help=T("csm_data.commands.api.run_load_data.parameters.dataset_absolute_path"),
|
|
44
44
|
metavar="PATH",
|
|
45
45
|
required=True,
|
|
46
46
|
)
|
|
@@ -49,7 +49,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
49
49
|
envvar="CSM_PARAMETERS_ABSOLUTE_PATH",
|
|
50
50
|
metavar="PATH",
|
|
51
51
|
show_envvar=True,
|
|
52
|
-
help=T("
|
|
52
|
+
help=T("csm_data.commands.api.run_load_data.parameters.parameters_absolute_path"),
|
|
53
53
|
required=True,
|
|
54
54
|
)
|
|
55
55
|
@click.option(
|
|
@@ -58,7 +58,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
58
58
|
show_envvar=True,
|
|
59
59
|
default=True,
|
|
60
60
|
show_default=True,
|
|
61
|
-
help=T("
|
|
61
|
+
help=T("csm_data.commands.api.run_load_data.parameters.write_json"),
|
|
62
62
|
)
|
|
63
63
|
@click.option(
|
|
64
64
|
"--write-csv/--no-write-csv",
|
|
@@ -66,7 +66,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
66
66
|
show_envvar=True,
|
|
67
67
|
default=False,
|
|
68
68
|
show_default=True,
|
|
69
|
-
help=T("
|
|
69
|
+
help=T("csm_data.commands.api.run_load_data.parameters.write_csv"),
|
|
70
70
|
)
|
|
71
71
|
@click.option(
|
|
72
72
|
"--fetch-dataset/--no-fetch-dataset",
|
|
@@ -74,7 +74,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
74
74
|
show_envvar=True,
|
|
75
75
|
default=True,
|
|
76
76
|
show_default=True,
|
|
77
|
-
help=T("
|
|
77
|
+
help=T("csm_data.commands.api.run_load_data.parameters.fetch_dataset"),
|
|
78
78
|
)
|
|
79
79
|
@click.option(
|
|
80
80
|
"--parallel/--no-parallel",
|
|
@@ -82,12 +82,12 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
82
82
|
show_envvar=True,
|
|
83
83
|
default=True,
|
|
84
84
|
show_default=True,
|
|
85
|
-
help=T("
|
|
85
|
+
help=T("csm_data.commands.api.run_load_data.parameters.parallel"),
|
|
86
86
|
)
|
|
87
87
|
@require_env("CSM_API_SCOPE", "The identification scope of a Cosmotech API")
|
|
88
88
|
@require_env("CSM_API_URL", "The URL to a Cosmotech API")
|
|
89
89
|
@web_help("csm-data/api/run-load-data")
|
|
90
|
-
@translate_help("
|
|
90
|
+
@translate_help("csm_data.commands.api.run_load_data.description")
|
|
91
91
|
def run_load_data(
|
|
92
92
|
runner_id: str,
|
|
93
93
|
workspace_id: str,
|
|
@@ -12,12 +12,12 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
12
12
|
|
|
13
13
|
@click.command()
|
|
14
14
|
@web_help("csm-data/api/runtemplate-load-handler")
|
|
15
|
-
@translate_help("
|
|
15
|
+
@translate_help("csm_data.commands.api.runtemplate_load_handler.description")
|
|
16
16
|
@click.option(
|
|
17
17
|
"--organization-id",
|
|
18
18
|
envvar="CSM_ORGANIZATION_ID",
|
|
19
19
|
show_envvar=True,
|
|
20
|
-
help=T("
|
|
20
|
+
help=T("csm_data.commands.api.runtemplate_load_handler.parameters.organization_id"),
|
|
21
21
|
metavar="o-##########",
|
|
22
22
|
required=True,
|
|
23
23
|
)
|
|
@@ -25,7 +25,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
25
25
|
"--workspace-id",
|
|
26
26
|
envvar="CSM_WORKSPACE_ID",
|
|
27
27
|
show_envvar=True,
|
|
28
|
-
help=T("
|
|
28
|
+
help=T("csm_data.commands.api.runtemplate_load_handler.parameters.workspace_id"),
|
|
29
29
|
metavar="w-##########",
|
|
30
30
|
required=True,
|
|
31
31
|
)
|
|
@@ -33,7 +33,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
33
33
|
"--run-template-id",
|
|
34
34
|
envvar="CSM_RUN_TEMPLATE_ID",
|
|
35
35
|
show_envvar=True,
|
|
36
|
-
help=T("
|
|
36
|
+
help=T("csm_data.commands.api.runtemplate_load_handler.parameters.run_template_id"),
|
|
37
37
|
metavar="NAME",
|
|
38
38
|
required=True,
|
|
39
39
|
)
|
|
@@ -41,7 +41,7 @@ from cosmotech.orchestrator.utils.translate import T
|
|
|
41
41
|
"--handler-list",
|
|
42
42
|
envvar="CSM_CONTAINER_MODE",
|
|
43
43
|
show_envvar=True,
|
|
44
|
-
help=T("
|
|
44
|
+
help=T("csm_data.commands.api.runtemplate_load_handler.parameters.handler_list"),
|
|
45
45
|
metavar="HANDLER,...,HANDLER",
|
|
46
46
|
required=True,
|
|
47
47
|
)
|