This is an automated email from the ASF dual-hosted git repository. mck pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra-builds.git
The following commit(s) were added to refs/heads/trunk by this push: new 45f2425 ninja-fix š„· remove centos7 and use vault mirror for ant-junit rpm download 45f2425 is described below commit 45f2425dd2ec861b33943c819f3cc31644d1ce18 Author: Mick Semb Wever <m...@apache.org> AuthorDate: Mon Jul 22 10:20:19 2024 +0200 ninja-fix š„· remove centos7 and use vault mirror for ant-junit rpm download --- build-scripts/cassandra-rpm-packaging.sh | 14 ++---- docker/almalinux-image.docker | 2 +- docker/centos7-image.docker | 84 -------------------------------- 3 files changed, 5 insertions(+), 95 deletions(-) diff --git a/build-scripts/cassandra-rpm-packaging.sh b/build-scripts/cassandra-rpm-packaging.sh index c8ba817..1c0aaef 100755 --- a/build-scripts/cassandra-rpm-packaging.sh +++ b/build-scripts/cassandra-rpm-packaging.sh @@ -25,31 +25,25 @@ rpm_dist=$3 [ "x${java_version}" != "x" ] || java_version="8" [ "x${rpm_dist}" != "x" ] || rpm_dist="rpm" -if [ "${rpm_dist}" == "rpm" ]; then - dist_name="almalinux" -else # noboolean - dist_name="centos7" -fi - # pre-conditions command -v docker >/dev/null 2>&1 || { echo >&2 "docker needs to be installed"; exit 1; } (docker info >/dev/null 2>&1) || { echo >&2 "docker needs to running"; exit 1; } [ -d "${cassandra_builds_dir}" ] || { echo >&2 "cassandra-builds directory must exist"; exit 1; } -[ -f "${cassandra_builds_dir}/docker/${dist_name}-image.docker" ] || { echo >&2 "docker/${dist_name}-image.docker must exist"; exit 1; } +[ -f "${cassandra_builds_dir}/docker/almalinux-image.docker" ] || { echo >&2 "docker/almalinux-image.docker must exist"; exit 1; } [ -f "${cassandra_builds_dir}/docker/build-rpms.sh" ] || { echo >&2 "docker/build-rpms.sh must exist"; exit 1; } # remove any previous older built images -docker image prune --all --force --filter label=org.cassandra.buildenv=${dist_name} --filter "until=4h" || true +docker image prune --all --force --filter label=org.cassandra.buildenv=almalinux --filter "until=4h" || true pushd $cassandra_builds_dir # Create build images containing the build tool-chain, Java and an Apache Cassandra git working directory, with retry -until docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-${dist_name}:${sha} -f docker/${dist_name}-image.docker docker/ ; do echo "docker build failed⦠trying again in 10s⦠" ; sleep 10 ; done +until docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-almalinux:${sha} -f docker/almalinux-image.docker docker/ ; do echo "docker build failed⦠trying again in 10s⦠" ; sleep 10 ; done # Run build script through docker (specify branch, tag, or sha) mkdir -p ~/.m2/repository -docker run --rm -v "${rpm_dir}":/dist -v ~/.m2/repository/:/home/build/.m2/repository/ cassandra-artifacts-${dist_name}:${sha} /home/build/build-rpms.sh ${sha} ${java_version} ${rpm_dist} +docker run --rm -v "${rpm_dir}":/dist -v ~/.m2/repository/:/home/build/.m2/repository/ cassandra-artifacts-almalinux:${sha} /home/build/build-rpms.sh ${sha} ${java_version} ${rpm_dist} popd diff --git a/docker/almalinux-image.docker b/docker/almalinux-image.docker index f6224a7..6a3c90a 100644 --- a/docker/almalinux-image.docker +++ b/docker/almalinux-image.docker @@ -31,7 +31,7 @@ RUN yum -y install \ python3-pip \ procps -RUN until curl -f -S -s --retry 9 --retry-connrefused --retry-delay 1 http://mirror.centos.org/centos/7/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; done +RUN until curl -f -S -s --retry 9 --retry-connrefused --retry-delay 1 https://vault.centos.org/7.9.2009/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; done RUN rpm -i --nodeps ant-junit-1.9.4-2.el7.noarch.rpm diff --git a/docker/centos7-image.docker b/docker/centos7-image.docker deleted file mode 100644 index 814392e..0000000 --- a/docker/centos7-image.docker +++ /dev/null @@ -1,84 +0,0 @@ -FROM centos:7 - -ENV BUILD_HOME=/home/build -ENV RPM_BUILD_DIR=$BUILD_HOME/rpmbuild -ENV RPM_DIST_DIR=/dist -ENV CASSANDRA_DIR=$BUILD_HOME/cassandra -ENV ANT_VERSION=1.10.12 -ARG UID_ARG=1000 -ARG GID_ARG=1000 - -LABEL org.cassandra.buildenv=centos - -VOLUME ${RPM_DIST_DIR} - -RUN echo "Building with arguments:" \ - && echo " - DEB_DIST_DIR=${DEB_DIST_DIR}" \ - && echo " - BUILD_HOME=${BUILD_HOME}" \ - && echo " - CASSANDRA_DIR=${CASSANDRA_DIR}" \ - && echo " - UID_ARG=${UID_ARG}" \ - && echo " - GID_ARG=${GID_ARG}" - -# install deps -RUN yum -y install \ - ant \ - git \ - java-1.8.0-openjdk-devel \ - java-11-openjdk-devel \ - make \ - rpm-build \ - sudo \ - python3-pip - -RUN until curl -f -S -s --retry 9 --retry-delay 1 http://mirror.centos.org/centos/7/os/x86_64/Packages/ant-junit-1.9.4-2.el7.noarch.rpm -o ant-junit-1.9.4-2.el7.noarch.rpm ; do echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; done - -RUN rpm -i --nodeps ant-junit-1.9.4-2.el7.noarch.rpm - -# try first downloads.a.o and then archive.a.o (as the latter has a 5GB per IP daily limit) -RUN until curl -f -S -s --retry 9 --retry-delay 1 https://downloads.apache.org/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz -o apache-ant-${ANT_VERSION}-bin.tar.gz || curl -f -S -s --retry 9 --retry-delay 1 https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz -o apache-ant-${ANT_VERSION}-bin.tar.gz ; do echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; done - -RUN rm -rf /etc/ant.conf -RUN tar xvf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt -RUN ln -sfn /opt/apache-ant-${ANT_VERSION} /opt/ant -RUN sh -c 'echo ANT_HOME=/opt/ant >> /etc/environment' -RUN ln -sfn /opt/ant/bin/ant /usr/bin/ant - -# jdk17 latest on x64 -RUN if [ "$(arch)" == "x86_64" ] ; then \ - until curl -f -S -s --retry 9 --retry-delay 1 https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz -o openjdk-17_bin.tar.gz ; do \ - echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; \ - done \ - fi - -# jdk17 latest on arm -RUN if [ "$(arch)" == "aarch64" ] ; then \ - until curl -f -S -s --retry 9 --retry-delay 1 https://download.oracle.com/java/17/latest/jdk-17_linux-aarch64_bin.tar.gz -o openjdk-17_bin.tar.gz ; do \ - echo "curl failed⦠trying again in 10s⦠" ; sleep 10 ; \ - done \ - fi - -RUN tar xvf openjdk-17_bin.tar.gz -RUN mv jdk-17* /opt/jdk-17 - -RUN alternatives --install /usr/bin/java java /opt/jdk-17/bin/java 2 --family java-17-openjdk -RUN alternatives --install /usr/bin/javac javac /opt/jdk-17/bin/javac 2 --family java-17-openjdk - -RUN pip3 install --upgrade pip - -# create and change to build user -RUN groupadd --gid ${GID_ARG} --non-unique build \ - && adduser --uid ${UID_ARG} --gid ${GID_ARG} build -RUN echo "build ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/build && \ - chmod 0440 /etc/sudoers.d/build - -USER build - -RUN mkdir -p $RPM_BUILD_DIR/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} - -# Clone Cassandra and cache maven artifacts -ARG CASSANDRA_GIT_URL=https://github.com/apache/cassandra.git -RUN git config --global http.postBuffer 524288000 -RUN git clone ${CASSANDRA_GIT_URL} ${CASSANDRA_DIR} -WORKDIR $CASSANDRA_DIR - -COPY build-rpms.sh $BUILD_HOME/ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org