This project is a modified version of the source code for a timetable solver from OptaPlanner's quickstart: https://github.com/kiegroup/optaplanner-quickstarts
You may find the blog post for this here: Running a serverless Java constraint solver on AWS
A sample serverless project for deploying a Java constraint solver by OptaPlanner as a container on AWS Lambda.
mvn compile dependency:copy-dependencies -DincludeScope=runtime
docker build -t opta-time-table-solver-lambda . --platform=amd64
docker run -p 9000:8080 opta-time-table-solver-lambda
In a separate terminal:
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
export AWS_ACCOUNT_ID=<YOUR AWS ACCOUNT ID>
export AWS_REGION=<YOUR AWS REGION>
aws ecr create-repository --repository-name opta-time-table-solver-lambda
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
docker tag opta-time-table-solver-lambda:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/opta-time-table-solver-lambda:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/opta-time-table-solver-lambda:latest
sls deploy