diff --git a/.build/README.md b/.build/README.md index 72a974afc4..c9ae0e468f 100644 --- a/.build/README.md +++ b/.build/README.md @@ -65,10 +65,6 @@ Build with a specific jdk: .build/docker/build-redhat.sh rpm 11 -Build with centos7 and a specific jdk: - - .build/docker/build-redhat.sh noboolean 11 - Running Tests ------------- diff --git a/.build/docker/_build-redhat.sh b/.build/docker/_build-redhat.sh index 6d76b30bd6..8ef72bf356 100755 --- a/.build/docker/_build-redhat.sh +++ b/.build/docker/_build-redhat.sh @@ -36,24 +36,6 @@ command -v rpmbuild >/dev/null 2>&1 || { echo >&2 "rpm-build needs to be install [ -d "${RPM_BUILD_DIR}/SOURCES" ] || mkdir -p ${RPM_BUILD_DIR}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} -if [ "$1" == "-h" ]; then - echo "$0 [-h] [dist_type]" - echo "dist types are [rpm, noboolean] and rpm is default" - exit 1 -fi - -RPM_DIST=$1 -[ "x${RPM_DIST}" != "x" ] || RPM_DIST="rpm" - -if [ "${RPM_DIST}" == "rpm" ]; then - RPM_SPEC="redhat/cassandra.spec" -elif [ "${RPM_DIST}" == "noboolean" ]; then # noboolean - RPM_SPEC="redhat/noboolean/cassandra.spec" -else - echo >&2 "Only rpm and noboolean are valid dist_type arguments. Got ${RPM_DIST}" - exit 1 -fi - ################################ # # Main @@ -116,7 +98,7 @@ cp ${DIST_DIR}/apache-cassandra-*-src.tar.gz ${RPM_BUILD_DIR}/SOURCES/ CASSANDRA_VERSION=${CASSANDRA_VERSION/-/\~} command -v python >/dev/null 2>&1 || alias python=/usr/bin/python3 -rpmbuild --define="version ${CASSANDRA_VERSION}" --define="revision ${CASSANDRA_REVISION}" --define="_topdir ${RPM_BUILD_DIR}" -ba ${RPM_SPEC} +rpmbuild --define="version ${CASSANDRA_VERSION}" --define="revision ${CASSANDRA_REVISION}" --define="_topdir ${RPM_BUILD_DIR}" -ba redhat/cassandra.spec cp ${RPM_BUILD_DIR}/SRPMS/*.rpm ${RPM_BUILD_DIR}/RPMS/noarch/*.rpm ${DIST_DIR} popd >/dev/null diff --git a/.build/docker/almalinux-build.docker b/.build/docker/almalinux-build.docker index c850942620..89832b67b3 100644 --- a/.build/docker/almalinux-build.docker +++ b/.build/docker/almalinux-build.docker @@ -49,7 +49,7 @@ RUN yum -y install \ procps \ rsync -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/.build/docker/build-redhat.sh b/.build/docker/build-redhat.sh index 35149855c7..4163ce9153 100755 --- a/.build/docker/build-redhat.sh +++ b/.build/docker/build-redhat.sh @@ -17,8 +17,8 @@ if [ "$1" == "-h" ]; then - echo "$0 [-h] [rpm|noboolean] []" - echo " build redhat packages, specify noboolean for centos7 compatibility" + echo "$0 [-h] [rpm] []" + echo " build redhat packages" exit 1 fi @@ -26,13 +26,11 @@ fi rpm_dist=$1 java_version=$2 -if [ "${rpm_dist}" == "noboolean" ]; then - dist_name="centos7" -else # noboolean - dist_name="almalinux" +if [ -n "${rpm_dist}" ] && [ "rpm" != "${rpm_dist}" ]; then + echo >&2 "Only rpm is a valid dist_type arguments. Got ${rpm_dist}" + exit 1 fi - echo echo "===" echo "WARNING: this script modifies local versioned files" @@ -42,5 +40,5 @@ echo # # Creates the redhat package -$(dirname "$0")/_docker_run.sh ${dist_name}-build.docker docker/_build-redhat.sh "${java_version}" ${rpm_dist} +$(dirname "$0")/_docker_run.sh almalinux-build.docker docker/_build-redhat.sh "${java_version}" exit $? diff --git a/.build/docker/centos7-build.docker b/.build/docker/centos7-build.docker deleted file mode 100644 index 901e77985d..0000000000 --- a/.build/docker/centos7-build.docker +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM centos:7 -MAINTAINER Apache Cassandra - -# CONTEXT is expected to be cassandra/.build - -ENV BUILD_HOME=/home/build -ENV RPM_BUILD_DIR=$BUILD_HOME/rpmbuild -ENV DIST_DIR=/dist -ENV CASSANDRA_DIR=$BUILD_HOME/cassandra -ENV ANT_VERSION=1.10.14 -ARG UID_ARG=1000 -ARG GID_ARG=1000 - -LABEL org.cassandra.buildenv=centos - -RUN echo "Building with arguments:" \ - && echo " - DIST_DIR=${DIST_DIR}" \ - && echo " - BUILD_HOME=${BUILD_HOME}" \ - && echo " - RPM_BUILD_DIR=${RPM_BUILD_DIR}" \ - && echo " - CASSANDRA_DIR=${CASSANDRA_DIR}" \ - && echo " - UID_ARG=${UID_ARG}" \ - && echo " - GID_ARG=${GID_ARG}" - -# install deps -RUN yum -y install \ - ant \ - git \ - java-11-openjdk-devel \ - make \ - rpm-build \ - sudo \ - python3-pip \ - rsync - -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 http://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 3 --family java-17-openjdk.$(arch) -RUN alternatives --install /usr/bin/javac javac /opt/jdk-17/bin/javac 3 --family java-17-openjdk.$(arch) - -# python3 is needed for the gen-doc target -RUN pip3 install --upgrade pip - diff --git a/CHANGES.txt b/CHANGES.txt index 7c6c10cd50..d70641781a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 5.1 + * Support for noboolean rpm (centos7 compatible) packages removed (CASSANDRA-19787) * Allow threads waiting for the metadata log follower to be interrupted (CASSANDRA-19761) * Support dictionary lookup for CassandraPasswordValidator (CASSANDRA-19762) * Disallow denylisting keys in system_cluster_metadata (CASSANDRA-19713) diff --git a/redhat/noboolean/README b/redhat/noboolean/README deleted file mode 100644 index 33ab959e2b..0000000000 --- a/redhat/noboolean/README +++ /dev/null @@ -1,23 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -These files create the 'noboolean' rpm packaging, using the same procedure as normal. -These differ from the other packages by not using boolean dependency logic, intended for -systems using rpmlib < 4.13. - -See CASSANDRA-17765 for more information. diff --git a/redhat/noboolean/cassandra b/redhat/noboolean/cassandra deleted file mode 120000 index d9af9adbce..0000000000 --- a/redhat/noboolean/cassandra +++ /dev/null @@ -1 +0,0 @@ -../cassandra \ No newline at end of file diff --git a/redhat/noboolean/cassandra.conf b/redhat/noboolean/cassandra.conf deleted file mode 120000 index 7c12fb6720..0000000000 --- a/redhat/noboolean/cassandra.conf +++ /dev/null @@ -1 +0,0 @@ -../cassandra.conf \ No newline at end of file diff --git a/redhat/noboolean/cassandra.in.sh b/redhat/noboolean/cassandra.in.sh deleted file mode 120000 index 115b45ba92..0000000000 --- a/redhat/noboolean/cassandra.in.sh +++ /dev/null @@ -1 +0,0 @@ -../cassandra.in.sh \ No newline at end of file diff --git a/redhat/noboolean/cassandra.spec b/redhat/noboolean/cassandra.spec deleted file mode 100644 index e151f03878..0000000000 --- a/redhat/noboolean/cassandra.spec +++ /dev/null @@ -1,219 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -%define __jar_repack %{nil} -# Turn off the brp-python-bytecompile script and mangling shebangs for Python scripts -%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g' -e 's!/usr/lib[^[:space:]]*/brp-mangle-shebangs[[:space:]].*$!!g') - -# rpmbuild should not barf when it spots we ship -# binary executable files in our 'noarch' package -%define _binaries_in_noarch_packages_terminate_build 0 - -%define __python /usr/bin/python3 - -%global username cassandra - -# input of ~alphaN, ~betaN, ~rcN package versions need to retain upstream '-alphaN, etc' version for sources -%define upstream_version %(echo %{version} | sed -r 's/~/-/g') -%define relname apache-cassandra-%{upstream_version} - -# default DIST_DIR to build -%global _get_dist_dir %(echo "${DIST_DIR:-build}") - -Name: cassandra -Version: %{version} -Release: %{revision} -Summary: Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store. - -Group: Development/Libraries -License: Apache Software License 2.0 -URL: http://cassandra.apache.org/ -Source0: %{relname}-src.tar.gz -BuildRoot: %{_tmppath}/%{relname}root-%(%{__id_u} -n) - -BuildRequires: ant >= 1.9 -BuildRequires: ant-junit >= 1.9 - -Requires: java-11-headless -Requires: python(abi) >= 3.6 -Requires: procps-ng >= 3.3 -Requires(pre): user(cassandra) -Requires(pre): group(cassandra) -Requires(pre): shadow-utils -Provides: user(cassandra) -Provides: group(cassandra) - -BuildArch: noarch - -# Don't examine the .so files we bundle for dependencies -AutoReqProv: no - -%description -Cassandra is a distributed (peer-to-peer) system for the management and storage of structured data. - -%prep -%setup -q -n %{relname}-src - -%build -export LANG=en_US.UTF-8 -export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8" -ant jar -Dversion=%{upstream_version} -Dno-checkstyle=true -Drat.skip=true -Dant.gen-doc.skip=true - -%install -%{__rm} -rf %{buildroot} -mkdir -p %{buildroot}/%{_sysconfdir}/%{username} -mkdir -p %{buildroot}/usr/share/%{username} -mkdir -p %{buildroot}/usr/share/%{username}/lib -mkdir -p %{buildroot}/%{_sysconfdir}/%{username}/default.conf -mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/init.d -mkdir -p %{buildroot}/%{_sysconfdir}/security/limits.d -mkdir -p %{buildroot}/%{_sysconfdir}/default -mkdir -p %{buildroot}/usr/sbin -mkdir -p %{buildroot}/usr/bin -mkdir -p %{buildroot}/var/lib/%{username}/commitlog -mkdir -p %{buildroot}/var/lib/%{username}/data -mkdir -p %{buildroot}/var/lib/%{username}/saved_caches -mkdir -p %{buildroot}/var/lib/%{username}/hints -mkdir -p %{buildroot}/var/run/%{username} -mkdir -p %{buildroot}/var/log/%{username} -( cd pylib && %{__python} setup.py install --no-compile --root %{buildroot}; ) - -# patches for data and log paths -patch -p1 < debian/patches/cassandra_yaml_dirs.diff -patch -p1 < debian/patches/cassandra_logdir_fix.diff -# uncomment hints_directory path -sed -i 's/^# hints_directory:/hints_directory:/' conf/cassandra.yaml - -# remove other files not being installed -rm -f bin/stop-server -rm -f bin/*.orig -rm -f bin/cassandra.in.sh -rm -f tools/bin/cassandra.in.sh - -# copy default configs -cp -pr conf/* %{buildroot}/%{_sysconfdir}/%{username}/default.conf/ - -# step on default config with our redhat one -cp -p redhat/%{username}.in.sh %{buildroot}/usr/share/%{username}/%{username}.in.sh -cp -p redhat/%{username} %{buildroot}/%{_sysconfdir}/rc.d/init.d/%{username} -cp -p redhat/%{username}.conf %{buildroot}/%{_sysconfdir}/security/limits.d/ -cp -p redhat/default %{buildroot}/%{_sysconfdir}/default/%{username} - -# copy cassandra bundled libs -cp -pr lib/* %{buildroot}/usr/share/%{username}/lib/ - -# copy stress jar -cp -p %{_get_dist_dir}/tools/lib/stress.jar %{buildroot}/usr/share/%{username}/ - -# copy fqltool jar -cp -p %{_get_dist_dir}/tools/lib/fqltool.jar %{buildroot}/usr/share/%{username}/ - -# copy binaries -mv bin/cassandra %{buildroot}/usr/sbin/ -cp -p bin/* %{buildroot}/usr/bin/ -cp -p tools/bin/* %{buildroot}/usr/bin/ - -# copy cassandra jar -cp %{_get_dist_dir}/apache-cassandra-%{upstream_version}.jar %{buildroot}/usr/share/%{username}/ - -%clean -%{__rm} -rf %{buildroot} - -%pre -getent group %{username} >/dev/null || groupadd -r %{username} -getent passwd %{username} >/dev/null || \ -useradd -d /var/lib/%{username} -g %{username} -M -r %{username} -exit 0 - -%files -%defattr(0644,root,root,0755) -%doc CHANGES.txt LICENSE.txt README.asc NEWS.txt NOTICE.txt CASSANDRA-14092.txt -%attr(755,root,root) %{_bindir}/auditlogviewer -%attr(755,root,root) %{_bindir}/jmxtool -%attr(755,root,root) %{_bindir}/cassandra-stress -%attr(755,root,root) %{_bindir}/cqlsh -%attr(755,root,root) %{_bindir}/cqlsh.py -%attr(755,root,root) %{_bindir}/debug-cql -%attr(755,root,root) %{_bindir}/fqltool -%attr(755,root,root) %{_bindir}/generatetokens -%attr(755,root,root) %{_bindir}/nodetool -%attr(755,root,root) %{_bindir}/sstableloader -%attr(755,root,root) %{_bindir}/sstablescrub -%attr(755,root,root) %{_bindir}/sstableupgrade -%attr(755,root,root) %{_bindir}/sstableutil -%attr(755,root,root) %{_bindir}/sstableverify -%attr(755,root,root) %{_sbindir}/cassandra -%attr(755,root,root) /%{_sysconfdir}/rc.d/init.d/%{username} -%{_sysconfdir}/default/%{username} -%{_sysconfdir}/security/limits.d/%{username}.conf -/usr/share/%{username}* -%config(noreplace) /%{_sysconfdir}/%{username} -%attr(750,%{username},%{username}) %config(noreplace) /var/lib/%{username}/* -%attr(750,%{username},%{username}) /var/log/%{username}* -%attr(750,%{username},%{username}) /var/run/%{username}* -%{python_sitelib}/cqlshlib/ -%{python_sitelib}/cassandra_pylib*.egg-info - -%post -alternatives --install /%{_sysconfdir}/%{username}/conf %{username} /%{_sysconfdir}/%{username}/default.conf/ 0 -exit 0 - -%preun -# only delete alternative on removal, not upgrade -if [ "$1" = "0" ]; then - alternatives --remove %{username} /%{_sysconfdir}/%{username}/default.conf/ -fi -exit 0 - - -%package tools -Summary: Extra tools for Cassandra. Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store. -Group: Development/Libraries -Requires: cassandra = %{version}-%{revision} - -%description tools -Cassandra is a distributed (peer-to-peer) system for the management and storage of structured data. -. -This package contains extra tools for working with Cassandra clusters. - -%files tools -%attr(755,root,root) %{_bindir}/sstablepartitions -%attr(755,root,root) %{_bindir}/sstabledump -%attr(755,root,root) %{_bindir}/compaction-stress -%attr(755,root,root) %{_bindir}/sstableexpiredblockers -%attr(755,root,root) %{_bindir}/sstablelevelreset -%attr(755,root,root) %{_bindir}/sstablemetadata -%attr(755,root,root) %{_bindir}/sstableofflinerelevel -%attr(755,root,root) %{_bindir}/sstablerepairedset -%attr(755,root,root) %{_bindir}/sstablesplit -%attr(755,root,root) %{_bindir}/auditlogviewer -%attr(755,root,root) %{_bindir}/jmxtool -%attr(755,root,root) %{_bindir}/fqltool -%attr(755,root,root) %{_bindir}/generatetokens -%attr(755,root,root) %{_bindir}/hash_password -%attr(755,root,root) %{_bindir}/addtocmstool - - -%changelog -# packaging changes, not software changes -* Thu May 04 2023 Mick Semb Wever -- 5.0 -- RPM packaging brought in-tree. CASSANDRA-18133 -* Mon Dec 05 2016 Michael Shuler -- 2.1.17, 2.2.9, 3.0.11, 3.10 -- Reintroduce RPM packaging diff --git a/redhat/noboolean/default b/redhat/noboolean/default deleted file mode 120000 index 446d58f0d0..0000000000 --- a/redhat/noboolean/default +++ /dev/null @@ -1 +0,0 @@ -../default \ No newline at end of file