in source/src/molecule-unfolding/cdk/construct-benchmark.ts [223:267]
private createHPCAndQCStateMachine(hpcStateMachine: sfn.StateMachine, qcStateMachine: sfn.StateMachine): sfn.StateMachine {
const hpcStateMachineStep = new tasks.StepFunctionsStartExecution(this, "Run HPC StateMachine", {
stateMachine: hpcStateMachine,
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
input: sfn.TaskInput.fromObject({
"execution_id": sfn.JsonPath.stringAt("$.execution_id")
}),
resultPath: "$.hpcStateMachineStep",
associateWithParent: true
});
const qcStateMachineStep = new tasks.StepFunctionsStartExecution(this, "Run QC StateMachine", {
stateMachine: qcStateMachine,
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
associateWithParent: true,
input: sfn.TaskInput.fromObject({
"execution_id": sfn.JsonPath.stringAt("$.execution_id")
}),
resultPath: "$.qcStateMachineStep",
});
const hpcAndQCParallel = new sfn.Parallel(this, "hpcAndQCParallel")
hpcAndQCParallel.branch(hpcStateMachineStep)
hpcAndQCParallel.branch(qcStateMachineStep)
const logGroupName = `${this.props.stackName}-RunHPCAndQCStateMachineLogGroup`
grantKmsKeyPerm(this.logKey, logGroupName)
const logGroup = new logs.LogGroup(this, 'RunHPCAndQCStateMachineLogGroup', {
encryptionKey: this.logKey,
logGroupName,
removalPolicy: cdk.RemovalPolicy.DESTROY,
retention: logs.RetentionDays.THREE_MONTHS
});
const hpcAndQCStateMachine = new sfn.StateMachine(this, 'RunHPCAndQCStateMachine', {
definition: hpcAndQCParallel,
logs: {
destination: logGroup,
level: sfn.LogLevel.ALL,
},
});
logGroup.grantWrite(hpcAndQCStateMachine)
return hpcAndQCStateMachine;
}