podaac / cumulus-cnm-response-task

Other
1 stars 4 forks source link

cnm-response task

Installation

To build the Lambda code, Refer to following Confluence page: https://wiki.jpl.nasa.gov/pages/viewpage.action?spaceKey=PD&title=SonarQube%2C+Jacoco+and+Java+17+upgrade

* Build with sonarQube and Jacoco report
mvn clean verify sonar:sonar \
  -Dsonar.projectKey=cnm-response-opensource \
  -Dsonar.projectName='cnm-response-opensource' \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.token=sqp_fc2271c4ddba6507fb38ea64d52e6912e2c6e14d

* Make sure java 11 and gradle 8.3 are adopted.

mvn clean dependency:copy-dependencies
gradle build

The build artifact will be generated in build/distributions and can be uploaded directly to AWS Lambda as the source code.

Sample workflow configuration

CnmResponse:
  CumulusConfig:
    OriginalCNM: '{$.meta.cnm}'
    CNMResponseStream: 'ProviderResponse'
    WorkflowException: '{$.exception}'
    region: 'us-west-2'
    cumulus_message:
      outputs:
        - source: '{$}'
          destination: '{$.meta.cnmResponse}'
  Type: Task
  Resource: ${CnmResponseLambdaFunction.Arn}
  Retry:
    - ErrorEquals:
        - States.ALL
      IntervalSeconds: 5
      MaxAttempts: 3
  Catch:
    - ErrorEquals:
      - States.ALL
      ResultPath: '$.exception'
      Next: StopStatus
  Next: StopStatus