Merge branch 'cassandra-5.0' into trunk

* cassandra-5.0:
  remove centos7 and use vault mirror for ant-junit rpm download
This commit is contained in:
mck 2024-07-22 20:06:47 +02:00
commit 1b2a15acc8
No known key found for this signature in database
GPG Key ID: E91335D77E3E87CB
12 changed files with 9 additions and 364 deletions

View File

@ -65,10 +65,6 @@ Build with a specific jdk:
.build/docker/build-redhat.sh rpm 11 .build/docker/build-redhat.sh rpm 11
Build with centos7 and a specific jdk:
.build/docker/build-redhat.sh noboolean 11
Running Tests Running Tests
------------- -------------

View File

@ -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} [ -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 # Main
@ -116,7 +98,7 @@ cp ${DIST_DIR}/apache-cassandra-*-src.tar.gz ${RPM_BUILD_DIR}/SOURCES/
CASSANDRA_VERSION=${CASSANDRA_VERSION/-/\~} CASSANDRA_VERSION=${CASSANDRA_VERSION/-/\~}
command -v python >/dev/null 2>&1 || alias python=/usr/bin/python3 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} cp ${RPM_BUILD_DIR}/SRPMS/*.rpm ${RPM_BUILD_DIR}/RPMS/noarch/*.rpm ${DIST_DIR}
popd >/dev/null popd >/dev/null

View File

@ -49,7 +49,7 @@ RUN yum -y install \
procps \ procps \
rsync 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 RUN rpm -i --nodeps ant-junit-1.9.4-2.el7.noarch.rpm

View File

@ -17,8 +17,8 @@
if [ "$1" == "-h" ]; then if [ "$1" == "-h" ]; then
echo "$0 [-h] [rpm|noboolean] [<java_version>]" echo "$0 [-h] [rpm] [<java_version>]"
echo " build redhat packages, specify noboolean for centos7 compatibility" echo " build redhat packages"
exit 1 exit 1
fi fi
@ -26,13 +26,11 @@ fi
rpm_dist=$1 rpm_dist=$1
java_version=$2 java_version=$2
if [ "${rpm_dist}" == "noboolean" ]; then if [ -n "${rpm_dist}" ] && [ "rpm" != "${rpm_dist}" ]; then
dist_name="centos7" echo >&2 "Only rpm is a valid dist_type arguments. Got ${rpm_dist}"
else # noboolean exit 1
dist_name="almalinux"
fi fi
echo echo
echo "===" echo "==="
echo "WARNING: this script modifies local versioned files" echo "WARNING: this script modifies local versioned files"
@ -42,5 +40,5 @@ echo
# #
# Creates the redhat package # 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 $? exit $?

View File

@ -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 <dev@cassandra.apache.org>
# 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

View File

@ -1,4 +1,5 @@
5.1 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) * Allow threads waiting for the metadata log follower to be interrupted (CASSANDRA-19761)
* Support dictionary lookup for CassandraPasswordValidator (CASSANDRA-19762) * Support dictionary lookup for CassandraPasswordValidator (CASSANDRA-19762)
* Disallow denylisting keys in system_cluster_metadata (CASSANDRA-19713) * Disallow denylisting keys in system_cluster_metadata (CASSANDRA-19713)

View File

@ -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.

View File

@ -1 +0,0 @@
../cassandra

View File

@ -1 +0,0 @@
../cassandra.conf

View File

@ -1 +0,0 @@
../cassandra.in.sh

View File

@ -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 <mck@apache.org>
- 5.0
- RPM packaging brought in-tree. CASSANDRA-18133
* Mon Dec 05 2016 Michael Shuler <mshuler@apache.org>
- 2.1.17, 2.2.9, 3.0.11, 3.10
- Reintroduce RPM packaging

View File

@ -1 +0,0 @@
../default