generated from lambda-feedback/evaluation-function-boilerplate-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (28 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
42 lines (28 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12 AS builder
RUN pip install poetry==1.8.3
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
COPY pyproject.toml poetry.lock ./
RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
poetry install --without dev --no-root
FROM ghcr.io/lambda-feedback/evaluation-function-base/python:3.12
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
# Precompile python files for faster startup
RUN python -m compileall -q .
# Copy the evaluation function to the app directory
COPY evaluation_function ./evaluation_function
# Command to start the evaluation function with
ENV FUNCTION_COMMAND="python"
# Args to start the evaluation function with
ENV FUNCTION_ARGS="-m,evaluation_function.main"
# # The transport to use for the RPC server
# ENV FUNCTION_RPC_TRANSPORT="ipc"
# Use file-based communication interface instead of RPC
# This handles larger payloads better (shimmy writes input to file, reads output from file)
# shimmy will append input/output file paths as the last two arguments
ENV FUNCTION_INTERFACE="file"
ENV LOG_LEVEL="debug"