Skip to content

Commit 0bc64db

Browse files
authored
Add additional packaging and pipeline tools, and update Conan (#4)
1 parent 6ccb462 commit 0bc64db

File tree

9 files changed

+85
-48
lines changed

9 files changed

+85
-48
lines changed

.github/workflows/debian.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
env:
1010
CONTAINER_REGISTRY: ghcr.io
1111
BUILDKIT_PROGRESS: plain
12-
CONAN_VERSION: 2.17.0
12+
CONAN_VERSION: 2.18.0
13+
GCOVR_VERSION: 8.3
1314
NONROOT_USER: ci
1415
FALLBACK_GCC: 12
1516
FALLBACK_CLANG: 16
@@ -98,9 +99,9 @@ jobs:
9899
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
99100
BUILDKIT_INLINE_CACHE=1
100101
CLANG_VERSION=${{ matrix.os.compiler_name == 'clang' && matrix.os.compiler_version || env.FALLBACK_CLANG }}
101-
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
102102
CONAN_VERSION=${{ env.CONAN_VERSION }}
103-
GITHUB_REPO=${{ github.repository }}
103+
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
104+
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
104105
NONROOT_USER=${{ env.NONROOT_USER }}
105106
DEBIAN_VERSION=${{ matrix.os.release }}
106107
context: docker/debian

.github/workflows/rhel.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ env:
1010
CONTAINER_REGISTRY: ghcr.io
1111
REDHAT_REGISTRY: registry.redhat.io
1212
BUILDKIT_PROGRESS: plain
13-
CONAN_VERSION: 2.17.0
13+
CONAN_VERSION: 2.18.0
14+
GCOVR_VERSION: 8.3
1415
NONROOT_USER: ci
1516

1617
jobs:
@@ -90,7 +91,7 @@ jobs:
9091
BUILDKIT_INLINE_CACHE=1
9192
CONAN_VERSION=${{ env.CONAN_VERSION }}
9293
GCC_VERSION=${{ matrix.os.compiler_version }}
93-
GITHUB_REPO=${{ github.repository }}
94+
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
9495
NONROOT_USER=${{ env.NONROOT_USER }}
9596
RHEL_VERSION=${{ matrix.os.release }}
9697
context: docker/rhel

.github/workflows/ubuntu.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
env:
1010
CONTAINER_REGISTRY: ghcr.io
1111
BUILDKIT_PROGRESS: plain
12-
CONAN_VERSION: 2.17.0
12+
CONAN_VERSION: 2.18.0
13+
GCOVR_VERSION: 8.3
1314
NONROOT_USER: ci
1415
FALLBACK_GCC: 12
1516
FALLBACK_CLANG: 16
@@ -96,9 +97,9 @@ jobs:
9697
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
9798
BUILDKIT_INLINE_CACHE=1
9899
CLANG_VERSION=${{ matrix.os.compiler_name == 'clang' && matrix.os.compiler_version || env.FALLBACK_CLANG }}
99-
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
100100
CONAN_VERSION=${{ env.CONAN_VERSION }}
101-
GITHUB_REPO=${{ github.repository }}
101+
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
102+
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
102103
NONROOT_USER=${{ env.NONROOT_USER }}
103104
UBUNTU_VERSION=${{ matrix.os.release }}
104105
context: docker/ubuntu

docker/debian/Dockerfile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
2626
apt update
2727
apt upgrade -y
2828
apt install -y tzdata
29+
apt clean
30+
rm -rf /var/lib/apt/lists/*
2931
dpkg-reconfigure --frontend noninteractive tzdata
3032
EOF
3133

@@ -38,6 +40,8 @@ pkgs+=(bison) # Required build tool.
3840
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
3941
pkgs+=(cmake) # Required build tool.
4042
pkgs+=(curl) # Dependency for tools requiring downloading data.
43+
pkgs+=(dpkg-dev) # Required packaging tool.
44+
pkgs+=(file) # Required packaging tool.
4145
pkgs+=(flex) # Required build tool.
4246
pkgs+=(git) # Required build tool.
4347
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
@@ -47,15 +51,19 @@ pkgs+=(ninja-build) # Required build tool.
4751
pkgs+=(pipx) # Package manager for Python applications.
4852
pkgs+=(wget) # Required build tool.
4953
apt update
50-
apt install -y "${pkgs[@]}"
54+
apt install -y --no-install-recommends "${pkgs[@]}"
55+
apt clean
56+
rm -rf /var/lib/apt/lists/*
5157
EOF
5258

53-
# Install Conan.
59+
# Install Python-based tools.
5460
ARG CONAN_VERSION
55-
RUN PIPX_HOME=/opt/pipx \
61+
ARG GCOVR_VERSION
62+
ENV PIPX_HOME=/opt/pipx \
5663
PIPX_BIN_DIR=/usr/bin \
57-
PIPX_MAN_DIR=/usr/share/man \
58-
pipx install conan==${CONAN_VERSION}
64+
PIPX_MAN_DIR=/usr/share/man
65+
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
66+
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}
5967

6068
# Create the user to switch to, once all packages have been installed.
6169
ARG NONROOT_USER
@@ -91,9 +99,6 @@ EOF
9199
ENV CC=/usr/bin/gcc
92100
ENV CXX=/usr/bin/g++
93101

94-
# Clean up unnecessary files to reduce image size.
95-
RUN rm -rf /var/lib/apt/lists/* && apt clean
96-
97102
# Switch to the non-root user.
98103
USER ${NONROOT_USER}
99104
WORKDIR /home/${NONROOT_USER}
@@ -128,13 +133,12 @@ printf "%s\n%s\n" \
128133
| tee /etc/apt/sources.list.d/llvm.list
129134
apt update
130135
apt install -t llvm-toolchain-${DEBIAN_VERSION}-${CLANG_VERSION} -y --no-install-recommends clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
136+
apt clean
137+
rm -rf /var/lib/apt/lists/*
131138
EOF
132139
ENV CC=/usr/bin/clang-${CLANG_VERSION}
133140
ENV CXX=/usr/bin/clang++-${CLANG_VERSION}
134141

135-
# Clean up unnecessary files to reduce image size.
136-
RUN rm -rf /var/lib/apt/lists/* && apt clean
137-
138142
# Switch to the non-root user.
139143
USER ${NONROOT_USER}
140144
WORKDIR /home/${NONROOT_USER}

docker/debian/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ registry.
4040
NONROOT_USER=${USER}
4141
DEBIAN_VERSION=bookworm
4242
GCC_VERSION=12
43-
CONAN_VERSION=2.17.0
43+
CONAN_VERSION=2.18.0
44+
GCOVR_VERSION=8.3
4445
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:gcc-${GCC_VERSION}
4546

4647
docker buildx build . \
@@ -50,6 +51,7 @@ docker buildx build . \
5051
--build-arg CONAN_VERSION=${CONAN_VERSION} \
5152
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
5253
--build-arg GCC_VERSION=${GCC_VERSION} \
54+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
5355
--build-arg NONROOT_USER=${NONROOT_USER} \
5456
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
5557
```
@@ -63,7 +65,8 @@ registry.
6365
NONROOT_USER=${USER}
6466
DEBIAN_VERSION=bookworm
6567
CLANG_VERSION=17
66-
CONAN_VERSION=2.17.0
68+
CONAN_VERSION=2.18.0
69+
GCOVR_VERSION=8.3
6770
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:clang-${CLANG_VERSION}
6871

6972
docker buildx build . \
@@ -73,6 +76,7 @@ docker buildx build . \
7376
--build-arg CLANG_VERSION=${CLANG_VERSION} \
7477
--build-arg CONAN_VERSION=${CONAN_VERSION} \
7578
--build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
79+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
7680
--build-arg NONROOT_USER=${NONROOT_USER} \
7781
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
7882
```

docker/rhel/Dockerfile

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,30 @@ RUN <<EOF
2222
pkgs=()
2323
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
2424
pkgs+=(cmake) # Required build tool.
25+
pkgs+=(file) # Required packaging tool.
2526
pkgs+=(git) # Required build tool.
2627
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
2728
pkgs+=(jq) # Pretty printing.
2829
pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
2930
pkgs+=(ninja-build) # Required build tool.
3031
pkgs+=(perl-FindBin) # Required to compile OpenSSL.
3132
pkgs+=(python3-pip) # Package manager for Python applications.
33+
pkgs+=(rpm-build) # Required packaging tool.
34+
pkgs+=(rpmdevtools) # Required packaging tool.
3235
pkgs+=(wget) # Required build tool.
3336
dnf install -y --setopt=tsflags=nodocs "${pkgs[@]}"
37+
dnf -y clean all
38+
rm -rf /var/cache/dnf/*
3439
EOF
3540

3641
# Copy Bison and Flex from the Rocky Linux image.
3742
COPY --from=rocky /usr/bin/bison /usr/bin/bison
3843
COPY --from=rocky /usr/bin/flex /usr/bin/flex
3944

40-
# Install Conan.
45+
# Install Python-based tools.
4146
ARG CONAN_VERSION
42-
RUN pip install conan==${CONAN_VERSION}
47+
ARG GCOVR_VERSION
48+
RUN pip install --no-cache conan==${CONAN_VERSION} gcovr==${GCOVR_VERSION}
4349

4450
# Create the user to switch to, once all packages have been installed.
4551
ARG NONROOT_USER
@@ -50,13 +56,14 @@ FROM base AS gcc
5056

5157
# Install GCC.
5258
ARG GCC_VERSION
53-
RUN dnf install -y --setopt=tsflags=nodocs gcc-toolset-${GCC_VERSION}-gcc gcc-toolset-${GCC_VERSION}-gcc-c++
59+
RUN <<EOF
60+
dnf install -y --setopt=tsflags=nodocs gcc-toolset-${GCC_VERSION}-gcc gcc-toolset-${GCC_VERSION}-gcc-c++
61+
dnf -y clean all
62+
rm -rf /var/cache/dnf/*
63+
EOF
5464
ENV CC=/usr/bin/gcc
5565
ENV CXX=/usr/bin/g++
5666

57-
# Clean up unnecessary files to reduce image size.
58-
RUN dnf -y clean all
59-
6067
# Switch to the non-root user.
6168
USER ${NONROOT_USER}
6269
WORKDIR /home/${NONROOT_USER}
@@ -84,13 +91,14 @@ FROM base AS clang
8491

8592
# Install Clang. Note that in the RHEL UBIs, we cannot choose the Clang version
8693
# to install and we get what is available.
87-
RUN dnf install -y --setopt=tsflags=nodocs clang llvm
94+
RUN <<EOF
95+
dnf install -y --setopt=tsflags=nodocs clang llvm
96+
dnf -y clean all
97+
rm -rf /var/cache/dnf/*
98+
EOF
8899
ENV CC=/usr/bin/clang
89100
ENV CXX=/usr/bin/clang++
90101

91-
# Clean up unnecessary files to reduce image size.
92-
RUN dnf -y clean all
93-
94102
# Switch to the non-root user.
95103
USER ${NONROOT_USER}
96104
WORKDIR /home/${NONROOT_USER}

docker/rhel/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ registry.
5959
NONROOT_USER=${USER}
6060
RHEL_VERSION=9.6
6161
GCC_VERSION=13
62-
CONAN_VERSION=2.17.0
62+
CONAN_VERSION=2.18.0
63+
GCOVR_VERSION=8.3
6364
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:gcc-${GCC_VERSION}
6465

6566
docker buildx build . \
@@ -68,6 +69,7 @@ docker buildx build . \
6869
--build-arg BUILDKIT_INLINE_CACHE=1 \
6970
--build-arg CONAN_VERSION=${CONAN_VERSION} \
7071
--build-arg GCC_VERSION=${GCC_VERSION} \
72+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
7173
--build-arg NONROOT_USER=${NONROOT_USER} \
7274
--build-arg RHEL_VERSION=${RHEL_VERSION} \
7375
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
@@ -81,14 +83,16 @@ registry.
8183
```shell
8284
NONROOT_USER=${USER}
8385
RHEL_VERSION=9.6
84-
CONAN_VERSION=2.17.0
86+
CONAN_VERSION=2.18.0
87+
GCOVR_VERSION=8.3
8588
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:clang-${CLANG_VERSION}
8689

8790
docker buildx build . \
8891
--target clang \
8992
--build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom \
9093
--build-arg BUILDKIT_INLINE_CACHE=1 \
9194
--build-arg CONAN_VERSION=${CONAN_VERSION} \
95+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
9296
--build-arg NONROOT_USER=${NONROOT_USER} \
9397
--build-arg RHEL_VERSION=${RHEL_VERSION} \
9498
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}

docker/ubuntu/Dockerfile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
1515
apt update
1616
apt upgrade -y
1717
apt install -y tzdata
18+
apt clean
19+
rm -rf /var/lib/apt/lists/*
1820
dpkg-reconfigure --frontend noninteractive tzdata
1921
EOF
2022

@@ -27,6 +29,8 @@ pkgs+=(bison) # Required build tool.
2729
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
2830
pkgs+=(cmake) # Required build tool.
2931
pkgs+=(curl) # Dependency for tools requiring downloading data.
32+
pkgs+=(dpkg-dev) # Required packaging tool.
33+
pkgs+=(file) # Required packaging tool.
3034
pkgs+=(flex) # Required build tool.
3135
pkgs+=(git) # Required build tool.
3236
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
@@ -36,15 +40,19 @@ pkgs+=(ninja-build) # Required build tool.
3640
pkgs+=(pipx) # Package manager for Python applications.
3741
pkgs+=(wget) # Required build tool.
3842
apt update
39-
apt install -y "${pkgs[@]}"
43+
apt install -y --no-install-recommends "${pkgs[@]}"
44+
apt clean
45+
rm -rf /var/lib/apt/lists/*
4046
EOF
4147

42-
# Install Conan.
48+
# Install Python-based tools.
4349
ARG CONAN_VERSION
44-
RUN PIPX_HOME=/opt/pipx \
50+
ARG GCOVR_VERSION
51+
ENV PIPX_HOME=/opt/pipx \
4552
PIPX_BIN_DIR=/usr/bin \
46-
PIPX_MAN_DIR=/usr/share/man \
47-
pipx install conan==${CONAN_VERSION}
53+
PIPX_MAN_DIR=/usr/share/man
54+
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
55+
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}
4856

4957
# Create the user to switch to, once all packages have been installed.
5058
ARG NONROOT_USER
@@ -55,13 +63,14 @@ FROM base AS gcc
5563

5664
# Install GCC.
5765
ARG GCC_VERSION
58-
RUN apt install -y gcc-${GCC_VERSION} g++-${GCC_VERSION}
66+
RUN <<EOF
67+
apt install -y gcc-${GCC_VERSION} g++-${GCC_VERSION}
68+
apt clean
69+
rm -rf /var/lib/apt/lists/*
70+
EOF
5971
ENV CC=/usr/bin/gcc-${GCC_VERSION}
6072
ENV CXX=/usr/bin/g++-${GCC_VERSION}
6173

62-
# Clean up unnecessary files to reduce image size.
63-
RUN rm -rf /var/lib/apt/lists/* && apt clean
64-
6574
# Switch to the non-root user.
6675
USER ${NONROOT_USER}
6776
WORKDIR /home/${NONROOT_USER}
@@ -85,13 +94,14 @@ FROM base AS clang
8594

8695
# Install Clang.
8796
ARG CLANG_VERSION
88-
RUN apt install -y clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
97+
RUN <<EOF
98+
apt install -y clang-${CLANG_VERSION} llvm-${CLANG_VERSION}
99+
apt clean
100+
rm -rf /var/lib/apt/lists/*
101+
EOF
89102
ENV CC=/usr/bin/clang-${CLANG_VERSION}
90103
ENV CXX=/usr/bin/clang++-${CLANG_VERSION}
91104

92-
# Clean up unnecessary files to reduce image size.
93-
RUN rm -rf /var/lib/apt/lists/* && apt clean
94-
95105
# Switch to the non-root user.
96106
USER ${NONROOT_USER}
97107
WORKDIR /home/${NONROOT_USER}

docker/ubuntu/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ registry.
4040
NONROOT_USER=${USER}
4141
UBUNTU_VERSION=noble
4242
GCC_VERSION=14
43-
CONAN_VERSION=2.17.0
43+
CONAN_VERSION=2.18.0
44+
GCOVR_VERSION=8.3
4445
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:gcc-${GCC_VERSION}
4546

4647
docker buildx build . \
@@ -49,6 +50,7 @@ docker buildx build . \
4950
--build-arg BUILDKIT_INLINE_CACHE=1 \
5051
--build-arg CONAN_VERSION=${CONAN_VERSION} \
5152
--build-arg GCC_VERSION=${GCC_VERSION} \
53+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
5254
--build-arg NONROOT_USER=${NONROOT_USER} \
5355
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
5456
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
@@ -63,7 +65,8 @@ registry.
6365
NONROOT_USER=${USER}
6466
UBUNTU_VERSION=noble
6567
CLANG_VERSION=18
66-
CONAN_VERSION=2.17.0
68+
CONAN_VERSION=2.18.0
69+
GCOVR_VERSION=8.3
6770
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:clang-${CLANG_VERSION}
6871

6972
docker buildx build . \
@@ -72,6 +75,7 @@ docker buildx build . \
7275
--build-arg BUILDKIT_INLINE_CACHE=1 \
7376
--build-arg CLANG_VERSION=${CLANG_VERSION} \
7477
--build-arg CONAN_VERSION=${CONAN_VERSION} \
78+
--build-arg GCOVR_VERSION=${GCOVR_VERSION} \
7579
--build-arg NONROOT_USER=${NONROOT_USER} \
7680
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
7781
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}

0 commit comments

Comments
 (0)