Skip to content

Commit df39a92

Browse files
authored
Move to uv in dstack-server Docker image (#2509)
1 parent 63ab0ad commit df39a92

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@v4
31-
- uses: actions/setup-python@v5
31+
- name: Set up uv
32+
uses: astral-sh/setup-uv@v5
3233
with:
3334
python-version: 3.11
34-
- run: python -m pip install pre-commit
35+
- run: uv tool install pre-commit
3536
- run: pre-commit run -a --show-diff-on-failure
3637

3738
frontend-build:

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: actions/setup-python@v5
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v5
2324
with:
2425
python-version: 3.11
25-
- run: python -m pip install pre-commit
26+
- run: uv tool install pre-commit
2627
- run: pre-commit run -a --show-diff-on-failure
2728

2829
frontend-build:

docker/server/release/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ RUN apt-get update && apt-get install -y \
1111
curl \
1212
software-properties-common \
1313
git \
14+
sqlite3 \
1415
&& rm -rf /var/lib/apt/lists/*
1516

1617
RUN if [ $(uname -m) = "aarch64" ]; then ARCH="arm64"; else ARCH="amd64"; fi && \
1718
curl https://github.com/benbjohnson/litestream/releases/download/v0.3.9/litestream-v0.3.9-linux-$ARCH.deb -O -L && \
1819
dpkg -i litestream-v0.3.9-linux-$ARCH.deb
1920

20-
RUN pip install "dstack[all]==$VERSION" --progress-bar off
21+
ADD https://astral.sh/uv/install.sh /uv-installer.sh
22+
RUN sh /uv-installer.sh && rm /uv-installer.sh
23+
ENV PATH="/root/.local/bin/:$PATH"
24+
25+
RUN uv tool install "dstack[all]==$VERSION"
2126

2227
COPY entrypoint.sh entrypoint.sh
2328
RUN chmod 777 entrypoint.sh

docker/server/stgn/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ RUN apt-get update && apt-get install -y \
99
curl \
1010
software-properties-common \
1111
git \
12+
sqlite3 \
1213
&& rm -rf /var/lib/apt/lists/*
1314

1415
RUN if [ $(uname -m) = "aarch64" ]; then ARCH="arm64"; else ARCH="amd64"; fi && \
1516
curl https://github.com/benbjohnson/litestream/releases/download/v0.3.9/litestream-v0.3.9-linux-$ARCH.deb -O -L && \
1617
dpkg -i litestream-v0.3.9-linux-$ARCH.deb
1718

19+
ADD https://astral.sh/uv/install.sh /uv-installer.sh
20+
RUN sh /uv-installer.sh && rm /uv-installer.sh
21+
ENV PATH="/root/.local/bin/:$PATH"
22+
23+
COPY pyproject.toml uv.lock README.md ./
1824
COPY src src
19-
COPY setup.py README.md ./
20-
RUN pip install '.[all]'
25+
RUN SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 uv sync --extra all
2126

2227
COPY docker/server/entrypoint.sh entrypoint.sh
2328
RUN chmod 777 entrypoint.sh

0 commit comments

Comments
 (0)