Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
description: 'Branch to release from'
required: true
type: string
default: 'main'
default: 'master'
seed:
description: 'Random seed for reproducible sampling (float in [-1.0, 1.0]). Leave blank to auto-generate.'
required: false
Expand All @@ -34,15 +34,15 @@ on:
default: '5'
jobs:
deploy:
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@main
with:
template-repository-name: 'lambda-feedback/evaluation-function-boilerplate-python'
build-file: "app/Dockerfile"
build-context: "./app"
environment: "production"
version-bump: ${{ inputs.version-bump }}
branch: ${{ inputs.branch }}
run-database-tests: false
run-database-tests: true
seed: ${{ inputs.seed }}
request_delay: ${{ inputs.request_delay }}
max_concurrency: ${{ inputs.max_concurrency }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Staging
on:
push:
branches:
- main
- master
workflow_dispatch:

jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
python-version: ["3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
if-no-files-found: warn
deploy:
needs: test
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@main
with:
template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python"
build-file: "app/Dockerfile"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
python-version: ["3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
20 changes: 14 additions & 6 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Base image that bundles AWS Lambda Python 3.8 image with some middleware functions
# FROM base-eval-tmp
FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.8
# Base image that bundles the AWS Lambda Python image with the lambda-feedback middleware (app.handler)
FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.12

# The 3.12 image is Amazon Linux 2023, which doesn't ship `find` (used below)
RUN dnf install -y findutils && dnf clean all

WORKDIR /app

ENV PYTHONPATH=/app

# Copy and install any packages/modules needed for your evaluation script.
COPY requirements.txt .
RUN pip3 install -r requirements.txt

# The healthcheck command runs the pytest suite
RUN pip3 install pytest

# Copy the evaluation and testing scripts
COPY evaluation.py ./app/
COPY evaluation_test.py ./app/
COPY evaluation_tests.py ./app/

# Copy Documentation
COPY docs/dev.md ./app/docs/dev.md
Expand All @@ -20,5 +27,6 @@ COPY docs/user.md ./app/docs/user.md
RUN chmod 644 $(find . -type f)
RUN chmod 755 $(find . -type d)

# The entrypoint for AWS is to invoke the handler function within the app package
CMD [ "/app/app.handler" ]
# The entrypoint for AWS is to invoke the handler function within the app package.
# Python 3.12's Lambda runtime imports this as a module name, so it can't be a path.
CMD [ "app.handler" ]
File renamed without changes.
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
# evaluation_tests.py is the name the base layer's healthcheck imports, so
# include it alongside pytest's default patterns.
python_files = test_*.py *_test.py *_tests.py
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Three pipelines are configured in `.github/workflows/`:

To develop and test locally:

- Python 3.8 or higher
- Python 3.12 or higher
- Docker
- `git` CLI or GitHub Desktop
- A code editor (VS Code, PyCharm, etc.)
Expand Down
Loading