aletrn commited on
Commit
9e6626c
·
1 Parent(s): 3dbe011

[feat] rename dockerfile-lambda-samgeo-api

Browse files
README.md CHANGED
@@ -1,11 +1,4 @@
1
- ---
2
- title: Segment Geospatial
3
- emoji: 📉
4
- colorFrom: red
5
- colorTo: blue
6
- sdk: docker
7
- pinned: false
8
- ---
9
 
10
  Build the docker image:
11
 
@@ -17,7 +10,7 @@ docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)
17
  docker build . -f dockerfiles/dockerfile-lambda-gdal-runner --tag 686901913580.dkr.ecr.eu-west-1.amazonaws.com/lambda-gdal-runner
18
 
19
  # build the final docker image
20
- docker build . -f dockerfiles/dockerfile-samgeo-api --tag lambda-samgeo-api --progress=plain
21
  ```
22
 
23
  Run the container (keep it on background) and show logs
@@ -34,3 +27,15 @@ curl -X 'POST' \
34
  -H 'accept: application/json' \
35
  -d '{}'
36
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Segment Geospatial
 
 
 
 
 
 
 
2
 
3
  Build the docker image:
4
 
 
10
  docker build . -f dockerfiles/dockerfile-lambda-gdal-runner --tag 686901913580.dkr.ecr.eu-west-1.amazonaws.com/lambda-gdal-runner
11
 
12
  # build the final docker image
13
+ docker build . -f dockerfiles/dockerfile-lambda-samgeo-api --tag 686901913580.dkr.ecr.eu-west-1.amazonaws.com/lambda-samgeo-api
14
  ```
15
 
16
  Run the container (keep it on background) and show logs
 
27
  -H 'accept: application/json' \
28
  -d '{}'
29
  ```
30
+
31
+ ## Publish the aws lambda
32
+ 1. Login on aws ECR with the correct aws profile (details on [ECR page](https://eu-west-1.console.aws.amazon.com/ecr/repositories/private/686901913580/surferdtm-prediction-api?region=eu-west-1))
33
+ ```
34
+ aws --profile alessandrotrinca_hotmail_aws_console_ec2_lambda ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 686901913580.dkr.ecr.eu-west-1.amazonaws.com
35
+ ```
36
+ 2. Build and tag the docker images, then push them:
37
+ ```
38
+ docker push 686901913580.dkr.ecr.eu-west-1.amazonaws.com/lambda-gdal-runner:latest
39
+ docker push 686901913580.dkr.ecr.eu-west-1.amazonaws.com/lambda-samgeo-api:latest
40
+ ```
41
+ 3. It's possible to publish a new aws lambda version from cmd or from lambda page
dockerfiles/dockerfile-lambda-gdal-runner CHANGED
@@ -3,7 +3,7 @@ FROM ghcr.io/osgeo/gdal:ubuntu-small-3.7.2
3
  # Include global arg in this stage of the build
4
  ARG LAMBDA_TASK_ROOT="/var/task"
5
  ARG PYTHONPATH="${LAMBDA_TASK_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
6
- ARG RIE="https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie"
7
 
8
  # Set working directory to function root directory
9
  WORKDIR ${LAMBDA_TASK_ROOT}
 
3
  # Include global arg in this stage of the build
4
  ARG LAMBDA_TASK_ROOT="/var/task"
5
  ARG PYTHONPATH="${LAMBDA_TASK_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
6
+ ARG RIE="https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64"
7
 
8
  # Set working directory to function root directory
9
  WORKDIR ${LAMBDA_TASK_ROOT}
dockerfiles/{dockerfile-samgeo-api → dockerfile-lambda-samgeo-api} RENAMED
File without changes