CodeBuild Status |
---|
Base Image Used For Container: https://github.com/HERMES-SOC/docker-lambda-base
This repository is to define the image to be used for the SWSOC file processing Lambda function container. This container will be built and and stored in the appropriate development/production ECR Repo.
The container will contain the latest release code as the production environment and the latest code on master as the development.
-
Build the lambda container image (from within the lambda_function folder) you'd like to test:
docker build -t processing_function:latest . --no-cache
-
Run the lambda container image you've built, this will start the lambda runtime environment:
docker run -p 9000:8080 -v <directory_for_processed_files>:/test_data -e SDC_AWS_FILE_PATH=/test_data/<file_to_process_name> processing_function:latest
-
From 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.json
-
Close original terminal running the docker image.
-
Clean up dangling images and containers:
docker system prune
-
Build the lambda container image (from within the lambda_function folder) you'd like to test:
docker build -t processing_function:latest . --no-cache
-
Run the lambda container image you've built, this will start the lambda runtime environment:
docker run -p 9000:8080 -v <directory_for_processed_files>:/test_data -e USE_INSTRUMENT_TEST_DATA=True processing_function:latest
-
From 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.json
-
Close original terminal running the docker image.
-
Clean up dangling images and containers:
docker system prune
This lambda function is part of the main SWxSOC Pipeline (Architecture Repo Link). It is deployed via AWS Codebuild within that repository. It is first built and tagged within the appropriate production or development repository (depending if it is a release or commit). View the Codebuild CI/CD file here.