Skip to content

Commit fbf0a42

Browse files
authored
Merge pull request #3073 from locustio/update-uv-and-optimize-docker-start-time
Update uv and optimize docker start time
2 parents 4c24bac + bff1603 commit fbf0a42

File tree

4 files changed

+241
-239
lines changed

4 files changed

+241
-239
lines changed

Diff for: .github/workflows/tests.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- uses: astral-sh/setup-uv@v5
4040
with:
41-
version: "0.5.26"
41+
version: "0.6.5"
4242
enable-cache: true
4343
cache-dependency-glob: "uv.lock"
4444

@@ -157,7 +157,7 @@ jobs:
157157

158158
- uses: astral-sh/setup-uv@v5
159159
with:
160-
version: "0.5.26"
160+
version: "0.6.5"
161161
enable-cache: true
162162
cache-dependency-glob: "uv.lock"
163163

@@ -296,7 +296,6 @@ jobs:
296296
type=raw,value=${{ needs.build_package.outputs.tag }}
297297
type=raw,value=${{ needs.build_package.outputs.branch }}
298298
299-
# Set up Docker daemon dependencies for building and publishing
300299
- uses: docker/login-action@v3
301300
with:
302301
username: locustbuild
@@ -306,8 +305,7 @@ jobs:
306305
- name: Set up Docker Buildx
307306
uses: docker/setup-buildx-action@v3
308307

309-
# Build and push Docker image
310-
- name: Build and push
308+
- name: Build and (optionally) push
311309
uses: docker/build-push-action@v6
312310
with:
313311
context: .
@@ -316,7 +314,6 @@ jobs:
316314
push: ${{ github.event_name != 'pull_request' }}
317315
tags: ${{ steps.docker_meta.outputs.tags }}
318316

319-
# Publish Python package
320317
- name: Publish prerelease version to PyPI
321318
uses: pypa/gh-action-pypi-publish@release/v1
322319
with:
@@ -325,7 +322,6 @@ jobs:
325322
skip-existing: true
326323

327324
# Publish UI lib
328-
# On commits to trunk
329325
- uses: borales/actions-yarn@v5
330326
name: Publish package on NPM
331327
if: github.ref == 'refs/heads/master'

Diff for: Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY --from=webui-builder locust/webui/dist locust/webui/dist
2929

3030
# Build the Python project
3131
ENV UV_PROJECT_ENVIRONMENT="/opt/venv"
32-
ADD https://astral.sh/uv/0.5.26/install.sh /uv-installer.sh
32+
ADD https://astral.sh/uv/0.6.5/install.sh /uv-installer.sh
3333
RUN sh /uv-installer.sh && rm /uv-installer.sh
3434
ENV PATH="/root/.local/bin/:$PATH"
3535
RUN uv build && \
@@ -44,6 +44,8 @@ ENV PYTHONUNBUFFERED=1
4444
RUN useradd --create-home locust
4545
# ensure correct permissions
4646
RUN chown -R locust /opt/venv
47+
# perform initial bytecode compilation (brings down total startup time from ~0.9s to ~0.6s)
48+
RUN locust --version
4749
USER locust
4850
WORKDIR /home/locust
4951
EXPOSE 8089 5557

Diff for: Dockerfile.ci

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ENV PYTHONUNBUFFERED=1
2323
RUN useradd --create-home locust
2424
# ensure correct permissions
2525
RUN chown -R locust /opt/venv
26+
# perform initial bytecode compilation (brings down total startup time from ~0.9s to ~0.6s)
27+
RUN locust --version
2628
USER locust
2729
WORKDIR /home/locust
2830
EXPOSE 8089 5557

0 commit comments

Comments
 (0)