diff --git a/tests/performance/Makefile b/tests/performance/Makefile index b963a55902d..aac962c759d 100644 --- a/tests/performance/Makefile +++ b/tests/performance/Makefile @@ -93,9 +93,9 @@ config: ## Create config for your locust tests @uv run locust_settings.py $(input) | tee "${ENV_FILE}" -.PHONY: build push -build: ## Build test image - docker build -t ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG} ./docker +.PHONY: build-test-image push-test-image +build-test-image: _check_venv_active ## Build test image + docker build --build-arg PYTHON_VERSION=$(shell python --version | cut -d' ' -f2) -t ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG} ./docker -push: ## Push test image to dockerhub +push-test-image: ## Push test image to dockerhub docker push ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG} diff --git a/tests/performance/docker/Dockerfile b/tests/performance/docker/Dockerfile index 48358dc1e7f..e2aaed05727 100644 --- a/tests/performance/docker/Dockerfile +++ b/tests/performance/docker/Dockerfile @@ -1,46 +1,13 @@ # syntax=docker/dockerfile:1 -ARG PYTHON_VERSION="3.11.9" -ARG UV_VERSION="0.5" -FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build -FROM python:${PYTHON_VERSION}-slim-bookworm AS base +ARG UV_VERSION="0.4" +FROM cruizba/ubuntu-dind:latest as base LABEL maintainer=bisgaard-itis -# NOTE: to list the latest version run `make` inside `scripts/apt-packages-versions` -ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm" - -# -------------------------- Install docker ------------------- -# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/] -RUN rm -f /etc/apt/apt.conf.d/docker-clean && \ - echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache -RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ - set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - gosu \ - ca-certificates \ - curl \ - gnupg \ - lsb-release \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - # only the cli is needed and we remove the unnecessary stuff again - docker-ce-cli=${DOCKER_APT_VERSION} \ - && apt-get remove -y\ - gnupg \ - curl \ - lsb-release \ - && apt-get clean -y\ - # verify that the binary works - && gosu nobody true - # Sets utf-8 encoding for Python et al ENV LANG=C.UTF-8 +ENV UV_PYTHON=3.11.9 # Turns off writing .pyc files; superfluous on an ephemeral container. ENV PYTHONDONTWRITEBYTECODE=1 \ @@ -50,19 +17,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ # those from our virtualenv. ENV PATH="${VIRTUAL_ENV}/bin:$PATH" - -# -------------------------- Build stage ------------------- -# Installs build/package management tools and third party dependencies -# -# + /build WORKDIR -# -FROM base AS build - ENV SC_BUILD_TARGET=build -RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ - set -eux \ - && apt-get update \ +RUN apt-get update \ && apt-get install -y --no-install-recommends \ build-essential \ curl \ @@ -70,7 +27,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ jq # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=uv_build /uv /uvx /bin/ +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}"