GithubHelp home page GithubHelp logo

asfadmin / cumulus-task-cnm-to-granules Goto Github PK

View Code? Open in Web Editor NEW
0.0 9.0 0.0 22 KB

A cumulus task for converting CNM messages into the CMA input format expected by SyncGranule.

License: Other

Makefile 7.40% HCL 25.15% Python 67.45%

cumulus-task-cnm-to-granules's Introduction

CNM to Granules - Cumulus Task

A cumulus task for converting CNM messages into the CMA input format expected by SyncGranule.

Deployment Example

There is an example of how to add the lambda to your cumulus deployment in the example directory. The example assumes you have deployed Cumulus with CIRRUS.

To deploy the example, set your aws profile and region to the correct values and enter the appropriate values for DEPLOY_NAME and prefix when prompted:

$ cd example
$ terraform init
$ AWS_PROFILE=example-aws-profile AWS_REGION=us-west-2 terraform apply
var.DEPLOY_NAME
  Enter a value: example

var.prefix
  Enter a value: example-cumulus-dev

Usage Example

To use the task, add it as the first step in your ingest workflow followed by SyncGranule.

{
  "Comment": "Example CNM Ingest Workflow",
  "StartAt": "CnmToGranules",
  "States": {
    "CnmToGranules": {
      "Type": "Task",
      "Resource": "${CnmToGranulesArn}",
      "Parameters": {
        "cma": {
          "event.$": "$",
          "task_config": {
            "cumulus_message": {
              "outputs": [
                {
                  "source": "{$.granules}",
                  "destination": "{$.payload.granules}"
                },
                {
                  "source": "{$.cnm}",
                  "destination": "{$.meta.cnm}"
                }
              ]
            }
          }
        }
      },
      "Next": "SyncGranule"
    },
    "SyncGranule": {
      "Type": "Task",
      "Resource": "${SyncGranuleArn}",
      "Parameters": {
        "cma": {
          "event.$": "$",
          "task_config": {
            "ACL": "disabled",
            "buckets": "{$.meta.buckets}",
            "stack": "{$.meta.stack}",
            "downloadBucket": "{$.meta.buckets.products.name}",
            "duplicateHandling": "{$.meta.collection.duplicateHandling}",
            "provider": "{$.meta.provider}",
            "collection": "{$.meta.collection}",
            "workflowStartTime": "{$.cumulus_meta.workflow_start_time}",
            "syncChecksumFiles": true
          },
          "cumulus_message": {
            "input": "{$.payload}",
            "outputs": [
              {
                "source": "{$.granules}",
                "destination": "{$.meta.input_granules}"
              },
              {
                "source": "{$}",
                "destination": "{$.payload}"
              },
              {
                "source": "{$.process}",
                "destination": "{$.meta.process}"
              }
            ]
          }
        }
      },
      "End": true
    },
    "WorkflowFailed": {
      "Type": "Fail",
      "Cause": "Workflow failed"
    }
  }
}

cumulus-task-cnm-to-granules's People

Contributors

mattp0 avatar mckadesorensen avatar reweeden avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.