Skip to content

Commit a5383fd

Browse files
authored
Merge branch 'master' into pr-osparc-move-service-extras-to-catalog2
2 parents 83d7b5f + 0273e7c commit a5383fd

File tree

2 files changed

+9
-52
lines changed

2 files changed

+9
-52
lines changed

tests/performance/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ config: ## Create config for your locust tests
9393
@uv run locust_settings.py $(input) | tee "${ENV_FILE}"
9494

9595

96-
.PHONY: build push
97-
build: ## Build test image
98-
docker build -t ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG} ./docker
96+
.PHONY: build-test-image push-test-image
97+
build-test-image: _check_venv_active ## Build test image
98+
docker build --build-arg PYTHON_VERSION="$(shell python --version | cut -d' ' -f2)" --build-arg UV_VERSION="$(shell uv --version | cut -d' ' -f2)" -t ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG} ./docker
9999

100-
push: ## Push test image to dockerhub
100+
push-test-image: ## Push test image to dockerhub
101101
docker push ${TEST_IMAGE_NAME}:${TEST_IMAGE_TAG}

tests/performance/docker/Dockerfile

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG PYTHON_VERSION="3.11.9"
4-
ARG UV_VERSION="0.5"
5-
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
6-
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
73

4+
FROM cruizba/ubuntu-dind:latest AS base
5+
ARG PYTHON_VERSION
86
LABEL maintainer=bisgaard-itis
97

10-
# NOTE: to list the latest version run `make` inside `scripts/apt-packages-versions`
11-
ENV DOCKER_APT_VERSION="5:26.1.4-1~debian.12~bookworm"
12-
13-
# -------------------------- Install docker -------------------
14-
# for docker apt caching to work this needs to be added: [https://vsupalov.com/buildkit-cache-mount-dockerfile/]
15-
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
16-
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
17-
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
18-
set -eux; \
19-
apt-get update; \
20-
apt-get install -y --no-install-recommends \
21-
gosu \
22-
ca-certificates \
23-
curl \
24-
gnupg \
25-
lsb-release \
26-
&& mkdir -p /etc/apt/keyrings \
27-
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
28-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
29-
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
30-
&& apt-get update \
31-
&& apt-get install -y --no-install-recommends \
32-
# only the cli is needed and we remove the unnecessary stuff again
33-
docker-ce-cli=${DOCKER_APT_VERSION} \
34-
&& apt-get remove -y\
35-
gnupg \
36-
curl \
37-
lsb-release \
38-
&& apt-get clean -y\
39-
# verify that the binary works
40-
&& gosu nobody true
41-
428
# Sets utf-8 encoding for Python et al
439
ENV LANG=C.UTF-8
10+
ENV UV_PYTHON=${PYTHON_VERSION}
4411

4512
# Turns off writing .pyc files; superfluous on an ephemeral container.
4613
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -50,27 +17,17 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
5017
# those from our virtualenv.
5118
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
5219

53-
54-
# -------------------------- Build stage -------------------
55-
# Installs build/package management tools and third party dependencies
56-
#
57-
# + /build WORKDIR
58-
#
59-
FROM base AS build
60-
6120
ENV SC_BUILD_TARGET=build
6221

63-
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
64-
set -eux \
65-
&& apt-get update \
22+
RUN apt-get update \
6623
&& apt-get install -y --no-install-recommends \
6724
build-essential \
6825
curl \
6926
git \
7027
jq
7128

7229
# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
73-
COPY --from=uv_build /uv /uvx /bin/
30+
COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /uvx /bin/
7431

7532
RUN uv venv "${VIRTUAL_ENV}"
7633

0 commit comments

Comments
 (0)