Skip to content

Commit

Permalink
Added cttso pipeline to orcabus stack
Browse files Browse the repository at this point in the history
For both stateless and stateful
  • Loading branch information
alexiswl committed Apr 29, 2024
1 parent 8d273c1 commit 621c63d
Show file tree
Hide file tree
Showing 49 changed files with 420 additions and 768 deletions.
13 changes: 13 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { getFileManagerStackProps } from './stacks/fileManager';
import { getBsRunsUploadManagerStackProps } from './stacks/bsRunsUploadManager';
import { getICAv2CopyBatchUtilityStackProps } from './stacks/icav2CopyBatchUtility';
import { getBsshIcav2FastqCopyManagerStackProps } from './stacks/bsshIcav2FastqCopyManager';
import {
getCttsov2Icav2PipelineManagerStackProps,
getCttsov2Icav2PipelineTableStackProps,
} from './stacks/cttsov2Icav2PipelineManager';

interface EnvironmentConfig {
name: string;
Expand Down Expand Up @@ -42,6 +46,7 @@ export const getEnvironmentConfig = (
sharedStackProps: getSharedStackProps(accountName),
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -52,6 +57,8 @@ export const getEnvironmentConfig = (
icav2CopyBatchUtilityStackProps: getICAv2CopyBatchUtilityStackProps(accountName),
bsshIcav2FastqCopyManagerStackProps:
getBsshIcav2FastqCopyManagerStackProps(accountName),
cttsov2Icav2PipelineManagerStackProps:
getCttsov2Icav2PipelineManagerStackProps(accountName),
},
},
};
Expand All @@ -66,6 +73,7 @@ export const getEnvironmentConfig = (
sharedStackProps: getSharedStackProps(accountName),
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -76,6 +84,8 @@ export const getEnvironmentConfig = (
icav2CopyBatchUtilityStackProps: getICAv2CopyBatchUtilityStackProps(accountName),
bsshIcav2FastqCopyManagerStackProps:
getBsshIcav2FastqCopyManagerStackProps(accountName),
cttsov2Icav2PipelineManagerStackProps:
getCttsov2Icav2PipelineManagerStackProps(accountName),
},
},
};
Expand All @@ -90,6 +100,7 @@ export const getEnvironmentConfig = (
sharedStackProps: getSharedStackProps(accountName),
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -100,6 +111,8 @@ export const getEnvironmentConfig = (
icav2CopyBatchUtilityStackProps: getICAv2CopyBatchUtilityStackProps(accountName),
bsshIcav2FastqCopyManagerStackProps:
getBsshIcav2FastqCopyManagerStackProps(accountName),
cttsov2Icav2PipelineManagerStackProps:
getCttsov2Icav2PipelineManagerStackProps(accountName),
},
},
};
Expand Down
32 changes: 32 additions & 0 deletions config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,38 @@ export const bsshFastqCopyManagerSSMArn = path.join(
);
export const bsshFastqCopyManagerSfnName = 'bssh_fastq_copy_manager_sfn';

/*
External resources required by the ctTSO v2 Stack
*/
export const cttsov2Icav2PipelineIdSSMParameterPath =
'/icav2/umccr-prod/tso500_ctdna_2.1_pipeline_id';

/*
Resources generated by the ctTSO v2 Stack
*/
export const cttsov2Icav2PipelineManagerSSMRoot = '/orcabus/ctTSOv2';

// Stateful
export const cttsov2Icav2PipelineManagerDynamodbTableName = 'ctTSOv2ICAv2AnalysesDynamoDBTable';
export const cttsov2DynamoDbTableSSMName = path.join(
cttsov2Icav2PipelineManagerSSMRoot,
'dynamodb_table_name'
);
export const cttsov2DynamoDbTableSSMArn = path.join(
cttsov2Icav2PipelineManagerSSMRoot,
'dynamodb_table_arn'
);

// Stateless
export const cttsov2Icav2PipelineSfnSSMName = path.join(
cttsov2Icav2PipelineManagerSSMRoot,
'state_machine_name'
);
export const cttsov2Icav2PipelineSfnSSMArn = path.join(
cttsov2Icav2PipelineManagerSSMRoot,
'state_machine_arn'
);

// const statelessConfig = {
// multiSchemaConstructProps: {
// registryName: regName,
Expand Down
57 changes: 57 additions & 0 deletions config/stacks/cttsov2Icav2PipelineManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {
AccountName,
eventBusName,
cttsov2Icav2PipelineIdSSMParameterPath,
icav2CopyBatchUtilityName,
cttsov2Icav2PipelineSfnSSMName,
cttsov2Icav2PipelineSfnSSMArn,
cttsov2Icav2PipelineManagerDynamodbTableName,
icav2AccessTokenSecretNameDev,
icav2AccessTokenSecretNameStg,
icav2AccessTokenSecretNameProd,
cttsov2DynamoDbTableSSMArn,
cttsov2DynamoDbTableSSMName,
} from '../constants';
import { Cttsov2Icav2PipelineManagerConfig } from '../../lib/workload/stateless/stacks/cttso-v2-pipeline-manager/deploy/stack';
import { Cttsov2Icav2PipelineTableConfig } from '../../lib/workload/stateful/stacks/cttso-v2-pipeline-dynamo-db/deploy/stack';

// Stateful
export const getCttsov2Icav2PipelineTableStackProps = (): Cttsov2Icav2PipelineTableConfig => {
return {
cttsov2_icav2_dynamodb_table_arn_ssm_parameter_path: cttsov2DynamoDbTableSSMArn,
cttsov2_icav2_dynamodb_table_name_ssm_parameter_path: cttsov2DynamoDbTableSSMName,
dynamodb_table_name: cttsov2Icav2PipelineManagerDynamodbTableName,
};
};

// Stateless
export const getCttsov2Icav2PipelineManagerStackProps = (
n: AccountName
): Cttsov2Icav2PipelineManagerConfig => {
const baseConfig = {
ssm_parameter_list: [cttsov2Icav2PipelineIdSSMParameterPath],
icav2_copy_batch_utility_state_machine_name: icav2CopyBatchUtilityName,
cttso_v2_launch_state_machine_arn_ssm_parameter_path: cttsov2Icav2PipelineSfnSSMArn,
cttso_v2_launch_state_machine_name_ssm_parameter_path: cttsov2Icav2PipelineSfnSSMName,
dynamodb_table_name: cttsov2Icav2PipelineManagerDynamodbTableName,
eventbus_name: eventBusName,
};

switch (n) {
case 'beta':
return {
...baseConfig,
icav2_token_secret_id: icav2AccessTokenSecretNameDev,
};
case 'gamma':
return {
...baseConfig,
icav2_token_secret_id: icav2AccessTokenSecretNameStg,
};
case 'prod':
return {
...baseConfig,
icav2_token_secret_id: icav2AccessTokenSecretNameProd,
};
}
};
32 changes: 32 additions & 0 deletions lib/workload/components/dynamodb-icav2-table/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Construct } from 'constructs';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';

export interface DynamodbIcav2PipelineConstructProps {
table_name: string;
}

export class DynamodbIcav2PipelineConstruct extends Construct {
public readonly table_obj: dynamodb.ITableV2;
public readonly table_name_arn: string;

constructor(scope: Construct, id: string, props: DynamodbIcav2PipelineConstructProps) {
super(scope, id);

this.table_obj = new dynamodb.TableV2(this, 'dynamodb_icav2_pipeline_table', {
/* Either a db_uuid or an icav2 analysis id or a portal run id */
partitionKey: {
name: 'id',
type: dynamodb.AttributeType.STRING,
},
/* One of 'db_uuid', 'icav2_analysis_id', 'portal_run_id' */
sortKey: {
name: 'id_type',
type: dynamodb.AttributeType.STRING,
},
tableName: props.table_name,
});

// Set outputs
this.table_name_arn = this.table_obj.tableArn;
}
}
5 changes: 0 additions & 5 deletions lib/workload/stateful/cttso_v2_pipeline_dynamo_db/Readme.md

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions lib/workload/stateful/cttso_v2_pipeline_dynamo_db/deploy/README.md

This file was deleted.

This file was deleted.

66 changes: 0 additions & 66 deletions lib/workload/stateful/cttso_v2_pipeline_dynamo_db/deploy/cdk.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 621c63d

Please sign in to comment.