@orcabus/platform-cdk-constructs 0.0.38 → 0.0.39
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/lambda/index.js +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/data_sharing/models.py +2 -2
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/__init__.py +2 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/globals.py +1 -0
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/query_helpers.py +21 -3
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/fastq/update_helpers.py +1 -1
- package/lambda/layers/orcabus_api_tools/src/orcabus_api_tools/filemanager/file_helpers.py +11 -17
- 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
|
@@ -6756,6 +6756,6 @@
|
|
|
6756
6756
|
"symbolId": "shared-config/slack:SlackAlerts"
|
|
6757
6757
|
}
|
|
6758
6758
|
},
|
|
6759
|
-
"version": "0.0.
|
|
6760
|
-
"fingerprint": "
|
|
6759
|
+
"version": "0.0.39",
|
|
6760
|
+
"fingerprint": "qjgprLux9UbUIiorobtrlx7b3YD70Zoe6UAFDPpxrKg="
|
|
6761
6761
|
}
|
|
@@ -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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
59
59
|
cluster;
|
|
60
60
|
taskDefinition;
|
|
61
61
|
taskExecutionRole;
|
package/lambda/index.js
CHANGED
|
@@ -56,7 +56,7 @@ function getPythonUvDockerImage() {
|
|
|
56
56
|
return aws_cdk_lib_1.DockerImage.fromBuild(path_1.default.join(__dirname, 'build_python'));
|
|
57
57
|
}
|
|
58
58
|
class PythonUvFunction extends aws_lambda_python_alpha_1.PythonFunction {
|
|
59
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.
|
|
59
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.39" };
|
|
60
60
|
// Class constructs, to be used for caching the layers
|
|
61
61
|
// This means that if there are multiple lambdas throughout the stack
|
|
62
62
|
// They will all use the same layer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal, TypedDict, NotRequired
|
|
1
|
+
from typing import Literal, TypedDict, NotRequired, Union
|
|
2
2
|
|
|
3
3
|
PackageStatusType = Literal[
|
|
4
4
|
"PENDING",
|
|
@@ -28,5 +28,5 @@ class PackageObject(TypedDict):
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class JobPatchParameters(TypedDict):
|
|
31
|
-
status:
|
|
31
|
+
status: Union[PackageStatusType, PushJobStatusType]
|
|
32
32
|
errorMessage: NotRequired[str]
|
|
@@ -104,7 +104,7 @@ from .query_helpers import (
|
|
|
104
104
|
get_fastqs_in_project,
|
|
105
105
|
get_fastq_list_rows_in_fastq_set,
|
|
106
106
|
get_fastqs_in_fastq_set,
|
|
107
|
-
get_fastq_jobs,
|
|
107
|
+
get_fastq_jobs, get_fastq_by_rgid,
|
|
108
108
|
)
|
|
109
109
|
|
|
110
110
|
# Updaters
|
|
@@ -165,6 +165,7 @@ __all__ = [
|
|
|
165
165
|
"get_fastqs_in_subject",
|
|
166
166
|
"get_fastqs_in_individual",
|
|
167
167
|
"get_fastqs_in_project",
|
|
168
|
+
"get_fastq_by_rgid",
|
|
168
169
|
"get_fastq_list_rows_in_fastq_set",
|
|
169
170
|
"get_fastqs_in_fastq_set",
|
|
170
171
|
"get_fastq_jobs",
|
|
@@ -15,7 +15,7 @@ get_fastqs_in_individual
|
|
|
15
15
|
|
|
16
16
|
get_fastqs_in_project
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
get_fastq_by_rgid
|
|
19
19
|
|
|
20
20
|
"""
|
|
21
21
|
from functools import reduce
|
|
@@ -25,7 +25,7 @@ from typing import List, Unpack
|
|
|
25
25
|
from fastapi.encoders import jsonable_encoder
|
|
26
26
|
|
|
27
27
|
from . import get_fastq_request_response_results, get_fastq_request
|
|
28
|
-
from .globals import FASTQ_ENDPOINT, FASTQ_SET_ENDPOINT
|
|
28
|
+
from .globals import FASTQ_ENDPOINT, FASTQ_SET_ENDPOINT, RGID_ENDPOINT
|
|
29
29
|
from .models import (
|
|
30
30
|
FastqSet, Job, FastqParameters, FastqSetQueryParameters,
|
|
31
31
|
FastqGetResponseParameters, VALID_BATCH_KEYS, Fastq
|
|
@@ -58,7 +58,7 @@ def get_fastq_set(
|
|
|
58
58
|
"""
|
|
59
59
|
# Raise error if any of the kwargs are not in the FastqSetQueryParameters
|
|
60
60
|
for key in kwargs.keys():
|
|
61
|
-
if key not in
|
|
61
|
+
if key not in FastqGetResponseParameters.__annotations__:
|
|
62
62
|
raise ValueError(f"Invalid parameter: {key}")
|
|
63
63
|
|
|
64
64
|
return FastqSet(
|
|
@@ -230,6 +230,24 @@ def get_fastqs_in_project(project_id):
|
|
|
230
230
|
)
|
|
231
231
|
|
|
232
232
|
|
|
233
|
+
def get_fastq_by_rgid(
|
|
234
|
+
rgid: str,
|
|
235
|
+
**kwargs: Unpack[FastqGetResponseParameters]
|
|
236
|
+
) -> Fastq:
|
|
237
|
+
# Raise error if any of the kwargs are not in the FastqGetResponseParameters
|
|
238
|
+
for key in kwargs.keys():
|
|
239
|
+
if key not in FastqGetResponseParameters.__annotations__:
|
|
240
|
+
raise ValueError(f"Invalid parameter: {key}")
|
|
241
|
+
|
|
242
|
+
return get_fastq_request(
|
|
243
|
+
f"{RGID_ENDPOINT}/{rgid}",
|
|
244
|
+
params=dict(filter(
|
|
245
|
+
lambda kv_iter_: kv_iter_[1] is not None,
|
|
246
|
+
kwargs.items()
|
|
247
|
+
))
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
|
|
233
251
|
def get_fastq_list_rows_in_fastq_set(fastq_set_id):
|
|
234
252
|
"""
|
|
235
253
|
DEPRECATED: Use get_fastqs_in_fastq_set instead
|
|
@@ -144,7 +144,7 @@ def invalidate_fastq(fastq_id: str) -> Fastq:
|
|
|
144
144
|
|
|
145
145
|
def link_fastq_list_row_to_fastq_set(fastq_id: str, fastq_set_id: str) -> FastqSet:
|
|
146
146
|
"""
|
|
147
|
-
Deprecated: Use `
|
|
147
|
+
Deprecated: Use `link_fastq_to_fastq_set` instead.
|
|
148
148
|
Link a fastq id to a fastq set.
|
|
149
149
|
|
|
150
150
|
:param fastq_id:
|
|
@@ -23,7 +23,7 @@ from . import (
|
|
|
23
23
|
from .globals import (
|
|
24
24
|
S3_LIST_ENDPOINT,
|
|
25
25
|
S3_BUCKETS_BY_ACCOUNT_ID,
|
|
26
|
-
S3_PREFIXES_BY_ACCOUNT_ID
|
|
26
|
+
S3_PREFIXES_BY_ACCOUNT_ID, S3_ATTRIBUTES_LIST_ENDPOINT
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
if typing.TYPE_CHECKING:
|
|
@@ -108,27 +108,22 @@ def get_file_object_from_ingest_id(ingest_id: str, **kwargs) -> FileObject:
|
|
|
108
108
|
|
|
109
109
|
def list_files_from_portal_run_id(
|
|
110
110
|
portal_run_id: str,
|
|
111
|
-
|
|
112
|
-
**kwargs
|
|
111
|
+
remove_log_files: bool = True,
|
|
113
112
|
) -> List[FileObject]:
|
|
114
|
-
portal_run_id_date_str = datetime.strptime(portal_run_id[:8], "%Y%m%d")
|
|
115
113
|
|
|
116
114
|
# Get files from cache
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
**kwargs
|
|
115
|
+
all_files_list = get_file_manager_request_response_results(S3_ATTRIBUTES_LIST_ENDPOINT, {
|
|
116
|
+
"portalRunId": portal_run_id,
|
|
117
|
+
"currentState": json.dumps(True)
|
|
121
118
|
})
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"bucket": get_archive_analysis_bucket_from_account_id(),
|
|
126
|
-
"key": f"v1/year={portal_run_id_date_str.year}/month={str(portal_run_id_date_str.month).zfill(2)}/{portal_run_id}/*",
|
|
127
|
-
**kwargs
|
|
128
|
-
})
|
|
120
|
+
if not remove_log_files:
|
|
121
|
+
return all_files_list
|
|
129
122
|
|
|
130
|
-
|
|
131
|
-
|
|
123
|
+
return list(filter(
|
|
124
|
+
lambda file_iter_: not '/ica_logs/' in file_iter_['key'],
|
|
125
|
+
all_files_list
|
|
126
|
+
))
|
|
132
127
|
|
|
133
128
|
|
|
134
129
|
def get_presigned_url(s3_object_id: str) -> str:
|
|
@@ -137,7 +132,6 @@ def get_presigned_url(s3_object_id: str) -> str:
|
|
|
137
132
|
:param s3_object_id:
|
|
138
133
|
:return:
|
|
139
134
|
"""
|
|
140
|
-
|
|
141
135
|
response = get_file_manager_request(f"{S3_LIST_ENDPOINT}/presign/{s3_object_id}")
|
|
142
136
|
|
|
143
137
|
return str(response)
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
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.39" };
|
|
15
15
|
/**
|
|
16
16
|
* Format the ARN for the slack alerts SNS topic for the current stack.
|
|
17
17
|
* @param stack
|