Skip to content

Commit

Permalink
try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Oct 30, 2024
1 parent 1fe9986 commit ae6c402
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
17 changes: 9 additions & 8 deletions dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#compatability with Tensorflow 2.6.0 as per https://www.tensorflow.org/install/source#gpu
# syntax=docker/dockerfile:1.7-labs

ARG PYTHON_VERSION=3.12
ARG UBUNTU_VERSION=noble
ARG POETRY_VERSION=1.6.1
ARG CUDA_VERSION=12.6.1-base-ubuntu24.04

FROM python:$PYTHON_VERSION-slim as builder
FROM python:$PYTHON_VERSION-slim AS builder
ARG POETRY_VERSION

ENV POETRY_HOME=/opt/poetry
Expand Down Expand Up @@ -33,6 +34,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root

# get rid of all distro python3 packages - they cause conflicts and we don't need them.
RUN apt list | grep ^python3- | sed 's|/.*||' | xargs apt remove -y
RUN apt-get update && \
apt-get install --no-install-recommends -y software-properties-common && \
apt-get update && \
Expand All @@ -44,15 +47,13 @@ RUN apt-get update && \
apt-get clean

# make some useful symlinks that are expected to exist
RUN ln -sfn /usr/bin/lib/python${PYTHON_VERSION} /usr/bin/python3 & \
RUN ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 & \
ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/bin/python

COPY --from=builder /src/requirements.txt .
COPY --exclude=.* . .
RUN --mount=type=cache,target=/root/.cache \
python -m pip install --no-cache-dir --break-system-packages -r requirements.txt && rm requirements.txt

COPY . .
RUN python -m pip install --no-deps --break-system-packages . && rm -r /root/*
python -m pip install --break-system-packages --no-cache-dir -r requirements.txt && rm requirements.txt && \
python -m pip install --break-system-packages --no-deps . && rm -r /root/*
ENV CLEARML_AGENT_SKIP_PYTHON_ENV_INSTALL=1

CMD ["bash"]
16 changes: 8 additions & 8 deletions dockerfile.cpu_only
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#compatability with Tensorflow 2.6.0 as per https://www.tensorflow.org/install/source#gpu
# syntax=docker/dockerfile:1.7-labs
ARG PYTHON_VERSION=3.12
ARG UBUNTU_VERSION=noble
ARG POETRY_VERSION=1.6.1
Expand Down Expand Up @@ -26,19 +26,19 @@ RUN poetry export --extras="thot jobs" --without-hashes -f requirements.txt > re
FROM python:$PYTHON_VERSION
WORKDIR /root

# these are needed for ClearML
RUN apt-get update && \
apt-get install --no-install-recommends -y \
python3-pip \

git libsm6 libxext6 libxrender-dev libglib2.0-0
# these are needed for ClearML
git libsm6 libxext6 libxrender-dev libglib2.0-0 && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

COPY --from=builder /src/requirements.txt .
COPY --exclude=.* . .
RUN --mount=type=cache,target=/root/.cache \
python -m pip install --no-cache-dir --break-system-packages -r requirements.txt && rm requirements.txt

COPY . .
RUN python -m pip install --no-deps --break-system-packages . && rm -r /root/*
python -m pip install --no-cache-dir -r requirements.txt && rm requirements.txt && \
python -m pip install --no-deps . && rm -r /root/*
ENV CLEARML_AGENT_SKIP_PYTHON_ENV_INSTALL=1

CMD ["bash"]

0 comments on commit ae6c402

Please sign in to comment.