mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-07-06 04:18:00 +02:00
use arm64 for alpr_cache (renamed from alpr_cluster)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# ALPR Clusters
|
||||
|
||||
Generates clusters (the blobs shown on the map when zoomed out far) daily using OSM data. OSM's Overpass API is used to query for all locations of ALPRs, then a clustering algorithm is used. The clustered data is stored in a JSON file in an S3 bucket.
|
||||
|
||||
## Deploying
|
||||
To build and deploy the Docker image, run `./deploy.sh`.
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
ECR_REPO_URL=912821578123.dkr.ecr.us-east-1.amazonaws.com/alpr_cache-lambda
|
||||
|
||||
set -e
|
||||
|
||||
# check if AWS role is assumed
|
||||
if ! aws sts get-caller-identity &> /dev/null; then
|
||||
echo "Error: AWS role is not assumed. Please assume the necessary role and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd src
|
||||
|
||||
# login to ECR
|
||||
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $ECR_REPO_URL
|
||||
|
||||
# build and push Docker image to ECR for ARM64 using legacy format
|
||||
docker buildx build --platform linux/arm64 -t $ECR_REPO_URL:latest --load .
|
||||
docker push $ECR_REPO_URL:latest
|
||||
|
||||
# update lambda function
|
||||
# export AWS_PAGER=""
|
||||
# aws lambda update-function-code --function-name alpr_cache --image-uri $ECR_REPO_URL:latest
|
||||
|
||||
echo "Deployed!"
|
||||
@@ -0,0 +1,12 @@
|
||||
# Use the official AWS Lambda Python 3.14 base image from public ECR
|
||||
FROM public.ecr.aws/lambda/python:3.14-arm64
|
||||
|
||||
# Copy function code
|
||||
COPY alpr_cache.py ${LAMBDA_TASK_ROOT}
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# Set the CMD to your handler
|
||||
CMD ["alpr_cache.lambda_handler"]
|
||||
@@ -0,0 +1,2 @@
|
||||
boto3
|
||||
requests
|
||||
Reference in New Issue
Block a user