From fadb6ad72eb999ec86a2c130253c860de40e1c2e Mon Sep 17 00:00:00 2001 From: Maaike Date: Wed, 18 Oct 2023 17:30:30 +0200 Subject: [PATCH] more docs and base-image from GHCR --- README.md | 8 ++++++-- aws-lambda/Dockerfile | 2 +- aws-lambda/README.md | 7 +++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b44da47..870821b 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,15 @@ The synop2bufr Python module contains both a command line interface and API to c Dependencies are listed in [requirements.txt](https://github.com/wmo-im/synop2bufr/blob/main/requirements.txt). Dependencies are automatically installed during synop2bufr installation. +## Running + +To run synop2bufr from a docker container: + ```console docker build -t synop2bufr:local . docker run -it -v ${pwd}:/local synop2bufr ``` -## Running - Example data can be found in `data` directory, with the corresponding reference BUFR4 in `data/bufr`. To transform SYNOP data file into BUFR: @@ -29,6 +31,8 @@ mkdir output-data synop2bufr data transform --metadata data/station_list.csv --year 2023 --month 03 --output-dir output-data data/A_SMRO01YRBK211200_C_EDZW_20220321120500_12524785.txt ``` +To run synop2bufr inside a Lambda function on Amazon Web Services, please refer to [aws-lambda/README.md](aws-lambda/README.md) and use this [Dockerfile](aws-lambda/Dockerfile) to build the container image for the Lambda function. + ## Usage Guide Here we detail how synop2bufr can be used. diff --git a/aws-lambda/Dockerfile b/aws-lambda/Dockerfile index b056376..fb6a020 100644 --- a/aws-lambda/Dockerfile +++ b/aws-lambda/Dockerfile @@ -1,7 +1,7 @@ # Define custom function directory ARG FUNCTION_DIR="/function" -FROM wmoim/dim_eccodes_baseimage:2.31.0 +FROM ghcr.io/wmo-im/dim_eccodes_baseimage:2.31.0 # Include global arg in this stage of the build ARG FUNCTION_DIR diff --git a/aws-lambda/README.md b/aws-lambda/README.md index 3867285..2e50924 100644 --- a/aws-lambda/README.md +++ b/aws-lambda/README.md @@ -2,16 +2,15 @@ ## Overview -AWS Lambda is a service from Amazon that enables publishing -code which is executed as on demand functions. +AWS Lambda is a service from Amazon that enables publishing code which is executed as on demand functions. This directory contains the Dockerfile and example lambda function code that will run the synop2bufr-transformation on files received in S3. ## lambda container -To run synop2bufr on Lambda requires a custom container image. The Dockerfile in this directory. +The Dockerfile in this directory will build the container image that can be used to run synop2bufr on Lambda. -# to build docker container +# build and deploy ```bash docker build -t synop2bufr-lambda . ```