| build status |
|---|
This repository defines the SWxSOC file-sorting Lambda container. The function
moves incoming files to mission and instrument buckets. In DEVELOPMENT it
only moves files with the dev_ prefix; in PRODUCTION it processes all
matching files.
LAMBDA_ENVIRONMENT:DEVELOPMENTorPRODUCTIONsorting behavior.SWXSOC_MISSION: Mission configuration identifier such ashermes,padre,impax, orswxsoc_pipeline.- Communication configuration and credentials are supplied by the architecture Terraform for missions that enable notifications.
AWS CodeBuild derives the mission from its project name and publishes the
container to that mission's ECR repository. A build of main targets the
development repository by default; a release tag targets production.
CDK_ENVIRONMENT or ENVIRONMENT may explicitly select dev/
development or prod/production. Conflicting or unknown values are
rejected. Pull requests and other branches do not push or deploy images.
Mission base-image builds can pass PUBLIC_ECR_REPO. Sorting uses that exact
versioned base-image reference after validating its namespace, repository,
environment, and non-latest tag. If no pinned reference is provided, a
mission build uses its environment's latest base image.
After publishing the Lambda image, CodeBuild sends its immutable image tag to
the mission architecture project for Terraform deployment.
pytest --pyargs lambda_function/tests --cov=lambda_function/src --cov-report=htmlTo test the Lambda function locally using Docker:
Build the Lambda container image (from within the
lambda_functionfolder):docker build -t sdc_aws_sorting_lambda:latest .Run the Lambda container image (after using your MFA script). This starts the Lambda runtime environment:
docker run \ -p 9000:8080 \ -v "$(pwd)/tests/test_data:/test_data" \ sdc_aws_sorting_lambda:latestFrom a separate terminal, make a curl request to the running Lambda function:
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d @tests/test_data/test_padre_event.json
The package template used by this package is based on the one developed by the NASA Space Weather Science Operations Center (SWxSOC) which is based on those provided by OpenAstronomy community and the SunPy Project.
This project makes use of the NASA Space Weather Science Operations Center (SWxSOC).