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
2 changes: 1 addition & 1 deletion .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app/
docs/
dev.md # Developer-facing documentation
user.md # User-facing documentation
evaluation_test.py # Unittests for the main evaluation_function
evaluation_tests.py # Unittests for the main evaluation_function
requirements.txt # List of packages needed for evaluation.py
Dockerfile # For building the image to deploy to AWS

Expand Down Expand Up @@ -59,7 +59,7 @@ config.json # Specifies the name of the evaluation function
4. You are now ready to start developing your function:

- Edit the `app/evaluation.py` file, which ultimately gets called when the function is given the `eval` command
- Edit the `app/evaluation_test.py` file to add tests which get run:
- Edit the `app/evaluation_tests.py` file to add tests which get run:
- Every time you commit to this repo, before the image is built and deployed
- Whenever the `healthcheck` command is supplied to the deployed function
- Edit the `app/docs/user.md` and `app/docs/dev.md` files to reflect your changes. These files are baked into the function's image and are made available using the `docs` command. This feature is used to display documentation on our [Documentation](https://lambda-feedback.github.io/Documentation/) website.
Expand Down Expand Up @@ -91,7 +91,7 @@ Once the code passes all these tests, it will then be uploaded to AWS and will b
## Pre-requisites
Although all programming can be done through the GitHub interface, it is recommended you do this locally on your machine. To do this, you must have installed:

- Python 3.8 or higher.
- Python 3.12 or higher.

- GitHub Desktop or the `git` CLI.

Expand Down
Loading