| build status |
|---|
This repository defines the image to be used for the SWSOC file artifacts Lambda function container. This container will be built and and stored in an ECR Repo. The container will contain the latest release code as the production environment and the latest code on master as the development.
pytest --pyargs lambda_function/tests --cov=lambda_function/src --cov-report=htmlThe container image can be built and run locally. You can specify the base image at runtime.
At the time of writing, the base image defaults to
padre-swsoc-docker-lambda-base:latest in AWS.
# Chose a Base Image for you desired mission
export BASE_IMAGE=public.ecr.aws/w5r9l1c8/padre-swsoc-docker-lambda-base:latest
export IMAGE_NAME=swxsoc_sdc_aws_artifacts_lambda
export VERSION=$(date -u +"%Y%m%d%H%M%S")
# Build the image
docker build --no-cache --build-arg BASE_IMAGE=$BASE_IMAGE -t $IMAGE_NAME:latest lambda_function/.
# Tag the image with a version
docker tag $IMAGE_NAME:latest $IMAGE_NAME:$VERSIONRun the lambda container image you've built (After using your mfa script), this will start the lambda runtime environment:
docker run -p 9000:8080 \
-v ~/lambda_function/tests/test_data:/test_data \
-e SDC_AWS_FILE_PATH=/test_data/hermes_EEA_l0_2023042-000000_v0.bin \
artifacts_function: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 @lambda_function/tests/test_data/test_eea_event.jsonRun the lambda container image you've built (After using your mfa script), this will start the lambda runtime environment:
docker run -p 9000:8080 \
-v ~/lambda_function/tests/test_data:/test_data \
-e USE_INSTRUMENT_TEST_DATA=True \
artifacts_function: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 @lambda_function/tests/test_data/test_eea_event.jsonThe 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).