Skip to content

Commit

Permalink
replace pip with uv (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaya-a authored Apr 17, 2024
1 parent 1476cdf commit 492b990
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 74 deletions.
10 changes: 6 additions & 4 deletions .devcontainer/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ echo "Running mindctrl devcontainer entrypoint..."
echo "running original bootstrap"
bash devcontainer_bootstrap

echo "installing uv"
python3 -m pip install --upgrade uv

if [ -d "./.venv" ]; then
echo ".venv does exist."
else
echo "Create venv"
python3 -m venv ./.venv
uv venv
fi

echo "Activating venv"
source ./.venv/bin/activate
python -m pip install --upgrade pip

echo "install source"
python -m pip install -e ./python
uv pip install -e ./python

echo "install requirements"
python -m pip install -r ./tests/test-requirements.txt
uv pip install -r ./tests/test-requirements.txt


exec "$@"
4 changes: 2 additions & 2 deletions .github/workflows/integration-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/test-requirements.txt python/
python -m pip install --upgrade uv
uv pip install --system -r tests/test-requirements.txt python/
- name: Lint with Ruff
run: |
ruff check .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-k3d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/test-requirements.txt python/
python -m pip install --upgrade uv
uv pip install --system -r tests/test-requirements.txt python/
- name: Lint with Ruff
run: |
ruff check .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/test-requirements.txt python/
python -m pip install --upgrade uv
uv pip install --system -r tests/test-requirements.txt python/
- name: Lint with Ruff
run: |
ruff check .
Expand Down
8 changes: 3 additions & 5 deletions addons/mindctrl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ RUN set -eux; \
\
python3 --version

RUN pip3 --version


RUN pip3 install --no-cache --break-system-packages uv

ENV SENTENCE_TRANSFORMERS_HOME=/model_cache
ENV HF_HUB_CACHE=/model_cache
Expand All @@ -50,10 +48,10 @@ ENV TRAEFIK_ARCH=${BUILD_ARCH}
RUN /.context/install_traefik.sh

COPY requirements.txt /
RUN pip3 install --no-cache --break-system-packages -r /requirements.txt
RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt
# One day when builder workflow supports --build-context
# COPY --from=mindctrl_source / /pysrc
RUN pip3 install --no-cache --break-system-packages /.context/pysrc/
RUN uv pip install --no-cache --break-system-packages --python python3 /.context/pysrc/

RUN chmod a+x /usr/bin/run_tracking.sh && \
chmod a+x /usr/bin/run_gateway.sh && \
Expand Down
51 changes: 0 additions & 51 deletions python/src/mindctrl/Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions services/deployments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ RUN set -eux; \
\
python3 --version

RUN pip3 --version
RUN pip3 install --no-cache --break-system-packages uv

COPY requirements.txt /

RUN pip3 install --no-cache --break-system-packages -r /requirements.txt
RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt

COPY --from=mindctrl_source / /pysrc
RUN pip3 install --no-cache --break-system-packages /pysrc
RUN uv pip install --no-cache --break-system-packages --python python3 /pysrc

# mlflow deployments start-server --config-path /usr/bin/deployments/route-config.yaml --port 5001 --host 0.0.0.0
COPY route-config.yaml run_deployments_container.sh /
Expand Down
6 changes: 3 additions & 3 deletions services/multiserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ RUN set -eux; \
\
python3 --version

RUN pip3 --version
RUN pip3 install --no-cache --break-system-packages uv

COPY requirements.txt /

RUN pip3 install --no-cache --break-system-packages -r /requirements.txt
RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt

COPY --from=mindctrl_source / /pysrc
RUN pip3 install --no-cache --break-system-packages /pysrc
RUN uv pip install --no-cache --break-system-packages --python python3 /pysrc

COPY run_multiserver_container.sh /

Expand Down
4 changes: 2 additions & 2 deletions services/tracking/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ RUN set -eux; \
\
python3 --version

RUN pip3 --version
RUN pip3 install --no-cache --break-system-packages uv

COPY requirements.txt /

RUN pip3 install --no-cache --break-system-packages -r /requirements.txt
RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt

COPY run_tracking_container.sh /

Expand Down

0 comments on commit 492b990

Please sign in to comment.