|
1 |
| -FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12 AS builder |
2 |
| - |
3 |
| -RUN pip install poetry==1.8.3 |
4 |
| - |
5 |
| -ENV POETRY_NO_INTERACTION=1 \ |
6 |
| - POETRY_VIRTUALENVS_IN_PROJECT=1 \ |
7 |
| - POETRY_VIRTUALENVS_CREATE=1 \ |
8 |
| - POETRY_CACHE_DIR=/tmp/poetry_cache |
9 |
| - |
10 |
| -COPY pyproject.toml poetry.lock ./ |
11 |
| - |
12 |
| -RUN --mount=type=cache,target=$POETRY_CACHE_DIR \ |
13 |
| - poetry install --without dev --no-root |
14 |
| - |
15 |
| -FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12 |
16 |
| - |
17 |
| -ENV VIRTUAL_ENV=/app/.venv \ |
18 |
| - PATH="/app/.venv/bin:$PATH" |
19 |
| - |
20 |
| -COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} |
21 |
| - |
22 |
| -# Precompile python files for faster startup |
23 |
| -RUN python -m compileall -q . |
24 |
| - |
25 |
| -# Copy the evaluation function to the app directory |
26 |
| -COPY evaluation_function ./evaluation_function |
27 |
| - |
28 |
| -# Command to start the evaluation function with |
29 |
| -ENV FUNCTION_COMMAND="python" |
30 |
| - |
31 |
| -# Args to start the evaluation function with |
32 |
| -ENV FUNCTION_ARGS="-m,evaluation_function.main" |
33 |
| - |
34 |
| -# The transport to use for the RPC server |
35 |
| -ENV FUNCTION_RPC_TRANSPORT="ipc" |
36 |
| - |
37 |
| -ENV LOG_LEVEL="debug" |
| 1 | +# Base image that bundles AWS Lambda Python 3.8 image with some middleware functions |
| 2 | +# FROM base-eval-tmp |
| 3 | +# FROM rabidsheep55/python-base-eval-layer |
| 4 | +FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.8 |
| 5 | + |
| 6 | +RUN yum install -y git |
| 7 | + |
| 8 | +WORKDIR /app |
| 9 | + |
| 10 | +# Copy and install any packages/modules needed for your evaluation script. |
| 11 | +COPY requirements.txt . |
| 12 | +RUN pip3 install -r requirements.txt |
| 13 | + |
| 14 | +# Copy main scripts |
| 15 | +COPY evaluation.py ./app/ |
| 16 | +COPY evaluation_tests.py ./app/ |
| 17 | +COPY preview.py ./app/ |
| 18 | +COPY preview_tests.py ./app/ |
| 19 | + |
| 20 | +# Copy contexts |
| 21 | +COPY context/physical_quantity.py ./app/context/ |
| 22 | +COPY context/symbolic.py ./app/context/ |
| 23 | + |
| 24 | +# Copy feedback messages |
| 25 | +COPY feedback/physical_quantity.py ./app/feedback/ |
| 26 | +COPY feedback/symbolic.py ./app/feedback/ |
| 27 | + |
| 28 | +# Copy preview implementations |
| 29 | +COPY preview_implementations/physical_quantity_preview.py ./app/preview_implementations/ |
| 30 | +COPY preview_implementations/symbolic_preview.py ./app/preview_implementations/ |
| 31 | + |
| 32 | +# Copy tests |
| 33 | +COPY tests/example_tests.py ./app/tests/ |
| 34 | +COPY tests/physical_quantity_evaluation_tests.py ./app/tests/ |
| 35 | +COPY tests/physical_quantity_preview_tests.py ./app/tests/ |
| 36 | +COPY tests/slr_quantity_tests.py ./app/tests/ |
| 37 | +COPY tests/symbolic_evaluation_tests.py ./app/tests/ |
| 38 | +COPY tests/symbolic_preview_tests.py ./app/tests/ |
| 39 | + |
| 40 | +# Copy utility code |
| 41 | +COPY utility/criteria_graph_utilities.py ./app/utility/ |
| 42 | +COPY utility/criteria_parsing.py ./app/utility/ |
| 43 | +COPY utility/evaluation_result_utilities.py ./app/utility/ |
| 44 | +COPY utility/expression_utilities.py ./app/utility/ |
| 45 | +COPY utility/physical_quantity_utilities.py ./app/utility/ |
| 46 | +COPY utility/preview_utilities.py ./app/utility/ |
| 47 | +COPY utility/slr_parsing_utilities.py ./app/utility/ |
| 48 | +COPY utility/syntactical_comparison_utilities.py ./app/utility/ |
| 49 | +COPY utility/unit_system_conversions.py ./app/utility/ |
| 50 | + |
| 51 | +# Copy Documentation |
| 52 | +COPY docs/dev.md ./app/docs/dev.md |
| 53 | +COPY docs/user.md ./app/docs/user.md |
| 54 | +COPY docs/quantity_comparison_graph.svg ./app/docs/quantity_comparison_graph.svg |
| 55 | + |
| 56 | +# Set permissions so files and directories can be accessed on AWS |
| 57 | +RUN chmod 644 $(find . -type f) |
| 58 | +RUN chmod 755 $(find . -type d) |
| 59 | + |
| 60 | +# The entrypoint for AWS is to invoke the handler function within the app package |
| 61 | +CMD [ "/app/app.handler" ] |
0 commit comments