@orcabus/platform-cdk-constructs 0.0.43 → 0.0.44

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 CHANGED
@@ -6756,6 +6756,6 @@
6756
6756
  "symbolId": "shared-config/slack:SlackAlerts"
6757
6757
  }
6758
6758
  },
6759
- "version": "0.0.43",
6760
- "fingerprint": "YSlLcVlXhkJ2rWV9TD1SfBIOuMH4gCYXv6HSkM9za/g="
6759
+ "version": "0.0.44",
6760
+ "fingerprint": "arsb/LGcRULLZhW7yVeQPPrQ6Xufpe98A6X9G62fzCM="
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.43" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.44" };
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.43" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.44" };
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.43" };
35
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.44" };
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" };
43
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.44" };
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.43" };
78
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.44" };
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.43" };
58
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.44" };
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.43" };
59
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.44" };
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
@@ -141,7 +141,8 @@ from .workflow_helpers import (
141
141
 
142
142
  # Multiqc
143
143
  from .multiqc_helpers import (
144
- run_multiqc
144
+ run_multiqc,
145
+ update_multiqc_job_status
145
146
  )
146
147
 
147
148
 
@@ -199,5 +200,6 @@ __all__ = [
199
200
  "to_fastq_list_rows",
200
201
  # Multiqc
201
202
  "run_multiqc",
203
+ "update_multiqc_job_status",
202
204
  ]
203
205
 
@@ -92,6 +92,17 @@ class SequaliReportsDict(TypedDict):
92
92
  multiqcParquet: FileStorageObject
93
93
 
94
94
 
95
+ class QcStats(TypedDict):
96
+ insertSizeEstimate: int
97
+ rawWgsCoverageEstimate: int
98
+ r1Q20Fraction: float
99
+ r2Q20Fraction: float
100
+ r1GcFraction: float
101
+ r2GcFraction: float
102
+ duplicationFractionEstimate: float
103
+ sequaliReports: Optional[SequaliReportsDict]
104
+
105
+
95
106
  # Deprecated: Use FastqCreate instead
96
107
  class FastqListRowCreate(TypedDict):
97
108
  fastqSetId: Optional[str]
@@ -140,7 +151,7 @@ class Fastq(TypedDict):
140
151
  center: Optional[str]
141
152
  date: Optional[datetime]
142
153
  readSet: Optional[ReadSet]
143
- qc: Optional[Dict]
154
+ qc: Optional[QcStats]
144
155
  readCount: Optional[int]
145
156
  baseCountEst: Optional[int]
146
157
  isValid: Optional[bool]
@@ -157,7 +168,7 @@ class FastqCreate(TypedDict):
157
168
  center: Optional[str]
158
169
  date: Optional[datetime]
159
170
  readSet: Optional[ReadSet]
160
- qc: Optional[Dict]
171
+ qc: Optional[QcStats]
161
172
  readCount: Optional[int]
162
173
  baseCountEst: Optional[int]
163
174
  isValid: Optional[bool]
@@ -179,17 +190,6 @@ class FastqSet(TypedDict):
179
190
  isCurrentFastqSet: bool
180
191
 
181
192
 
182
- class QcStats(TypedDict):
183
- insertSizeEstimate: int
184
- rawWgsCoverageEstimate: int
185
- r1Q20Fraction: float
186
- r2Q20Fraction: float
187
- r1GcFraction: float
188
- r2GcFraction: float
189
- duplicationFractionEstimate: float
190
- sequaliReports: Optional[SequaliReportsDict]
191
-
192
-
193
193
  class ReadCount(TypedDict):
194
194
  readCount: int
195
195
  baseCountEst: int
@@ -3,8 +3,11 @@
3
3
  """
4
4
  Run MultiQC on a list of fastq ids
5
5
  """
6
- from typing import List
7
6
 
7
+ # Standard imports
8
+ from typing import List, Optional
9
+
10
+ # Custom imports
8
11
  from orcabus_api_tools.fastq import fastq_patch_request
9
12
  from orcabus_api_tools.fastq.globals import MULTIQC_ENDPOINT
10
13
 
@@ -19,3 +22,31 @@ def run_multiqc(fastq_id_list: List[str]) -> str:
19
22
  f"{MULTIQC_ENDPOINT}",
20
23
  json_data=fastq_id_list
21
24
  )
25
+
26
+
27
+ def update_multiqc_job_status(
28
+ job_id: str,
29
+ status: str,
30
+ steps_execution_arn: Optional[str] = None,
31
+ output_uri: Optional[str] = None
32
+ ):
33
+ """
34
+ Update the status of a MultiQC job.
35
+
36
+ :param job_id: The unique identifier of the MultiQC job.
37
+ :param status: The new status of the job (e.g., "running", "completed", "failed").
38
+ :param steps_execution_arn: (Optional) The ARN of the step function execution associated with the job.
39
+ :param output_uri: (Optional) The URI of the output MultiQC report.
40
+ :return: The response from the fastq_patch_request function.
41
+ """
42
+ return fastq_patch_request(
43
+ f"{MULTIQC_ENDPOINT}/{job_id}",
44
+ json_data=dict(filter(
45
+ lambda kv_iter_: kv_iter_[1] is not None,
46
+ {
47
+ "status": status,
48
+ "stepsExecutionArn": steps_execution_arn,
49
+ "multiqcOutputHtmlUri": output_uri
50
+ }.items())
51
+ )
52
+ )
@@ -20,7 +20,7 @@ def create_job(fastq_ids: List[str], job_type: Optional[JobType] = None) -> Job:
20
20
 
21
21
  return fastq_unarchiving_post_request(
22
22
  JOB_ENDPOINT,
23
- params={
23
+ json_data={
24
24
  "fastqIds": fastq_ids,
25
25
  "jobType": job_type
26
26
  }
@@ -50,7 +50,7 @@ def get_item_objs_from_item_id_list(
50
50
  }
51
51
  )
52
52
  except HTTPError as e:
53
- raise HTTPError(f"Could not get item from item id list {item_id_list} from endpoint {endpoint}") from e
53
+ raise ValueError(f"Could not get item from item id list {item_id_list} from endpoint {endpoint}") from e
54
54
 
55
55
  # Accept missing
56
56
  if accept_missing:
@@ -92,7 +92,8 @@ def get_project_from_project_orcabus_id(project_orcabus_id: str) -> Project:
92
92
  def get_projects_list_from_project_orcabus_id_list(project_orcabus_id_list: List[str], accept_missing: bool = False) -> List[Project]:
93
93
  """
94
94
  Get project from the project id
95
- :param project_id:
95
+ :param project_orcabus_id_list:
96
+ :param accept_missing:
96
97
  :return:
97
98
  """
98
99
  # We have an internal id, convert to int
@@ -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.43" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.44" };
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.43" };
10
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.44" };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orcabus/platform-cdk-constructs",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "CDK Package for OrcaBus infrastructure.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -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.43" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.44" };
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.43" };
26
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.44" };
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.43" };
45
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.44" };
46
46
  /**
47
47
  * The shared security group that is used by compute resources to access the database.
48
48
  * @param scope
@@ -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.43" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.44" };
15
15
  /**
16
16
  * Format the ARN for the slack alerts SNS topic for the current stack.
17
17
  * @param stack