Skip to content

Commit 628ad41

Browse files
committed
ci: use ubuntu 24.04 as base for testing on ci
1 parent 6609c49 commit 628ad41

File tree

4 files changed

+33
-27
lines changed

4 files changed

+33
-27
lines changed

ci/docker/linux/jenkins/Dockerfile

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ARG UV_CACHE_DIR=/.cache/uv
1414

1515
FROM ghcr.io/astral-sh/uv:latest AS uv_builder
1616

17-
FROM ubuntu:22.04 AS base_image
18-
RUN rm -f /etc/apt/apt.conf.d/docker-clean
19-
RUN --mount=type=cache,target=/var/cache/apt \
17+
FROM ubuntu:24.04 AS base_image
18+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
19+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
2020
DEBIAN_FRONTEND="noninteractive" apt-get update && \
2121
apt-get install -yqq software-properties-common gpg-agent --no-install-recommends && \
2222
apt-get -yqq install tzdata && \
@@ -32,14 +32,14 @@ RUN --mount=type=cache,target=/var/cache/apt \
3232
python3-pip \
3333
python3-venv \
3434
ca-certificates \
35-
software-properties-common \
36-
jq \
37-
unzip && \
38-
rm -rf /var/lib/apt/lists/*
35+
software-properties-common
36+
3937

4038
#==============================================================================
4139
FROM base_image AS dr_memory_builder
42-
RUN apt-get update && \
40+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
41+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
42+
apt-get update && \
4343
apt-get install -y --no-install-recommends wget
4444

4545
WORKDIR /drmemory
@@ -50,6 +50,10 @@ RUN wget --no-verbose https://github.com/DynamoRIO/drmemory/releases/download/re
5050

5151

5252
FROM base_image AS sonar_builder
53+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
54+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
55+
apt-get update && \
56+
apt-get install -yqq --no-install-recommends unzip
5357

5458
RUN case $(uname -m) in \
5559
x86_64) URL=https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip ;; \
@@ -65,37 +69,41 @@ RUN case $(uname -m) in \
6569

6670

6771
FROM base_image AS conan_builder
72+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
73+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
74+
DEBIAN_FRONTEND="noninteractive" apt-get update && \
75+
apt-get install -yqq --no-install-recommends jq
76+
6877
ARG CONAN_USER_HOME
6978
ARG PIP_EXTRA_INDEX_URL
7079
ARG PIP_INDEX_URL
7180
ARG UV_EXTRA_INDEX_URL
7281
ARG UV_INDEX_URL
7382

7483
COPY --from=uv_builder /uv /uvx /bin/
75-
COPY ci/docker/linux/shared/ensure_compiler_support_by_conan.py /tmp/ensure_compiler_support_by_conan.py
7684
ARG UV_CACHE_DIR
7785
ARG PIP_DOWNLOAD_CACHE
7886
ARG CONAN_CENTER_PROXY_V2_URL
7987
ARG CONAN_HOME
8088
ENV UV_PROJECT=/tmp/uv
8189
ENV UV_FROZEN=1
90+
ENV UV_PROJECT_ENVIRONMENT=/tmp/uv/venv
8291
COPY ci/docker/linux/jenkins/conan/profile.ini ${CONAN_HOME}/profiles/default
8392
COPY ci/docker/shared/conan/remotes.json ${CONAN_HOME}/remotes.json
8493
RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
8594
--mount=type=cache,target=${UV_CACHE_DIR} \
8695
--mount=type=bind,source=pyproject.toml,target=${UV_PROJECT}/pyproject.toml \
8796
--mount=type=bind,source=uv.lock,target=${UV_PROJECT}/uv.lock \
8897
--mount=type=bind,source=conanfile.py,target=/tmp/conanfile.py \
98+
--mount=type=tmpfs,target=${UV_PROJECT_ENVIRONMENT} \
8999
uv run --only-group=conan conan profile detect --exist-ok && \
90-
python3 /tmp/ensure_compiler_support_by_conan.py $(uv run --only-group=conan conan config home)/settings.yml 11.4 && \
91100
if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
92101
echo "Setting the conan center url for building cache: ${CONAN_CENTER_PROXY_V2_URL}" && \
93102
cp ${CONAN_HOME}/remotes.json /tmp/remotes.json && \
94103
uv run --only-group=conan conan remote update conan-center --url ${CONAN_CENTER_PROXY_V2_URL}; \
95104
fi && \
96105
uv run --only-group=conan conan install /tmp --build missing -pr:b=default && \
97106
uv run --only-group=conan conan cache clean "*" -b --source --build --temp && \
98-
rm -rf venv && \
99107
if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
100108
mv -f /tmp/remotes.json ${CONAN_HOME}/remotes.json; \
101109
fi
@@ -104,7 +112,7 @@ RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
104112
# shared files are needed to run the Build C++ Tests stage
105113

106114
FROM base_image
107-
115+
COPY --from=uv_builder /uv /uvx /bin/
108116
# -----------------------------------------------------------------------------
109117
# Install sonar build-wrapper
110118
# -----------------------------------------------------------------------------
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
{% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %}
12
[settings]
23
os=Linux
34
arch=x86_64
45
compiler=gcc
5-
compiler.version=11.4
6+
compiler.version={{version.major}}.{{version.minor}}
67
compiler.libcxx=libstdc++
78
build_type=Release
89
[options]

ci/docker/linux/tox/Dockerfile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ ARG UV_EXTRA_INDEX_URL
1313

1414
FROM ghcr.io/astral-sh/uv:latest AS uv_builder
1515

16-
FROM ubuntu:22.04 AS wheel_builder_base
17-
COPY ci/docker/linux/tox/apt-packages.txt /tmp/apt-packages.txt
16+
FROM ubuntu:24.04 AS wheel_builder_base
1817
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
19-
RUN rm -f /etc/apt/apt.conf.d/docker-clean
20-
RUN --mount=type=cache,target=/var/cache/apt \
18+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
19+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
20+
--mount=type=bind,source=ci/docker/linux/tox/apt-packages.txt,target=/tmp/apt-packages.txt \
2121
apt-get update && \
2222
apt-get install -yqq --no-install-recommends software-properties-common gpg-agent && \
2323
add-apt-repository ppa:deadsnakes/ppa && \
2424
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -yqq install --no-install-recommends tzdata && \
2525
apt-get update && \
26-
< /tmp/apt-packages.txt xargs apt-get install -yqq --no-install-recommends && \
27-
rm -rf /var/lib/apt/lists/*
26+
< /tmp/apt-packages.txt xargs apt-get install -yqq --no-install-recommends
2827

2928
ARG CONAN_USER_HOME
3029
RUN mkdir -p ${CONAN_USER_HOME}
@@ -33,20 +32,17 @@ FROM wheel_builder_base AS conan_builder
3332
COPY --from=uv_builder /uv /uvx /bin/
3433
ARG CONAN_USER_HOME
3534
ARG CONAN_HOME
36-
COPY ci/docker/linux/shared/ensure_compiler_support_by_conan.py /tmp/ensure_compiler_support_by_conan.py
3735
COPY ci/docker/shared/conan/remotes.json ${CONAN_HOME}/remotes.json
3836
COPY conanfile.py /tmp/conanfile.py
3937
ARG CONAN_CENTER_PROXY_V2_URL
40-
ARG PIP_EXTRA_INDEX_URL
41-
ARG PIP_INDEX_URL
4238
ARG UV_EXTRA_INDEX_URL
4339
ARG UV_INDEX_URL
44-
ARG PIP_DOWNLOAD_CACHE
4540
ARG UV_CACHE_DIR
4641
ENV UV_PROJECT=/tmp/uv
4742
ENV UV_FROZEN=1
48-
RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
49-
--mount=type=cache,target=${UV_CACHE_DIR} \
43+
ENV UV_PROJECT_ENVIRONMENT=/tmp/uv/venv
44+
RUN --mount=type=cache,target=${UV_CACHE_DIR} \
45+
--mount=type=tmpfs,target=${UV_PROJECT_ENVIRONMENT} \
5046
--mount=type=bind,source=pyproject.toml,target=${UV_PROJECT}/pyproject.toml \
5147
--mount=type=bind,source=uv.lock,target=${UV_PROJECT}/uv.lock \
5248
--mount=type=bind,source=conanfile.py,target=/tmp/conanfile.py \
@@ -68,7 +64,7 @@ RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
6864

6965
FROM wheel_builder_base
7066

71-
67+
COPY --from=uv_builder /uv /uvx /bin/
7268
ARG CONAN_USER_HOME
7369
ARG CONAN_HOME
7470
COPY --from=conan_builder --chmod=777 ${CONAN_HOME} ${CONAN_HOME}

ci/docker/linux/tox/conan/profile.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
{% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %}
12
[settings]
23
os=Linux
34
os_build=Linux
45
arch=x86_64
56
arch_build=x86_64
67
compiler=gcc
7-
compiler.version=11.4
8+
compiler.version={{version.major}}.{{version.minor}}
89
compiler.libcxx=libstdc++
910
build_type=Release
1011
[options]

0 commit comments

Comments
 (0)