From 4ad8b2e51c9023888449321aaefdf4b8b5237cf0 Mon Sep 17 00:00:00 2001 From: Henry Borchers Date: Mon, 4 Nov 2024 08:42:54 -0600 Subject: [PATCH] ci:bring back required dockerfiles for testing on linux --- ci/docker/python/linux/jenkins/Dockerfile | 11 +++++ ci/docker/python/linux/tox/Dockerfile | 53 +++++++++++++++++++++ ci/docker/python/linux/tox/apt-packages.txt | 16 +++++++ 3 files changed, 80 insertions(+) create mode 100644 ci/docker/python/linux/jenkins/Dockerfile create mode 100644 ci/docker/python/linux/tox/Dockerfile create mode 100644 ci/docker/python/linux/tox/apt-packages.txt diff --git a/ci/docker/python/linux/jenkins/Dockerfile b/ci/docker/python/linux/jenkins/Dockerfile new file mode 100644 index 000000000..24d3eb384 --- /dev/null +++ b/ci/docker/python/linux/jenkins/Dockerfile @@ -0,0 +1,11 @@ +FROM python:latest +RUN --mount=type=cache,target=/var/cache/apt \ + rm -f /etc/apt/apt.conf.d/docker-clean && \ + apt-get update && \ + apt-get install -yqq --no-install-recommends \ + libdbus-1-3 \ + libegl1 \ + libgl1-mesa-glx \ + libxkbcommon-x11-0 \ + && \ + rm -rf /var/lib/apt/lists/* diff --git a/ci/docker/python/linux/tox/Dockerfile b/ci/docker/python/linux/tox/Dockerfile new file mode 100644 index 000000000..06120b29d --- /dev/null +++ b/ci/docker/python/linux/tox/Dockerfile @@ -0,0 +1,53 @@ +ARG PIP_DOWNLOAD_CACHE=/.cache/pip +ARG UV_CACHE_DIR=/.cache/uv +ARG UV_EXTRA_INDEX_URL + +ARG PIPX_HOME=/pipx + +FROM ubuntu:22.04 AS wheel_builder_base +COPY ci/docker/python/linux/tox/apt-packages.txt /tmp/ +RUN apt-get update && \ + apt-get install -y software-properties-common gpg-agent --no-install-recommends && \ + add-apt-repository ppa:deadsnakes/ppa && \ + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata && \ + apt-get update && \ + < /tmp/apt-packages.txt xargs apt-get install -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV QT_QPA_PLATFORM="offscreen" + +ARG PIP_EXTRA_INDEX_URL +ARG PIP_INDEX_URL + +COPY requirements/ /tmp/python_requirements/requirements/ +COPY requirements-dev.txt /tmp/python_requirements +ARG UV_EXTRA_INDEX_URL +ENV UV_INDEX_STRATEGY=unsafe-best-match +RUN --mount=type=cache,target=/.cache/python \ + python3 -m pip install --cache-dir=/.cache/python/pip --upgrade pip && \ + python3 -m pip install --cache-dir=/.cache/python/pip --upgrade uv && \ + uv pip install --cache-dir=/.cache/python/uv --system -r /tmp/python_requirements/requirements-dev.txt tox-uv + +ARG PIP_DOWNLOAD_CACHE +ARG UV_CACHE_DIR +RUN mkdir -p ${PIP_DOWNLOAD_CACHE} && \ + chmod -R 777 ${PIP_DOWNLOAD_CACHE} && \ + mkdir -p ${UV_CACHE_DIR} && \ + chmod -R 777 ${UV_CACHE_DIR} + +ARG PIPX_HOME +ENV PIPX_HOME=${PIPX_HOME} +ENV PIPX_BIN_DIR=${PIPX_HOME}/bin +RUN --mount=type=cache,target=/.cache/python \ + python3 -m uv pip install --cache-dir=/.cache/python/uv --system --no-cache-dir pipx && \ + pipx ensurepath && \ + mkdir -p $PIPX_HOME && chmod -R 777 $PIPX_HOME + +ARG UV_CACHE_DIR +ARG PIP_DOWNLOAD_CACHE +ENV UV_CACHE_DIR=${UV_CACHE_DIR} +ENV PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE} + +WORKDIR /src +CMD ["tox", "--workdir", "/tmp/tox", "--recreate", "-p=auto"] diff --git a/ci/docker/python/linux/tox/apt-packages.txt b/ci/docker/python/linux/tox/apt-packages.txt new file mode 100644 index 000000000..147271e21 --- /dev/null +++ b/ci/docker/python/linux/tox/apt-packages.txt @@ -0,0 +1,16 @@ +python3-pip +python3.9-dev +python3.9-venv +python3.9-distutils +python3.10-dev +python3.10-distutils +python3.10-venv +python3.11-dev +python3.11-distutils +python3.11-venv +libxml2-dev +libxslt-dev +libgl1-mesa-dev +xvfb +libxkbcommon-x11-0 +x11-utils