forked from flyteorg/flytekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
63 lines (51 loc) · 2.42 KB
/
Dockerfile.dev
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This Dockerfile is here to help with end-to-end testing
# From flytekit
# $ docker build -f Dockerfile.dev --build-arg PYTHON_VERSION=3.10 -t localhost:30000/flytekittest:someversion .
# $ docker push localhost:30000/flytekittest:someversion
# From your test user code
# $ pyflyte run --image localhost:30000/flytekittest:someversion
ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim-bookworm
LABEL org.opencontainers.image.authors="Flyte Team <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/flyteorg/flytekit
WORKDIR /root
ENV FLYTE_SDK_RICH_TRACEBACKS=0
# Flytekit version of flytekit to be installed in the image
ARG PSEUDO_VERSION=1.13.3
# Note: Pod tasks should be exposed in the default image
# Note: Some packages will create config files under /home by default, so we need to make sure it's writable
# Note: There are use cases that require reading and writing files under /tmp, so we need to change its permissions.
# Run a series of commands to set up the environment:
# 1. Update and install dependencies.
# 2. Install Flytekit and its plugins.
# 3. Clean up the apt cache to reduce image size. Reference: https://gist.github.com/marvell/7c812736565928e602c4
# 4. Create a non-root user 'flytekit' and set appropriate permissions for directories.
RUN apt-get update && apt-get install build-essential vim libmagic1 git -y \
&& pip install uv
COPY . /flytekit
# Use a future version of SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FLYTEIDL such that uv resolution works.
RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FLYTEKIT=$PSEUDO_VERSION \
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FLYTEIDL=3.0.0dev0 \
uv pip install --system --no-cache-dir -U \
"git+https://github.com/flyteorg/flyte.git@master#subdirectory=flyteidl" \
-e /flytekit \
-e /flytekit/plugins/flytekit-deck-standard \
-e /flytekit/plugins/flytekit-flyteinteractive \
markdown \
pandas \
pillow \
plotly \
pyarrow \
pygments \
scikit-learn \
ydata-profiling \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
&& useradd -u 1000 flytekit \
&& chown flytekit: /root \
&& chown flytekit: /home \
&& :
ENV PYTHONPATH="/flytekit:/flytekit/tests/flytekit/integration/remote"
# Switch to the 'flytekit' user for better security.
USER flytekit