This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git
The following commit(s) were added to refs/heads/main by this push:
new 3d20dbb rockylinux:8 - use heredocs and install ninja (#176)
3d20dbb is described below
commit 3d20dbbb6d4dcd14dd8286c3df41827cf97a8789
Author: Brian Neradt <[email protected]>
AuthorDate: Fri Jun 16 19:23:32 2023 -0500
rockylinux:8 - use heredocs and install ninja (#176)
---
docker/rockylinux8/Dockerfile | 155 +++++++++++++++++++++++++++++-------------
1 file changed, 108 insertions(+), 47 deletions(-)
diff --git a/docker/rockylinux8/Dockerfile b/docker/rockylinux8/Dockerfile
index 8fb5418..6456a88 100644
--- a/docker/rockylinux8/Dockerfile
+++ b/docker/rockylinux8/Dockerfile
@@ -1,95 +1,156 @@
FROM rockylinux:8
-RUN yum -y install epel-release dnf-plugins-core; yum config-manager
--set-enabled powertools; yum repolist; \
+#-------------------------------------------------------------------------------
+# Install the various system packages we use.
+#-------------------------------------------------------------------------------
+RUN <<EOF
+ set -e
- yum -y update; \
- # Compilers
- yum -y install ccache make pkgconfig bison flex gcc-c++ clang \
- # Autoconf
+ yum -y install epel-release dnf-plugins-core
+ yum config-manager --set-enabled powertools
+ yum repolist
+ yum -y update
+
+ # Build tools.
+ yum -y install \
+ ccache make pkgconfig bison flex gcc-c++ clang \
autoconf automake libtool \
- # Various other tools
- sudo git rpm-build distcc-server file wget openssl hwloc nghttp2
libnghttp2-devel; \
- # Devel packages that ATS needs
- yum -y install openssl-devel expat-devel pcre-devel libcap-devel
hwloc-devel libunwind-devel \
+ gcc-toolset-11 gcc-toolset-11-libasan-devel
+
+ # Various other tools
+ yum -y install \
+ sudo git rpm-build distcc-server file wget openssl hwloc \
+ nghttp2 libnghttp2-devel
+
+ # Devel packages that ATS needs
+ yum -y install \
+ openssl-devel expat-devel pcre-devel libcap-devel hwloc-devel
libunwind-devel \
xz-devel libcurl-devel ncurses-devel jemalloc-devel GeoIP-devel
luajit-devel brotli-devel \
ImageMagick-devel ImageMagick-c++-devel hiredis-devel zlib-devel
libmaxminddb-devel \
- perl-ExtUtils-MakeMaker perl-Digest-SHA perl-URI curl tcl-devel java; \
- # autest stuff
- yum -y install python3 httpd-tools procps-ng nmap-ncat python3-pip \
- python3-gunicorn python3-requests python3-devel python3-psutil telnet;
+ perl-ExtUtils-MakeMaker perl-Digest-SHA perl-URI curl tcl-devel java
-RUN pip3 install --upgrade pip
-RUN pip3 install pipenv httpbin
-RUN yum -y install gcc-toolset-11 gcc-toolset-11-libasan-devel
+ # autest stuff
+ yum -y install \
+ python3 httpd-tools procps-ng nmap-ncat python3-pip \
+ python3-gunicorn python3-requests python3-devel python3-psutil telnet
+EOF
+
+#-------------------------------------------------------------------------------
+# Install some custom build tools.
+#-------------------------------------------------------------------------------
+
+WORKDIR /root
# We put our custom packages in /opt.
-RUN echo 'PATH=/opt/bin:$PATH' | tee -a /etc/profile.d/opt_bin.sh
+RUN <<EOS
+ set -e
+ mkdir -p /opt/bin
+ chmod 755 /opt/bin
+ echo 'PATH=/opt/bin:$PATH' | tee -a /etc/profile.d/opt_bin.sh
+EOS
ARG PATH=/opt/bin:$PATH
# Install a recent cmake.
RUN yum remove -y cmake
-RUN \
- wget
https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-x86_64.sh;
\
- chmod +x cmake-3.26.3-linux-x86_64.sh; \
+RUN <<EOF
+ set -e
+ wget
https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-x86_64.sh
+ chmod +x cmake-3.26.3-linux-x86_64.sh
bash ./cmake-3.26.3-linux-x86_64.sh --skip-license --prefix=/opt
+ rm -f cmake-3.26.3-linux-x86_64.sh
+EOF
-# Install openssl-quic
-RUN yum install -y python38-devel cargo
+# Install the latest ninja, which has some performance improvements over the
+# older system version.
+RUN <<EOF
+ set -e
+ wget
https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip
+ unzip ninja-linux.zip
+ cp ninja /opt/bin
+ chmod 755 /opt/bin/
+ rm -f ninja ninja-linux.zip
+EOF
-RUN alternatives --set python /usr/bin/python3.8
-RUN yum -y install libev-devel jemalloc-devel libxml2-devel \
+RUN pip3 install --upgrade pip
+RUN pip3 install pipenv httpbin
+
+#-------------------------------------------------------------------------------
+# Install the HTTP/3 build tools, including openssl-quic.
+#-------------------------------------------------------------------------------
+RUN <<EOS
+ set -e
+ yum install -y python38-devel cargo
+ alternatives --set python /usr/bin/python3.8
+ yum -y install \
+ libev-devel jemalloc-devel libxml2-devel \
c-ares-devel libevent-devel jansson-devel zlib-devel systemd-devel
+EOS
# go and rust will be installed by build_h3_tools.
RUN yum remove -y golang rust
ARG h3_tools_dir=/root/build_h3_tools
RUN mkdir -p ${h3_tools_dir}
-WORKDIR ${h3_tools_dir}
COPY /build_h3_tools.sh ${h3_tools_dir}/build_h3_tools.sh
# This will install OpenSSL QUIC and related tools in /opt.
-RUN \
- bash ${h3_tools_dir}/build_h3_tools.sh; \
+RUN <<EOS
+ set -e
+ cd ${h3_tools_dir}
+ bash ${h3_tools_dir}/build_h3_tools.sh
+
+ # Removing the build dir is crucial to keeping the Docker image size
+ # reasonable.
rm -rf ${h3_tools_dir} /root/.rustup
-WORKDIR /root
+EOS
+
+#-------------------------------------------------------------------------------
+# Various CI Job and Test Requirements.
+#-------------------------------------------------------------------------------
+
+# Autests require some go applications.
+RUN <<EOS
+ set -e
+ echo 'export PATH=$PATH:/opt/go/bin' | tee -a /etc/profile.d/go.sh
+ echo 'export GOBIN=/opt/go/bin' | tee -a /etc/profile.d/go.sh
-# Install some of our needed go applications.
-RUN echo 'export PATH=$PATH:/opt/go/bin' | tee -a /etc/profile.d/go.sh
-RUN echo 'export GOBIN=/opt/go/bin' | tee -a /etc/profile.d/go.sh
-RUN \
- /opt/go/bin/go install github.com/summerwind/h2spec/cmd/h2spec@latest; \
+ /opt/go/bin/go install github.com/summerwind/h2spec/cmd/h2spec@latest
cp /root/go/bin/h2spec /opt/go/bin/
-RUN \
- /opt/go/bin/go install
github.com/mccutchen/go-httpbin/v2/cmd/[email protected]; \
+ /opt/go/bin/go install
github.com/mccutchen/go-httpbin/v2/cmd/[email protected]
cp /root/go/bin/go-httpbin /opt/go/bin/
+EOS
RUN update-crypto-policies --set LEGACY
-# Add the CI's test user. N.B: 1200 is the uid that our jenkins user is
-# configured with, so that has to be used. Otherwise there will be permissions
-# issues.
+# Add the CI's jenkins user.
+# N.B: 1200 is the uid that our jenkins user is configured with, so that has to
+# be used. Otherwise there will be permissions issues.
ARG username=jenkins
ARG uid=1200
-RUN useradd \
+RUN <<EOS
+ useradd \
--home-dir /home/${username} \
--groups users,wheel \
--uid ${uid} \
--shell /bin/bash \
--create-home \
${username}
-RUN echo "${username} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
-RUN chown -R ${username} /home/${username}
+ echo "${username} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
+ chown -R ${username} /home/${username}
+EOS
-# Install lcov requirements.
+# Install lcov.
RUN yum install -y perl-IO-Compress
ARG lcov_build_dir=/var/tmp/lcov_build_dir
RUN mkdir -p ${lcov_build_dir}
WORKDIR ${lcov_build_dir}
-RUN git clone https://github.com/linux-test-project/lcov.git; \
- cd lcov; \
- # v1.15 is required for g++ version 9 compiled files.
- git checkout v1.15; \
- make install
+RUN <<EOS
+ set -e
+ git clone https://github.com/linux-test-project/lcov.git
+ cd lcov
+ # v1.15 is required for g++ version 9 compiled files.
+ git checkout v1.15
+ make install
+EOS
WORKDIR /root
RUN rm -rf ${lcov_build_dir}