@orcabus/platform-cdk-constructs 0.0.81 → 0.0.83
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.
- package/.jsii +2 -2
- package/api-gateway/api-gateway.js +1 -1
- package/deployment-stack-pipeline/artifact-bucket.js +1 -1
- package/deployment-stack-pipeline/pipeline.js +1 -1
- package/dynamodb/index.js +2 -2
- package/ecs/index.js +1 -1
- package/eventbridge-rules/sfn-slack-notification.js +1 -1
- package/lambda/index.js +1 -1
- package/lambda/layers/icav2_tools/poetry.lock +32 -4
- package/lambda/layers/icav2_tools/pyproject.toml +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/__init__.py +4 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/file_helpers.py +50 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/sequence/__init__.py +6 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/sequence/sequence_helpers.py +26 -10
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/workflow/__init__.py +12 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/workflow/globals.py +1 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/workflow/models.py +16 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/workflow/query_helpers.py +20 -3
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/workflow/workflow_helpers.py +96 -0
- package/monitored-queue/index.js +1 -1
- package/named-lambda-role/index.js +1 -1
- package/package.json +1 -1
- package/provider-function/index.js +1 -1
- package/shared-config/networking.js +2 -2
- package/shared-config/slack.js +1 -1
package/.jsii
CHANGED
|
@@ -7163,6 +7163,6 @@
|
|
|
7163
7163
|
"symbolId": "shared-config/slack:SlackAlerts"
|
|
7164
7164
|
}
|
|
7165
7165
|
},
|
|
7166
|
-
"version": "0.0.
|
|
7167
|
-
"fingerprint": "
|
|
7166
|
+
"version": "0.0.83",
|
|
7167
|
+
"fingerprint": "cBorX/V0vcQyZ8HyLFWS3v/XSgUCce1nBpM6Nb51OzM="
|
|
7168
7168
|
}
|
|
@@ -15,7 +15,7 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
|
15
15
|
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
16
16
|
const config_1 = require("./config");
|
|
17
17
|
class OrcaBusApiGateway extends constructs_1.Construct {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.83" };
|
|
19
19
|
/**
|
|
20
20
|
* The AWS region where the API Gateway is deployed.
|
|
21
21
|
*/
|
|
@@ -13,7 +13,7 @@ exports.CROSS_DEPLOYMENT_ARTIFACT_BUCKET_NAME = "orcabus-cross-deployment-codepi
|
|
|
13
13
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ALIAS = "orcabus-cross-deployment-codepipeline-artifact";
|
|
14
14
|
exports.CROSS_DEPLOYMENT_ARTIFACT_KMS_ARN_SSM_PARAMETER_NAME = "/orcabus/deployment-stack-pipeline/artifact-bucket/kms-key-arn";
|
|
15
15
|
class CrossDeploymentArtifactBucket extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.83" };
|
|
17
17
|
/**
|
|
18
18
|
* The S3 bucket used to store artifacts for cross-deployment pipelines.
|
|
19
19
|
*/
|
|
@@ -32,7 +32,7 @@ exports.DEFAULT_SYNTH_STEP_PARTIAL_BUILD_SPEC = {
|
|
|
32
32
|
* before using this construct.
|
|
33
33
|
*/
|
|
34
34
|
class DeploymentStackPipeline extends constructs_1.Construct {
|
|
35
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.
|
|
35
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.83" };
|
|
36
36
|
/**
|
|
37
37
|
* The code pipeline construct that is created.
|
|
38
38
|
*/
|
package/dynamodb/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const dynamodb = __importStar(require("aws-cdk-lib/aws-dynamodb"));
|
|
|
40
40
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
41
41
|
const config_1 = require("./config");
|
|
42
42
|
class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
43
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.
|
|
43
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.83" };
|
|
44
44
|
table;
|
|
45
45
|
constructor(scope, id, props) {
|
|
46
46
|
super(scope, id);
|
|
@@ -75,7 +75,7 @@ class DynamoDbPartitionedConstruct extends constructs_1.Construct {
|
|
|
75
75
|
}
|
|
76
76
|
exports.DynamoDbPartitionedConstruct = DynamoDbPartitionedConstruct;
|
|
77
77
|
class DynamoDbNonPartitionedConstruct extends constructs_1.Construct {
|
|
78
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.
|
|
78
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.83" };
|
|
79
79
|
table;
|
|
80
80
|
constructor(scope, id, props) {
|
|
81
81
|
super(scope, id);
|
package/ecs/index.js
CHANGED
|
@@ -55,7 +55,7 @@ exports.LAMBDA_ARCHITECTURE_MAP = {
|
|
|
55
55
|
['ARM64']: lambda.Architecture.ARM_64
|
|
56
56
|
};
|
|
57
57
|
class EcsFargateTaskConstruct extends constructs_1.Construct {
|
|
58
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.
|
|
58
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.83" };
|
|
59
59
|
cluster;
|
|
60
60
|
taskDefinition;
|
|
61
61
|
taskExecutionRole;
|
|
@@ -17,7 +17,7 @@ var SfnEventStatus;
|
|
|
17
17
|
SfnEventStatus["ABORTED"] = "ABORTED";
|
|
18
18
|
})(SfnEventStatus || (exports.SfnEventStatus = SfnEventStatus = {}));
|
|
19
19
|
class SfnSlackNotification extends constructs_1.Construct {
|
|
20
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.
|
|
20
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.83" };
|
|
21
21
|
rule;
|
|
22
22
|
constructor(scope, id, props) {
|
|
23
23
|
super(scope, id);
|
package/lambda/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function getPythonUvDockerImage() {
|
|
|
57
57
|
return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
|
|
58
58
|
}
|
|
59
59
|
class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
|
|
60
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.
|
|
60
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.83" };
|
|
61
61
|
// Class constructs, to be used for caching the layers
|
|
62
62
|
// This means that if there are multiple lambdas throughout the stack
|
|
63
63
|
// They will all use the same layer
|
|
@@ -35,6 +35,21 @@ charset-normalizer = ["charset-normalizer"]
|
|
|
35
35
|
html5lib = ["html5lib"]
|
|
36
36
|
lxml = ["lxml"]
|
|
37
37
|
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "binaryornot"
|
|
40
|
+
version = "0.4.4"
|
|
41
|
+
description = "Ultra-lightweight pure Python package to check if a file is binary or text."
|
|
42
|
+
optional = false
|
|
43
|
+
python-versions = "*"
|
|
44
|
+
groups = ["main"]
|
|
45
|
+
files = [
|
|
46
|
+
{file = "binaryornot-0.4.4-py2.py3-none-any.whl", hash = "sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4"},
|
|
47
|
+
{file = "binaryornot-0.4.4.tar.gz", hash = "sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061"},
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[package.dependencies]
|
|
51
|
+
chardet = ">=3.0.2"
|
|
52
|
+
|
|
38
53
|
[[package]]
|
|
39
54
|
name = "cachecontrol"
|
|
40
55
|
version = "0.14.3"
|
|
@@ -69,6 +84,18 @@ files = [
|
|
|
69
84
|
{file = "certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407"},
|
|
70
85
|
]
|
|
71
86
|
|
|
87
|
+
[[package]]
|
|
88
|
+
name = "chardet"
|
|
89
|
+
version = "5.2.0"
|
|
90
|
+
description = "Universal encoding detector for Python 3"
|
|
91
|
+
optional = false
|
|
92
|
+
python-versions = ">=3.7"
|
|
93
|
+
groups = ["main"]
|
|
94
|
+
files = [
|
|
95
|
+
{file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"},
|
|
96
|
+
{file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"},
|
|
97
|
+
]
|
|
98
|
+
|
|
72
99
|
[[package]]
|
|
73
100
|
name = "charset-normalizer"
|
|
74
101
|
version = "3.4.3"
|
|
@@ -1106,18 +1133,19 @@ test = ["websockets"]
|
|
|
1106
1133
|
|
|
1107
1134
|
[[package]]
|
|
1108
1135
|
name = "wrapica"
|
|
1109
|
-
version = "2.
|
|
1136
|
+
version = "2.40.0.dev20251004172048"
|
|
1110
1137
|
description = "Secondary level functions for ICAv2 based off libica"
|
|
1111
1138
|
optional = false
|
|
1112
1139
|
python-versions = "<3.15,>=3.12"
|
|
1113
1140
|
groups = ["main"]
|
|
1114
1141
|
files = [
|
|
1115
|
-
{file = "wrapica-2.
|
|
1116
|
-
{file = "wrapica-2.
|
|
1142
|
+
{file = "wrapica-2.40.0.dev20251004172048-py3-none-any.whl", hash = "sha256:7fd0e310c1ddacee1f95116e25f9ca9a525e7da26482d95254a75f6fcb4d298a"},
|
|
1143
|
+
{file = "wrapica-2.40.0.dev20251004172048.tar.gz", hash = "sha256:8b22c2a5adce4223a0dd9617d7429b4b5a358762c965de12ffe10a64a7e1fdbe"},
|
|
1117
1144
|
]
|
|
1118
1145
|
|
|
1119
1146
|
[package.dependencies]
|
|
1120
1147
|
beautifulsoup4 = ">=4.10.0,<5"
|
|
1148
|
+
binaryornot = ">=0.4.4,<1"
|
|
1121
1149
|
cwl_utils = ">=0.38,<1"
|
|
1122
1150
|
libica = ">=3.1,<4"
|
|
1123
1151
|
pandas = ">=2.2.2,<3"
|
|
@@ -1141,4 +1169,4 @@ reference = "testpypi"
|
|
|
1141
1169
|
[metadata]
|
|
1142
1170
|
lock-version = "2.1"
|
|
1143
1171
|
python-versions = ">3.12,<3.15"
|
|
1144
|
-
content-hash = "
|
|
1172
|
+
content-hash = "55ea852aa096b4680a2300e64d3b9333cf62dd5b6ed2f2ed02dc76e7370acf9e"
|
|
@@ -56,6 +56,8 @@ from .file_helpers import (
|
|
|
56
56
|
get_file_object_from_id,
|
|
57
57
|
get_file_object_from_ingest_id,
|
|
58
58
|
list_files_from_portal_run_id,
|
|
59
|
+
list_output_files_from_portal_run_id,
|
|
60
|
+
get_portal_run_id_root_prefix,
|
|
59
61
|
get_presigned_url,
|
|
60
62
|
get_s3_object_id_from_s3_uri,
|
|
61
63
|
get_s3_uri_from_s3_object_id,
|
|
@@ -80,6 +82,8 @@ __all__ = [
|
|
|
80
82
|
"get_file_object_from_id",
|
|
81
83
|
"get_file_object_from_ingest_id",
|
|
82
84
|
"list_files_from_portal_run_id",
|
|
85
|
+
"list_output_files_from_portal_run_id",
|
|
86
|
+
"get_portal_run_id_root_prefix",
|
|
83
87
|
"get_presigned_url",
|
|
84
88
|
"get_s3_object_id_from_s3_uri",
|
|
85
89
|
"get_s3_uri_from_s3_object_id",
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
import json
|
|
5
5
|
from functools import reduce
|
|
6
6
|
from operator import concat
|
|
7
|
+
from pathlib import Path
|
|
7
8
|
from typing import List, Dict, Union
|
|
8
9
|
import typing
|
|
9
10
|
import boto3
|
|
10
11
|
from datetime import datetime, timedelta, timezone
|
|
11
|
-
from urllib.parse import urlparse, unquote
|
|
12
|
+
from urllib.parse import urlparse, unquote, urlunparse
|
|
12
13
|
from itertools import batched
|
|
13
14
|
|
|
14
15
|
# Local imports
|
|
@@ -126,11 +127,58 @@ def list_files_from_portal_run_id(
|
|
|
126
127
|
return all_files_list
|
|
127
128
|
|
|
128
129
|
return list(filter(
|
|
129
|
-
lambda file_iter_: not
|
|
130
|
+
lambda file_iter_: not (
|
|
131
|
+
f"logs/{portal_run_id}/" in file_iter_['key'] or
|
|
132
|
+
f"cache/{portal_run_id}/" in file_iter_['key']
|
|
133
|
+
),
|
|
130
134
|
all_files_list
|
|
131
135
|
))
|
|
132
136
|
|
|
133
137
|
|
|
138
|
+
def list_output_files_from_portal_run_id(
|
|
139
|
+
portal_run_id: str
|
|
140
|
+
) -> List[FileObject]:
|
|
141
|
+
return list(filter(
|
|
142
|
+
lambda file_iter_: not (
|
|
143
|
+
f"cache/{portal_run_id}/" in file_iter_['key']
|
|
144
|
+
),
|
|
145
|
+
list_files_from_portal_run_id(
|
|
146
|
+
portal_run_id=portal_run_id,
|
|
147
|
+
remove_log_files=True
|
|
148
|
+
)
|
|
149
|
+
))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def get_portal_run_id_root_prefix(portal_run_id: str) -> str:
|
|
153
|
+
# Get portal run id midfix from portal_run_id
|
|
154
|
+
all_portal_run_id_files = list_output_files_from_portal_run_id(
|
|
155
|
+
portal_run_id
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Sort by most recent output
|
|
159
|
+
all_portal_run_id_files.sort(
|
|
160
|
+
key=lambda file_iter_: datetime.fromisoformat(file_iter_['eventTime']).timestamp(),
|
|
161
|
+
reverse=True
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
if len(all_portal_run_id_files) == 0:
|
|
165
|
+
raise ValueError(f"No files found for portal run id {portal_run_id}")
|
|
166
|
+
|
|
167
|
+
portal_run_id_analysis_file = all_portal_run_id_files[0]
|
|
168
|
+
|
|
169
|
+
# Get root for the portal run id
|
|
170
|
+
parts_list = []
|
|
171
|
+
for idx, part in enumerate(Path(portal_run_id_analysis_file['key']).parts):
|
|
172
|
+
if part == portal_run_id:
|
|
173
|
+
parts_list.append(part)
|
|
174
|
+
break
|
|
175
|
+
else:
|
|
176
|
+
parts_list.append(part)
|
|
177
|
+
return str(urlunparse((
|
|
178
|
+
"s3", portal_run_id_analysis_file['bucket'], str("/".join(parts_list)), None, None, None
|
|
179
|
+
)))
|
|
180
|
+
|
|
181
|
+
|
|
134
182
|
def get_presigned_url(s3_object_id: str) -> str:
|
|
135
183
|
"""
|
|
136
184
|
Get presigned url
|
|
@@ -42,9 +42,11 @@ def get_sequence_request_response_results(
|
|
|
42
42
|
|
|
43
43
|
from .sequence_helpers import (
|
|
44
44
|
get_sequence_object_from_instrument_run_id,
|
|
45
|
-
|
|
45
|
+
get_library_id_list_in_sequence,
|
|
46
|
+
get_library_id_list_from_instrument_run_id,
|
|
47
|
+
get_libraries_from_instrument_run_id, # Deprecated
|
|
46
48
|
get_sample_sheet_from_orcabus_id,
|
|
47
|
-
get_library_ids_in_sequence,
|
|
49
|
+
get_library_ids_in_sequence, # Deprecated
|
|
48
50
|
get_sample_sheet_from_instrument_run_id
|
|
49
51
|
)
|
|
50
52
|
|
|
@@ -54,6 +56,8 @@ __all__ = [
|
|
|
54
56
|
"get_sample_sheet_from_orcabus_id",
|
|
55
57
|
"get_library_ids_in_sequence",
|
|
56
58
|
"get_sample_sheet_from_instrument_run_id",
|
|
59
|
+
"get_library_id_list_in_sequence",
|
|
60
|
+
"get_library_id_list_from_instrument_run_id",
|
|
57
61
|
]
|
|
58
62
|
|
|
59
63
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
|
|
2
|
+
import warnings
|
|
3
3
|
# Standard imports
|
|
4
4
|
from typing import Optional, cast, List
|
|
5
5
|
import logging
|
|
@@ -31,7 +31,7 @@ def get_sample_sheet_from_instrument_run_id(instrument_run_id: str) -> Optional[
|
|
|
31
31
|
return cast(SampleSheet, samplesheet_dict_list[-1])
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def
|
|
34
|
+
def get_library_id_list_from_instrument_run_id(instrument_run_id: str) -> List[str]:
|
|
35
35
|
"""
|
|
36
36
|
Get the sequence run object
|
|
37
37
|
:param instrument_run_id:
|
|
@@ -45,7 +45,30 @@ def get_libraries_from_instrument_run_id(instrument_run_id: str) -> List[str]:
|
|
|
45
45
|
logging.warning("Could not find sequence run for instrument run id: %s", instrument_run_id)
|
|
46
46
|
return []
|
|
47
47
|
|
|
48
|
-
return sequence_run_object.get('libraries', [])
|
|
48
|
+
return list(set(sequence_run_object.get('libraries', [])))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def get_library_id_list_in_sequence(sequence_orcabus_id: str) -> List[str]:
|
|
52
|
+
"""
|
|
53
|
+
Get the library ids in the sequence run.
|
|
54
|
+
:param sequence_orcabus_id:
|
|
55
|
+
:return:
|
|
56
|
+
"""
|
|
57
|
+
return list(set(get_sequence_request(endpoint=f"{SEQUENCE_RUN_ENDPOINT}/{sequence_orcabus_id}").get('libraries', [])))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_library_ids_in_sequence(sequence_orcabus_id: str) -> List[str]:
|
|
61
|
+
warnings.warn(DeprecationWarning(
|
|
62
|
+
"get_library_ids_in_sequence is deprecated. Use get_library_id_list_in_sequence instead."
|
|
63
|
+
))
|
|
64
|
+
return get_library_id_list_in_sequence(sequence_orcabus_id=sequence_orcabus_id)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def get_libraries_from_instrument_run_id(instrument_run_id: str) -> List[str]:
|
|
68
|
+
warnings.warn(DeprecationWarning(
|
|
69
|
+
"get_libraries_from_instrument_run_id is deprecated. Use get_library_id_list_from_instrument_run_id instead."
|
|
70
|
+
))
|
|
71
|
+
return get_library_id_list_from_instrument_run_id(instrument_run_id=instrument_run_id)
|
|
49
72
|
|
|
50
73
|
|
|
51
74
|
def get_sequence_object_from_instrument_run_id(instrument_run_id: str) -> Optional[Sequence]:
|
|
@@ -92,10 +115,3 @@ def get_sample_sheet_from_orcabus_id(sequence_orcabus_id: str) -> SampleSheet:
|
|
|
92
115
|
)
|
|
93
116
|
|
|
94
117
|
|
|
95
|
-
def get_library_ids_in_sequence(sequence_orcabus_id: str) -> List[str]:
|
|
96
|
-
"""
|
|
97
|
-
Get the library ids in the sequence run.
|
|
98
|
-
:param sequence_orcabus_id:
|
|
99
|
-
:return:
|
|
100
|
-
"""
|
|
101
|
-
return get_sequence_request(endpoint=f"{SEQUENCE_RUN_ENDPOINT}/{sequence_orcabus_id}").get('libraries', [])
|
|
@@ -45,6 +45,12 @@ from .metadata_helpers import (
|
|
|
45
45
|
from .query_helpers import (
|
|
46
46
|
get_workflow_by_workflow_name,
|
|
47
47
|
get_workflows_from_analysis_run_id,
|
|
48
|
+
list_workflow_runs_by_workflow_name,
|
|
49
|
+
list_workflow_runs_from_analysis_run_id,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
from .workflow_helpers import (
|
|
53
|
+
list_workflows,
|
|
48
54
|
)
|
|
49
55
|
|
|
50
56
|
from .payload_helpers import (
|
|
@@ -70,13 +76,19 @@ __all__ = [
|
|
|
70
76
|
"get_workflows_from_library_id",
|
|
71
77
|
"get_workflows_from_library_id_list",
|
|
72
78
|
# Query
|
|
79
|
+
# Deprecated
|
|
73
80
|
"get_workflow_by_workflow_name",
|
|
74
81
|
"get_workflows_from_analysis_run_id",
|
|
82
|
+
# New
|
|
83
|
+
"list_workflow_runs_by_workflow_name",
|
|
84
|
+
"list_workflow_runs_from_analysis_run_id",
|
|
75
85
|
# Payload
|
|
76
86
|
"get_payload",
|
|
77
87
|
"get_payload_from_state_orcabus_id",
|
|
78
88
|
"get_latest_payload_from_workflow_run",
|
|
79
89
|
"get_latest_payload_from_portal_run_id",
|
|
90
|
+
# Workflow
|
|
91
|
+
"list_workflows",
|
|
80
92
|
# Workflow Run
|
|
81
93
|
"get_workflow_run",
|
|
82
94
|
"get_workflow_run_from_portal_run_id",
|
|
@@ -53,6 +53,22 @@ ContextUseCaseType = Literal[
|
|
|
53
53
|
'STORAGE',
|
|
54
54
|
]
|
|
55
55
|
|
|
56
|
+
ExecutionEngineType = Literal[
|
|
57
|
+
'Unknown',
|
|
58
|
+
'ICA',
|
|
59
|
+
'SEQERA',
|
|
60
|
+
'AWS_BATCH',
|
|
61
|
+
'AWS_ECS',
|
|
62
|
+
'AWS_EKS',
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
ValidationStateType = Literal[
|
|
66
|
+
'UNVALIDATED',
|
|
67
|
+
'VALIDATED',
|
|
68
|
+
'DEPRECATED',
|
|
69
|
+
'FAILED',
|
|
70
|
+
]
|
|
71
|
+
|
|
56
72
|
# Classes
|
|
57
73
|
class StateDetail(TypedDict):
|
|
58
74
|
orcabusId: str
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Get workflows from library id
|
|
5
5
|
"""
|
|
6
|
-
|
|
7
6
|
# Standard imports
|
|
7
|
+
import warnings
|
|
8
8
|
from typing import List
|
|
9
9
|
|
|
10
10
|
# Local imports
|
|
@@ -13,7 +13,7 @@ from .globals import WORKFLOW_RUN_ENDPOINT
|
|
|
13
13
|
from .models import WorkflowRunDetail
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def
|
|
16
|
+
def list_workflow_runs_from_analysis_run_id(analysis_run_id: str) -> List[WorkflowRunDetail]:
|
|
17
17
|
"""
|
|
18
18
|
Use the query analysisRuns__analysisRunId to get workflows from an analysis run id
|
|
19
19
|
:param analysis_run_id:
|
|
@@ -27,7 +27,7 @@ def get_workflows_from_analysis_run_id(analysis_run_id: str) -> List[WorkflowRun
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def
|
|
30
|
+
def list_workflow_runs_by_workflow_name(
|
|
31
31
|
workflow_name: str,
|
|
32
32
|
) -> List[WorkflowRunDetail]:
|
|
33
33
|
"""
|
|
@@ -42,3 +42,20 @@ def get_workflow_by_workflow_name(
|
|
|
42
42
|
"workflow__name": workflow_name
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Deprecated
|
|
48
|
+
def get_workflow_by_workflow_name(workflow_name: str) -> List[WorkflowRunDetail]:
|
|
49
|
+
warnings.warn(DeprecationWarning(
|
|
50
|
+
"This function is deprecated, "
|
|
51
|
+
"please use list_workflow_runs_by_workflow_name instead"
|
|
52
|
+
))
|
|
53
|
+
return list_workflow_runs_by_workflow_name(workflow_name)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def get_workflows_from_analysis_run_id(analysis_run_id: str) -> List[WorkflowRunDetail]:
|
|
57
|
+
warnings.warn(DeprecationWarning(
|
|
58
|
+
"This function is deprecated, "
|
|
59
|
+
"please use list_workflow_runs_from_analysis_run_id instead"
|
|
60
|
+
))
|
|
61
|
+
return list_workflow_runs_from_analysis_run_id(analysis_run_id)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Get the workflow object
|
|
5
|
+
"""
|
|
6
|
+
from typing import Optional, List, cast
|
|
7
|
+
|
|
8
|
+
from . import get_workflow_request_response_results
|
|
9
|
+
from .globals import WORKFLOW_ENDPOINT
|
|
10
|
+
from .models import Workflow, ExecutionEngineType, ValidationStateType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _convert_workflow(workflow_dict: dict) -> Workflow:
|
|
14
|
+
"""
|
|
15
|
+
Convert a workflow dictionary to a Workflow object
|
|
16
|
+
:param workflow_dict:
|
|
17
|
+
:return:
|
|
18
|
+
"""
|
|
19
|
+
workflow_dict = workflow_dict.copy()
|
|
20
|
+
if "workflowName" in workflow_dict:
|
|
21
|
+
workflow_dict["name"] = workflow_dict.pop("workflowName")
|
|
22
|
+
if "workflowVersion" in workflow_dict:
|
|
23
|
+
workflow_dict["version"] = workflow_dict.pop("workflowVersion")
|
|
24
|
+
|
|
25
|
+
return cast(Workflow, workflow_dict)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def list_workflows(
|
|
29
|
+
workflow_name: str,
|
|
30
|
+
workflow_version: Optional[str] = None,
|
|
31
|
+
code_version: Optional[str] = None,
|
|
32
|
+
execution_engine: Optional[ExecutionEngineType] = None,
|
|
33
|
+
execution_engine_pipeline_id: Optional[str] = None,
|
|
34
|
+
validation_state: Optional[ValidationStateType] = None,
|
|
35
|
+
) -> List[Workflow]:
|
|
36
|
+
"""
|
|
37
|
+
List workflow objects matching the provided filters.
|
|
38
|
+
:param workflow_name: The name of the workflow to filter by.
|
|
39
|
+
:param workflow_version: (Optional) The version of the workflow to filter by.
|
|
40
|
+
:param code_version: (Optional) The code version to filter by.
|
|
41
|
+
:param execution_engine: (Optional) The execution engine type to filter by.
|
|
42
|
+
:param execution_engine_pipeline_id: (Optional) The execution engine pipeline ID to filter by. Only used if execution_engine is specified.
|
|
43
|
+
:param validation_state: (Optional) The validation state to filter by.
|
|
44
|
+
:return: A list of Workflow objects matching the provided filters.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
# List all workflows
|
|
48
|
+
workflows_list = get_workflow_request_response_results(
|
|
49
|
+
WORKFLOW_ENDPOINT,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# For each workflow, check if workflowName / name or workflowVersion / version matches
|
|
53
|
+
workflows_list = list(filter(
|
|
54
|
+
lambda workflow_iter: workflow_iter.get("workflowName", workflow_iter.get("name")) == workflow_name,
|
|
55
|
+
workflows_list
|
|
56
|
+
))
|
|
57
|
+
|
|
58
|
+
if workflow_version:
|
|
59
|
+
workflows_list = list(filter(
|
|
60
|
+
lambda workflow_iter: workflow_iter.get("workflowVersion", workflow_iter.get("version")) == workflow_version,
|
|
61
|
+
workflows_list
|
|
62
|
+
))
|
|
63
|
+
|
|
64
|
+
if code_version:
|
|
65
|
+
workflows_list = list(filter(
|
|
66
|
+
lambda workflow_iter: workflow_iter.get("codeVersion", None) == code_version,
|
|
67
|
+
workflows_list
|
|
68
|
+
))
|
|
69
|
+
|
|
70
|
+
if execution_engine:
|
|
71
|
+
workflows_list = list(filter(
|
|
72
|
+
lambda workflow_iter: workflow_iter.get("executionEngine", None) == execution_engine,
|
|
73
|
+
workflows_list
|
|
74
|
+
))
|
|
75
|
+
|
|
76
|
+
# Might as well nest this, need to filter by execution engine first
|
|
77
|
+
if execution_engine_pipeline_id:
|
|
78
|
+
workflows_list = list(filter(
|
|
79
|
+
lambda workflow_iter: workflow_iter.get("executionEnginePipelineId", None) == execution_engine_pipeline_id,
|
|
80
|
+
workflows_list
|
|
81
|
+
))
|
|
82
|
+
|
|
83
|
+
if validation_state:
|
|
84
|
+
workflows_list = list(filter(
|
|
85
|
+
lambda workflow_iter: workflow_iter.get("validationState", None) == validation_state,
|
|
86
|
+
workflows_list
|
|
87
|
+
))
|
|
88
|
+
|
|
89
|
+
# Convert to Workflow objects
|
|
90
|
+
# This means converting workflowName to name and workflowVersion to version
|
|
91
|
+
workflows_list: List[Workflow] = list(map(
|
|
92
|
+
lambda workflow_iter: _convert_workflow(workflow_iter),
|
|
93
|
+
workflows_list
|
|
94
|
+
))
|
|
95
|
+
|
|
96
|
+
return workflows_list
|
package/monitored-queue/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const aws_cloudwatch_actions_1 = require("aws-cdk-lib/aws-cloudwatch-actions");
|
|
|
13
13
|
* SNS topic.
|
|
14
14
|
*/
|
|
15
15
|
class MonitoredQueue extends constructs_1.Construct {
|
|
16
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.
|
|
16
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.83" };
|
|
17
17
|
queue;
|
|
18
18
|
deadLetterQueue;
|
|
19
19
|
alarm;
|
|
@@ -7,7 +7,7 @@ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
|
7
7
|
* A construct which represents a named role that a Lambda function can assume.
|
|
8
8
|
*/
|
|
9
9
|
class NamedLambdaRole extends aws_iam_1.Role {
|
|
10
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.
|
|
10
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.83" };
|
|
11
11
|
constructor(scope, id, props) {
|
|
12
12
|
super(scope, id, {
|
|
13
13
|
assumedBy: new aws_iam_1.ServicePrincipal("lambda.amazonaws.com"),
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
|
15
15
|
* to the provider framework.
|
|
16
16
|
*/
|
|
17
17
|
class ProviderFunction extends constructs_1.Construct {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.83" };
|
|
19
19
|
_function;
|
|
20
20
|
_response;
|
|
21
21
|
constructor(scope, id, props) {
|
|
@@ -23,7 +23,7 @@ exports.VPC_LOOKUP_PROPS = {
|
|
|
23
23
|
* Helper for looking up the shared OrcaBus VPC.
|
|
24
24
|
*/
|
|
25
25
|
class OrcaBusVpc {
|
|
26
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.
|
|
26
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.83" };
|
|
27
27
|
/**
|
|
28
28
|
* The shared VPC that is used by OrcaBus.
|
|
29
29
|
* @param scope
|
|
@@ -42,7 +42,7 @@ exports.SHARED_SECURITY_GROUP_NAME = "OrcaBusSharedComputeSecurityGroup";
|
|
|
42
42
|
* Helper for looking up the shared compute security group by name.
|
|
43
43
|
*/
|
|
44
44
|
class OrcaBusSharedComputeSecurityGroup {
|
|
45
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.
|
|
45
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.83" };
|
|
46
46
|
/**
|
|
47
47
|
* The shared security group that is used by compute resources to access the database.
|
|
48
48
|
* @param scope
|
package/shared-config/slack.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.SLACK_ALERTS_SNS_TOPIC = "AwsChatBotTopic-alerts";
|
|
|
11
11
|
* A helper class to construct the arn for the slack SNS topic.
|
|
12
12
|
*/
|
|
13
13
|
class SlackAlerts {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.83" };
|
|
15
15
|
/**
|
|
16
16
|
* Format the ARN for the slack alerts SNS topic for the current stack.
|
|
17
17
|
* @param stack
|