@orcabus/platform-cdk-constructs 0.0.75 → 0.0.77

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
@@ -7163,6 +7163,6 @@
7163
7163
  "symbolId": "shared-config/slack:SlackAlerts"
7164
7164
  }
7165
7165
  },
7166
- "version": "0.0.75",
7167
- "fingerprint": "Ykn25DM2HdYbzbNJH+RKV9bIbtU8XVh74ugP3ixEHug="
7166
+ "version": "0.0.77",
7167
+ "fingerprint": "lLOIvtH8+InIo5ZgIeSeOUN+PjQo/fJl6VcUDxnMo7k="
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.75" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.apigateway.OrcaBusApiGateway", version: "0.0.77" };
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.75" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.CrossDeploymentArtifactBucket", version: "0.0.77" };
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.75" };
35
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.deploymentPipeline.DeploymentStackPipeline", version: "0.0.77" };
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.75" };
43
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbPartitionedConstruct", version: "0.0.77" };
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.75" };
78
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.dynamodb.DynamoDbNonPartitionedConstruct", version: "0.0.77" };
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.75" };
58
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.ecs.EcsFargateTaskConstruct", version: "0.0.77" };
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.75" };
20
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.eventbridgeRule.SfnSlackNotification", version: "0.0.77" };
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.75" };
60
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.lambda.PythonUvFunction", version: "0.0.77" };
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
@@ -15,6 +15,14 @@ from .aws_helpers import (
15
15
  )
16
16
  from .globals import ICAV2_BASE_URL
17
17
 
18
+ # We also want to set up our environment variables as global variables, so that future calls
19
+ # On the same lambda do not need to re-initialize these variables
20
+ # While we use the lambda params-and-secrets secret extension, this does not work
21
+ # When we need to list params in a path
22
+ STORAGE_CONFIGURATION_FILE = None
23
+ PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_FILE = None
24
+ STORAGE_CREDENTIAL_FILE = None
25
+
18
26
 
19
27
  def create_storage_configuration_file() -> Path:
20
28
  storage_configuration_file = Path(NamedTemporaryFile(
@@ -31,6 +39,13 @@ def create_storage_configuration_file() -> Path:
31
39
  return storage_configuration_file
32
40
 
33
41
 
42
+ def get_storage_configuration_file() -> Path:
43
+ global STORAGE_CONFIGURATION_FILE
44
+ if STORAGE_CONFIGURATION_FILE is None:
45
+ STORAGE_CONFIGURATION_FILE = create_storage_configuration_file()
46
+ return STORAGE_CONFIGURATION_FILE
47
+
48
+
34
49
  def create_project_to_storage_configuration_mapping_file() -> Path:
35
50
  project_to_storage_configuration_file = Path(NamedTemporaryFile(
36
51
  delete=False,
@@ -46,6 +61,13 @@ def create_project_to_storage_configuration_mapping_file() -> Path:
46
61
  return project_to_storage_configuration_file
47
62
 
48
63
 
64
+ def get_project_to_storage_configuration_mapping_file() -> Path:
65
+ global PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_FILE
66
+ if PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_FILE is None:
67
+ PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_FILE = create_project_to_storage_configuration_mapping_file()
68
+ return PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_FILE
69
+
70
+
49
71
  def create_storage_credential_file() -> Path:
50
72
  storage_credential_file = Path(NamedTemporaryFile(
51
73
  delete=False,
@@ -61,6 +83,13 @@ def create_storage_credential_file() -> Path:
61
83
  return storage_credential_file
62
84
 
63
85
 
86
+ def get_storage_credential_file() -> Path:
87
+ global STORAGE_CREDENTIAL_FILE
88
+ if STORAGE_CREDENTIAL_FILE is None:
89
+ STORAGE_CREDENTIAL_FILE = create_storage_credential_file()
90
+ return STORAGE_CREDENTIAL_FILE
91
+
92
+
64
93
  def set_icav2_env_vars():
65
94
  """
66
95
  Set the environment variables for the ICAV2 API
@@ -71,9 +100,9 @@ def set_icav2_env_vars():
71
100
  environ["ICAV2_ACCESS_TOKEN"] = get_icav2_access_token()
72
101
 
73
102
  # Configuration files needed to map storage configurations
74
- environ["ICAV2_STORAGE_CONFIGURATION_LIST_FILE"] = str(create_storage_configuration_file())
75
- environ["ICAV2_PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_LIST_FILE"] = str(create_project_to_storage_configuration_mapping_file())
76
- environ["ICAV2_STORAGE_CREDENTIAL_LIST_FILE"] = str(create_storage_credential_file())
103
+ environ["ICAV2_STORAGE_CONFIGURATION_LIST_FILE"] = str(get_storage_configuration_file())
104
+ environ["ICAV2_PROJECT_TO_STORAGE_CONFIGURATION_MAPPING_LIST_FILE"] = str(get_project_to_storage_configuration_mapping_file())
105
+ environ["ICAV2_STORAGE_CREDENTIAL_LIST_FILE"] = str(get_storage_credential_file())
77
106
 
78
107
 
79
108
  __all__ = [
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  import json
3
3
  from typing import Dict, Optional, List, Union
4
- from urllib.parse import urlunparse, unquote
4
+ from urllib.parse import urlunparse, unquote, urlparse, parse_qs
5
5
 
6
6
  # Standard imports
7
7
  import requests
@@ -58,8 +58,16 @@ def get_request_response_results(url: str, params: Optional[Dict] = None) -> Lis
58
58
  "Authorization": f"Bearer {get_orcabus_token()}"
59
59
  }
60
60
 
61
+ # Get default request params
61
62
  req_params = deepcopy(DEFAULT_REQUEST_PARAMS)
62
63
 
64
+ # Drop any req params that are already in the url
65
+ req_params = dict(filter(
66
+ lambda kv_iter_: kv_iter_[0] not in parse_qs(urlparse(url).query).keys(),
67
+ req_params.items()
68
+ ))
69
+
70
+ # Update with params
63
71
  req_params.update(
64
72
  params if params is not None else {}
65
73
  )
@@ -50,8 +50,8 @@ def get_workflows_from_library_id_list(library_id_list: List[str]) -> List[Workf
50
50
  for library_id in library_id_list[1:]:
51
51
  workflows_for_library = get_workflows_from_library_id(library_id)
52
52
  all_workflows_intersected = list(filter(
53
- lambda workflow_iter_: workflow_iter_.id in list(map(
54
- lambda all_workflows_iter_: all_workflows_iter_.id,
53
+ lambda workflow_iter_: workflow_iter_['orcabusId'] in list(map(
54
+ lambda all_workflows_iter_: all_workflows_iter_['orcabusId'],
55
55
  all_workflows_intersected
56
56
  )),
57
57
  workflows_for_library
@@ -41,8 +41,17 @@ Payload is
41
41
  """
42
42
 
43
43
  # Imports
44
- from typing import TypedDict, Optional, Dict, List
45
-
44
+ from typing import TypedDict, Optional, Dict, List, NotRequired, Literal
45
+
46
+ # Literals
47
+ AnalysisStatusType = Literal[
48
+ 'ACTIVE',
49
+ 'INACTIVE',
50
+ ]
51
+ ContextUseCaseType = Literal[
52
+ 'COMPUTE',
53
+ 'STORAGE',
54
+ ]
46
55
 
47
56
  # Classes
48
57
  class StateDetail(TypedDict):
@@ -63,6 +72,30 @@ class State(StateDetail):
63
72
  payload: str
64
73
 
65
74
 
75
+ class Analysis(TypedDict):
76
+ orcabusId: str
77
+ analysisName: str
78
+ analysisVersion: str
79
+ status: AnalysisStatusType
80
+
81
+
82
+ class Context(TypedDict):
83
+ orcabusId: str
84
+ name: str
85
+ usecase: ContextUseCaseType
86
+
87
+
88
+ class AnalysisRun(TypedDict):
89
+ orcabusId: str
90
+ analysis: Analysis
91
+ storageContext: Context
92
+ computeContext: Context
93
+ analysisRunName: str
94
+ comment: NotRequired[str]
95
+ contexts: List[str]
96
+ readsets: List[str]
97
+
98
+
66
99
  class WorkflowRunDetail(TypedDict):
67
100
  orcabusId: str
68
101
  currentState: StateDetail
@@ -71,7 +104,9 @@ class WorkflowRunDetail(TypedDict):
71
104
  executionId: Optional[str]
72
105
  workflowRunName: str
73
106
  comment: Optional[str]
74
- analysisRun: Optional[str]
107
+ analysisRun: Optional[AnalysisRun]
108
+ contexts: NotRequired[List[str]]
109
+ readsets: NotRequired[List[str]]
75
110
 
76
111
 
77
112
  class WorkflowRun(WorkflowRunDetail):
@@ -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.75" };
16
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.monitoredQueue.MonitoredQueue", version: "0.0.77" };
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.75" };
10
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.namedLambdaRole.NamedLambdaRole", version: "0.0.77" };
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.75",
3
+ "version": "0.0.77",
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.75" };
18
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.provider.ProviderFunction", version: "0.0.77" };
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.75" };
26
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusVpc", version: "0.0.77" };
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.75" };
45
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.networking.OrcaBusSharedComputeSecurityGroup", version: "0.0.77" };
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.75" };
14
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@orcabus/platform-cdk-constructs.sharedConfig.slack.SlackAlerts", version: "0.0.77" };
15
15
  /**
16
16
  * Format the ARN for the slack alerts SNS topic for the current stack.
17
17
  * @param stack