Skip to content

Commit 9aa43e5

Browse files
committed
updates for multiarch and refresh
1 parent 2406230 commit 9aa43e5

File tree

5 files changed

+59
-9
lines changed

5 files changed

+59
-9
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ENV LD_LIBRARY_PATH=${CONDAENV}/lib
6262
# we're running our own conda one
6363
RUN rm /usr/bin/python
6464

65-
RUN python -m pip install awslambdaric==2.0.0
65+
RUN python -m pip install awslambdaric==2.0.8
6666
ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-${RIE_ARCH} /usr/bin/aws-lambda-rie
6767

6868
RUN chmod +x /usr/bin/aws-lambda-rie

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,41 @@ PDAL Lambda Container for AWS
55
Instructions
66
--------------------------------------------------------------------------------
77

8+
9+
Note that this set of scripts has only been run on an M1/M2 Mac. Multi-arch
10+
containers are often quite slow.
11+
12+
0. Set your AWS variables into your environment:
13+
14+
::
15+
16+
AWS_ACCESS_KEY_ID=something
17+
AWS_SECRET_ACCESS_KEY=somethingelse
18+
AWS_DEFAULT_REGION=us-east-1
19+
820
1. Build the containers. It should make both an arm64 and amd64 image
921

1022
::
1123

1224
$ ./build.sh pdal-lambda
25+
26+
2. Create an ECR repository in your account for the ``pdal-lambda``
27+
image
28+
29+
::
30+
31+
aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION
32+
aws ecr create-repository \
33+
--repository-name pdal-lambda \
34+
--region $AWS_DEFAULT_REGION
35+
36+
3. Build the containers. It should make both an arm64 and amd64 image
37+
38+
::
39+
40+
$ ./build.sh pdal-lambda
41+
42+
4. Push the containers
43+
44+
::
45+
$ ./push.sh pdal-lambda

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ docker buildx build -t $CONTAINER_NAME:amd64 . \
2929
--platform linux/amd64 \
3030
-f Dockerfile --load
3131

32-
LAMBDA_IMAGE="amazon/aws-lambda-provided:al2.2022.03.02.08"
32+
LAMBDA_IMAGE="amazon/aws-lambda-provided:al2.2023.12.14.13"
3333
docker buildx build -t $CONTAINER_NAME:arm64 . \
3434
-f Dockerfile --platform linux/arm64 \
3535
--build-arg LAMBDA_IMAGE=$LAMBDA_IMAGE \

push.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
#!/bin/sh
22

33
container="$1"
4-
tag="$2"
54

65
if [ -z "$container" ]
76
then
87
echo "container name not set! please execute ./build.sh containername'"
8+
exit
99
fi
1010
region="$AWS_DEFAULT_REGION"
11-
echo "region: $region"
11+
echo "region: ${region}"
1212

1313
# login to docker
14-
eval $(aws ecr get-login --no-include-email --region $region)
14+
eval $(aws ecr get-login --no-include-email --region ${region})
1515
identity=$(aws sts get-caller-identity --query 'Account' --output text)
1616

17+
repository=$(aws ecr describe-repositories --repository-names $container)
18+
echo "repository: ${repository}"
1719

1820

19-
CONTAINER_NAME=$identity.dkr.ecr.$region.amazonaws.com/$container:$tag
20-
echo $CONTAINER_NAME
21-
docker push "$CONTAINER_NAME"
21+
for tag in amd64 arm64;
22+
do
23+
echo $Item
24+
CONTAINER_NAME=${identity}.dkr.ecr.${region}.amazonaws.com/${container}:$tag
25+
echo $CONTAINER_NAME
26+
docker push "$CONTAINER_NAME"
27+
done
28+
29+
30+
31+
CONTAINER_NAME=${identity}.dkr.ecr.${region}.amazonaws.com/${container}:latest
32+
docker manifest create "$CONTAINER_NAME" \
33+
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:arm64" \
34+
--amend "${identity}.dkr.ecr.${region}.amazonaws.com/${container}:x86_64"
35+
36+
docker manifest inspect $CONTAINER_NAME
37+
38+
docker manifest push "$CONTAINER_NAME"

run-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- pdal
66
- python-pdal
7-
- python=3.9
7+
- python=3.11
88
- entwine
99
- aws-sdk-cpp
1010
- Shapely

0 commit comments

Comments
 (0)