Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update translator service to bclconvert manager #299

Merged
merged 26 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4555970
update translator service to bclconvert manager
raylrui May 16, 2024
12cfd7f
update the code binding to new schema
raylrui May 20, 2024
42bab80
Merge branch 'main' into feature/update-to-bclconvert-manager
raylrui May 20, 2024
3f35391
add schemas codebinding layer
raylrui May 20, 2024
81d7a82
update with the schemas codebinding layer module
raylrui May 20, 2024
8a17d09
Merge branch 'main' into feature/update-to-bclconvert-manager
raylrui May 21, 2024
ff88e65
resolve conflict
raylrui May 22, 2024
9d150a3
add draft shared layer stack for across function stack use
raylrui May 22, 2024
e6be5da
fix the bcl manager test issue and props pass issue
raylrui May 22, 2024
a9a2c2a
fix some and fix the obj props issue
raylrui May 22, 2024
7ba96ff
fxi parms format error
raylrui May 22, 2024
03ac62e
update the bclconvert manager with new analysis result
raylrui May 23, 2024
b70af20
fix the bclconvert manager helper path issue
raylrui May 27, 2024
aceda5a
update the bclconvert manger with api set api config
raylrui May 28, 2024
3e76bc6
merge to main
raylrui May 28, 2024
1b2c7c2
fix the aws env token error
raylrui May 28, 2024
c84ccdf
refactor the transltor function
raylrui May 28, 2024
92e8bd3
refactor the SG for bcl convert manager
raylrui May 28, 2024
24b5722
Updated v2-samplesheet to 4.2.4
alexiswl May 28, 2024
44bef63
Merge pull request #328 from umccr/alexiswl/feature/update-to-bclconv…
raylrui May 28, 2024
df49fa8
update the translate service and test script
raylrui May 29, 2024
3e2af7a
merge to main
raylrui May 29, 2024
b3c0f5b
fix the makefile format
raylrui May 29, 2024
07ceedc
fix make file path error
raylrui May 29, 2024
621e529
modify event translate service
raylrui May 29, 2024
833702b
merge to main
raylrui May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test-suite:
@(cd lib/workload/stateless/stacks/metadata-manager && $(MAKE) test)
@(cd lib/workload/stateless/stacks/filemanager && $(MAKE) test)
@(cd lib/workload/stateless/stacks/postgres-manager && $(MAKE) test)
@(cd lib/workload/stateless/stacks/icav2-event-translator/translator_service && $(MAKE) test)
@(cd lib/workload/stateless/stacks/bclconvert-manager && $(MAKE) test)
@(cd lib/workload/stateless/stacks/workflow-manager && $(MAKE) test)

# The default outer `test` target only run the top level cdk application unit tests under `./test`
Expand Down
18 changes: 9 additions & 9 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
import { getEventSchemaStackProps } from './stacks/schema/events';
import { getDataSchemaStackProps } from './stacks/schema/data';
import {
getIcav2EventTranslatorTableStackProps,
getIcav2EventTranslatorStackProps,
} from './stacks/icav2EventTranslator';
getBclConvertManagerTableStackProps,
getBclConvertManagerStackProps,
} from './stacks/bclConvertManager';
import { getWorkflowManagerStackProps } from './stacks/workflowRunManager';

interface EnvironmentConfig {
Expand Down Expand Up @@ -52,7 +52,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
icav2EventTranslatorTableStackProps: getIcav2EventTranslatorTableStackProps(stage),
BclConvertTableStackProps: getBclConvertManagerTableStackProps(stage),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -65,7 +65,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
cttsov2Icav2PipelineManagerStackProps: getCttsov2Icav2PipelineManagerStackProps(stage),
eventSchemaStackProps: getEventSchemaStackProps(),
dataSchemaStackProps: getDataSchemaStackProps(),
icav2EventTranslatorStackProps: getIcav2EventTranslatorStackProps(),
bclConvertManagerStackProps: getBclConvertManagerStackProps(stage),
workflowManagerStackProps: getWorkflowManagerStackProps(),
},
},
Expand All @@ -82,7 +82,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
icav2EventTranslatorTableStackProps: getIcav2EventTranslatorTableStackProps(stage),
BclConvertTableStackProps: getBclConvertManagerTableStackProps(stage),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -95,7 +95,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
cttsov2Icav2PipelineManagerStackProps: getCttsov2Icav2PipelineManagerStackProps(stage),
eventSchemaStackProps: getEventSchemaStackProps(),
dataSchemaStackProps: getDataSchemaStackProps(),
icav2EventTranslatorStackProps: getIcav2EventTranslatorStackProps(),
bclConvertManagerStackProps: getBclConvertManagerStackProps(stage),
workflowManagerStackProps: getWorkflowManagerStackProps(),
},
},
Expand All @@ -112,7 +112,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
tokenServiceStackProps: getTokenServiceStackProps(),
icaEventPipeStackProps: getIcaEventPipeStackProps(),
cttsov2Icav2PipelineTableStackProps: getCttsov2Icav2PipelineTableStackProps(),
icav2EventTranslatorTableStackProps: getIcav2EventTranslatorTableStackProps(stage),
BclConvertTableStackProps: getBclConvertManagerTableStackProps(stage),
},
statelessConfig: {
postgresManagerStackProps: getPostgresManagerStackProps(),
Expand All @@ -125,7 +125,7 @@ export const getEnvironmentConfig = (stage: AppStage): EnvironmentConfig | null
cttsov2Icav2PipelineManagerStackProps: getCttsov2Icav2PipelineManagerStackProps(stage),
eventSchemaStackProps: getEventSchemaStackProps(),
dataSchemaStackProps: getDataSchemaStackProps(),
icav2EventTranslatorStackProps: getIcav2EventTranslatorStackProps(),
bclConvertManagerStackProps: getBclConvertManagerStackProps(stage),
workflowManagerStackProps: getWorkflowManagerStackProps(),
},
},
Expand Down
22 changes: 22 additions & 0 deletions config/stacks/bclConvertManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { AppStage, vpcProps, eventBusName, icav2AccessTokenSecretName } from '../constants';
import { RemovalPolicy } from 'aws-cdk-lib';
import { BclConvertTableStackProps } from '../../lib/workload/stateful/stacks/bclconvert-dynamo-db/deploy/stack';
import { BclConvertManagerStackProps } from '../../lib/workload/stateless/stacks/bclconvert-manager/deploy/stack';

const dynamodbTableName = 'IcaEventTranslatorTable';

export const getBclConvertManagerTableStackProps = (stage: AppStage): BclConvertTableStackProps => {
return {
dynamodbTableName: dynamodbTableName,
removalPolicy: stage === AppStage.PROD ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY,
};
};
export const getBclConvertManagerStackProps = (stage: AppStage): BclConvertManagerStackProps => {
return {
eventBusName,
icav2EventTranslatorDynamodbTableName: dynamodbTableName,
vpcProps: vpcProps,
lambdaSecurityGroupName: 'OrcaBusBclConvertManagerSecurityGroup',
icav2JwtSecretsManagerPath: icav2AccessTokenSecretName[stage],
};
};
23 changes: 0 additions & 23 deletions config/stacks/icav2EventTranslator.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# ICA v2 Event Translator
# BclConvert Manager DynamoDB Tables

This table will record event translator process.
### ICAv2 Event Translator DynamoDB Table

The orignal input and orcabus event after translation will be saved in the dynamo db for recording of the process.
This table will record event translator process in BclConvert Manager.

The orignal input and orcabus event after translation will be saved in the dynamo db for recording of the process.

Dynamodb format:
| id | id_type | analysis_id | analysis_status | portal_run_id | db_uuid | original_external_event | translated_internal_ica_event | timestamp |
| -------------- | ---- | ------- | ------- | ---- | ------- | ------- | ------- |------- |
| -------------- | ---- | ------- | ------- | ---- | ------- | ------- | ------- |------- |
| dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | portal_run_id | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | | | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | | | |
| dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | analysis_id | | |dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | | | |
| dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | db_uuid | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | INITIALIZING | 20xxxxxxxxxx | | {"correlationId": "",...} | {'portal_run_id': "",...} | 2024-01-01T00:11:35Z |
|dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | db_uuid | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | QUEUED | 20xxxxxxxxxx | | {"correlationId": "",...} | {'portal_run_id': "",...} | 2024-01-01T00:11:35Z |
|dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | db_uuid | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | IN_PROGRESS | 20xxxxxxxxxx | | {"correlationId": "",...} | {'portal_run_id': "",...} | 2024-01-01T00:11:35Z |
|dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | db_uuid | dxxxxx-6xxxx-fxxx-1xxx-5xxxxx | SUCCEEDED | 20xxxxxxxxxx | | {"correlationId": "",...} | {'portal_run_id': "",...} | 2024-01-01T00:11:35Z |


22 changes: 22 additions & 0 deletions lib/workload/stateful/stacks/bclconvert-dynamo-db/deploy/stack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Stack, RemovalPolicy, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { DynamodbIcav2PipelineConstruct } from '../../../../components/dynamodb-icav2-table';

export interface BclConvertTableStackProps {
dynamodbTableName: string;
removalPolicy?: RemovalPolicy;
}

export class BclConvertTable extends Stack {
constructor(scope: Construct, id: string, props: StackProps & BclConvertTableStackProps) {
super(scope, id, props);
this.createICAv2EventTranslatorTable(props);
}

private createICAv2EventTranslatorTable(props: BclConvertTableStackProps) {
return new DynamodbIcav2PipelineConstruct(this, 'icav2_event_translator_table', {
tableName: props.dynamodbTableName,
removalPolicy: props.removalPolicy,
});
}
}

This file was deleted.

22 changes: 9 additions & 13 deletions lib/workload/stateful/statefulStackCollectionClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import {
Cttsov2Icav2PipelineTableStackProps,
} from './stacks/cttso-v2-pipeline-dynamo-db/deploy/stack';
import {
Icav2EventTranslatorTable,
Icav2EventTranslatorTableStackProps,
} from './stacks/icav2-event-translator-dynamo-db/deploy/stack';
BclConvertTable,
BclConvertTableStackProps,
} from './stacks/bclconvert-dynamo-db/deploy/stack';

export interface StatefulStackCollectionProps {
sharedStackProps: SharedStackProps;
tokenServiceStackProps: TokenServiceStackProps;
icaEventPipeStackProps: IcaEventPipeStackProps;
cttsov2Icav2PipelineTableStackProps: Cttsov2Icav2PipelineTableStackProps;
icav2EventTranslatorTableStackProps: Icav2EventTranslatorTableStackProps;
BclConvertTableStackProps: BclConvertTableStackProps;
}

export class StatefulStackCollection {
Expand All @@ -28,7 +28,7 @@ export class StatefulStackCollection {
readonly tokenServiceStack: Stack;
readonly icaEventPipeStack: Stack;
readonly cttsov2Icav2PipelineTableStack: Stack;
readonly icav2EventTranslatorTableStack: Stack;
readonly BclConvertTableStack: Stack;

constructor(
scope: Construct,
Expand Down Expand Up @@ -58,14 +58,10 @@ export class StatefulStackCollection {
...statefulConfiguration.cttsov2Icav2PipelineTableStackProps,
}
);
this.icav2EventTranslatorTableStack = new Icav2EventTranslatorTable(
scope,
'Icav2EventTranslatorTableStack',
{
...this.createTemplateProps(env, 'Icav2EventTranslatorTableStack'),
...statefulConfiguration.icav2EventTranslatorTableStackProps,
}
);
this.BclConvertTableStack = new BclConvertTable(scope, 'BclConvertTableStack', {
...this.createTemplateProps(env, 'BclConvertTableStack'),
...statefulConfiguration.BclConvertTableStackProps,
});
}

/**
Expand Down
10 changes: 10 additions & 0 deletions lib/workload/stateless/stacks/bclconvert-manager/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
install:
@pip install -r deps/requirements-test.txt

test-translator-service:
@echo "Running tests for translator service"
@PYTHONPATH=./translator_service:$$PYTHONPATH \
python -m unittest translator_service/tests/test_icav2_event_translator.py
@echo "Tests for translator service passed"

test: install test-translator-service
Loading