-
Notifications
You must be signed in to change notification settings - Fork 32
✨ Add docker test image for performance tests #7053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bisgaard-itis
merged 4 commits into
ITISFoundation:master
from
bisgaard-itis:docker-image-for-performance-tests
Jan 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG PYTHON_VERSION="3.11.9" | ||
| ARG UV_VERSION="0.4" | ||
| FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build | ||
| FROM python:${PYTHON_VERSION}-slim-bookworm 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" | ||
|
|
||
| # 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 \ | ||
bisgaard-itis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 | ||
|
|
||
| # Turns off writing .pyc files; superfluous on an ephemeral container. | ||
| ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
| VIRTUAL_ENV=/home/scu/.venv | ||
|
|
||
| # Ensures that the python and pip executables used in the image will be | ||
| # 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 \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| build-essential \ | ||
| curl \ | ||
| git \ | ||
| jq | ||
bisgaard-itis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv | ||
| COPY --from=uv_build /uv /uvx /bin/ | ||
|
|
||
| RUN uv venv "${VIRTUAL_ENV}" | ||
|
|
||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| uv pip install --upgrade \ | ||
| wheel \ | ||
| setuptools | ||
bisgaard-itis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| WORKDIR /test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| locust-plugins | ||
| parse | ||
| pydantic | ||
| pydantic-settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| --requirement _base.txt | ||
| locust-plugins |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.