Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .build/build-resolver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
<file file="${local.repository}/org/apache/cassandra/deps/geomet-0.1.0.zip"/>
<file file="${local.repository}/org/apache/cassandra/deps/pure_sasl-0.6.2-py2-none-any.zip"/>
<file file="${local.repository}/org/apache/cassandra/deps/wcwidth-0.2.5-py2.py3-none-any.zip"/>
<file file="${local.repository}/org/apache/cassandra/deps/pyasyncore-1.0.5-py3-none-any.zip"/>
</copy>
<copy todir="${build.lib}/sigar-bin/" quiet="true">
<file file="${local.repository}/org/apache/cassandra/deps/sigar-bin/libsigar-amd64-freebsd-6.so"/>
Expand Down Expand Up @@ -284,6 +285,7 @@
<get src="${artifact.python.pypi}/59/a0/cf4cd997e1750f0c2d91c6ea5abea218251c43c3581bcc2f118b00baf5cf/futures-2.1.6-py2.py3-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/futures-2.1.6-py2.py3-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
<get src="${artifact.python.pypi}/37/b2/ef1124540ee2c0b417be8d0f74667957e6aa084a3f26621aa67e2e77f3fb/pure_sasl-0.6.2-py2-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/pure_sasl-0.6.2-py2-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
<get src="${artifact.python.pypi}/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5/wcwidth-0.2.5-py2.py3-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/wcwidth-0.2.5-py2.py3-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
<get src="${artifact.python.pypi}/1f/ab/b10cee56269ae150763f3f83b3e9305a11f42f50b3dcd58eeb8f7988f0bb/pyasyncore-1.0.5-py3-none-any.whl" dest="${local.repository}/org/apache/cassandra/deps/pyasyncore-1.0.5-py3-none-any.zip" usetimestamp="true" quiet="true" skipexisting="true"/>

<!-- apache/cassandra/lib -->
<get src="${lib.download.base.url}/lib/geomet-0.1.0.zip" dest="${local.repository}/org/apache/cassandra/deps/geomet-0.1.0.zip" usetimestamp="true" quiet="true" skipexisting="true"/>
Expand Down
2 changes: 1 addition & 1 deletion .build/docker/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ docker --version
pushd ${cassandra_dir}/.build >/dev/null

# build test image
dockerfile="ubuntu2004_test.docker"
dockerfile="ubuntu-test.docker"
image_tag="$(md5sum docker/${dockerfile} | cut -d' ' -f1)"
image_name="apache/cassandra-${dockerfile/.docker/}:${image_tag}"
docker_mounts="-v ${cassandra_dir}:/home/cassandra/cassandra -v "${build_dir}":/home/cassandra/cassandra/build -v ${m2_dir}:/home/cassandra/.m2/repository"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:20.04
FROM ubuntu:22.04
MAINTAINER Apache Cassandra <dev@cassandra.apache.org>

# CONTEXT is expected to be cassandra/.build
Expand All @@ -23,7 +23,7 @@ ENV LC_CTYPE=en_US.UTF-8
ENV PYTHONIOENCODING=utf-8
ENV PYTHONUNBUFFERED=true

LABEL org.cassandra.buildenv=ubuntu_2004
LABEL org.cassandra.buildenv=ubuntu_2204

RUN echo "Building with arguments:" \
&& echo " - DIST_DIR=${DIST_DIR}" \
Expand All @@ -42,21 +42,27 @@ RUN echo 'Acquire::ftp::Timeout "60";' >> /etc/apt/apt.conf.d/80proxy.conf

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y --no-install-recommends software-properties-common apt-utils
apt-get install -y --no-install-recommends software-properties-common apt-utils gnupg

RUN export DEBIAN_FRONTEND=noninteractive && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y curl git-core python3-pip \
python3.8 python3.8-venv python3.8-dev \
python3.10 python3.10-venv python3.10-dev \
python3.11 python3.11-venv python3.11-dev \
python3.12 python3.12-venv python3.12-dev \
python3.13 python3.13-venv python3.13-dev \
virtualenv net-tools libev4 libev-dev wget gcc libxml2 libxslt1-dev \
vim lsof sudo libjemalloc2 dumb-init locales rsync \
openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk ant ant-optional


RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 4
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 5
RUN python3.8 -m pip install --upgrade pip

# generate locales for the standard en_US.UTF8 value we use for testing
Expand Down Expand Up @@ -93,7 +99,7 @@ WORKDIR ${BUILD_HOME}
ENV ANT_HOME=/usr/share/ant

# run pip commands and setup virtualenv (note we do this after we switch to cassandra user so we
# setup the virtualenv for the cassandra user and not the root user by accident) for Python 3.8/3.11
# setup the virtualenv for the cassandra user, not root) for Python 3.8-3.13
# Don't build cython extensions when installing cassandra-driver. During test execution the driver
# dependency is refreshed via pip install --upgrade, so that driver changes can be pulled in without
# requiring the image to be rebuilt. Rebuilding compiled extensions is costly and is disabled by
Expand All @@ -110,13 +116,46 @@ RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
&& pip3 install -r /opt/requirements.txt \
&& pip3 freeze --user"

RUN virtualenv --python=python3.10 ${BUILD_HOME}/env3.10
RUN chmod +x ${BUILD_HOME}/env3.10/bin/activate

RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
&& source ${BUILD_HOME}/env3.10/bin/activate \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 \
&& pip3 install --upgrade \"pip<25.0\" \"setuptools==60.8.2\" wheel \
&& pip3 install --no-build-isolation -r /opt/requirements.txt \
&& pip3 freeze --user"

RUN virtualenv --python=python3.11 ${BUILD_HOME}/env3.11
RUN chmod +x ${BUILD_HOME}/env3.11/bin/activate

RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
&& source ${BUILD_HOME}/env3.11/bin/activate \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 \
&& pip3 install -r /opt/requirements.txt \
&& pip3 install --upgrade \"pip<25.0\" \"setuptools==60.8.2\" wheel \
&& pip3 install --no-build-isolation -r /opt/requirements.txt \
&& pip3 freeze --user"

RUN virtualenv --python=python3.12 ${BUILD_HOME}/env3.12
RUN chmod +x ${BUILD_HOME}/env3.12/bin/activate

RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
&& source ${BUILD_HOME}/env3.12/bin/activate \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 \
&& pip3 install --upgrade \"pip<25.0\" \"setuptools>=65.5.0,<70.0.0\" wheel \
&& sed -i 's/pkgutil.ImpImporter/type(\"ImpImporter\", (object,), {})/g' ${BUILD_HOME}/env3.12/lib/python3.12/site-packages/pkg_resources/__init__.py \
&& pip3 install --no-build-isolation -r /opt/requirements.txt \
&& pip3 freeze --user"

RUN virtualenv --python=python3.13 ${BUILD_HOME}/env3.13
RUN chmod +x ${BUILD_HOME}/env3.13/bin/activate

RUN /bin/bash -c "export CASS_DRIVER_NO_CYTHON=1 CASS_DRIVER_NO_EXTENSIONS=1 \
&& source ${BUILD_HOME}/env3.13/bin/activate \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 \
&& pip3 install --upgrade \"pip<25.0\" \"setuptools>=65.5.0,<70.0.0\" wheel \
&& sed -i 's/pkgutil.ImpImporter/type(\"ImpImporter\", (object,), {})/g' ${BUILD_HOME}/env3.13/lib/python3.13/site-packages/pkg_resources/__init__.py \
&& pip3 install --no-build-isolation -r /opt/requirements.txt \
&& pip3 freeze --user"

# Initialize the CCM git repo as well as this also can fail to clone
Expand Down
2 changes: 1 addition & 1 deletion .build/run-python-dtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ set -e # enable immediate exit if venv setup fails
# fresh virtualenv and test logs results everytime
[[ "/" == "${DIST_DIR}" ]] || rm -rf "${DIST_DIR}/venv" "${DIST_DIR}/test/{html,output,logs}"

# re-use when possible the pre-installed virtualenv found in the cassandra-ubuntu2004_test docker image
# re-use when possible the pre-installed virtualenv found in the cassandra-ubuntu-test docker image
virtualenv-clone ${BUILD_HOME}/env${python_version} ${DIST_DIR}/venv || virtualenv --python=python${python_version} ${DIST_DIR}/venv
source ${DIST_DIR}/venv/bin/activate
pip3 install --exists-action w -r ${CASSANDRA_DTEST_DIR}/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def test(command, cell) {
withEnv(cell.collect { k, v -> "${k}=${v}" }) {
ws("workspace/${JOB_NAME}/${BUILD_NUMBER}/${cell.step}/${cell.arch}/jdk-${cell.jdk}/python-${cell.python}") {
fetchSource(cell.step, cell.arch, cell.jdk)
fetchDockerImages(['ubuntu2004_test'])
fetchDockerImages(['ubuntu-test'])
def cell_suffix = "_jdk${cell.jdk}_python_${cell.python}_${cell.cython}_${cell.arch}_${cell.split}_${splits}"
def logfile = "stage-logs/${JOB_NAME}_${BUILD_NUMBER}_${cell.step}${cell_suffix}_attempt${attempt}.log.xz"
def script_vars = "#!/bin/bash \n set -o pipefail ; " // pipe to tee needs pipefail
Expand Down
4 changes: 2 additions & 2 deletions bin/cqlsh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ is_supported_version() {
major_version="${version%.*}"
minor_version="${version#*.}"
# python 3.8-3.11 are supported
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 8 ] && [ "$minor_version" -le 11 ]; then
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 8 ] && [ "$minor_version" -le 13 ]; then
echo "supported"
# python 3.6-3.7 are deprecated
elif [ "$major_version" = 3 ] && [ "$minor_version" -ge 6 ] && [ "$minor_version" -le 7 ]; then
Expand All @@ -88,7 +88,7 @@ run_if_supported_version() {
exec "$interpreter" "$($interpreter -c "import os; print(os.path.dirname(os.path.realpath('$0')))")/cqlsh.py" "$@"
exit
else
echo "Warning: unsupported version of Python, required 3.6-3.11 but found" "$version" >&2
echo "Warning: unsupported version of Python, required 3.6-3.13 but found" "$version" >&2
fi
fi
}
Expand Down
6 changes: 3 additions & 3 deletions bin/cqlsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import sys
from glob import glob

if sys.version_info < (3, 6) or sys.version_info >= (3, 12):
sys.exit("\ncqlsh requires Python 3.6-3.11\n")
if sys.version_info < (3, 6) or sys.version_info >= (3, 14):
sys.exit("\ncqlsh requires Python 3.6-3.13\n")

# see CASSANDRA-10428
if platform.python_implementation().startswith('Jython'):
Expand Down Expand Up @@ -56,7 +56,7 @@ def find_zip(libprefix):
sys.path.insert(0, os.path.join(cql_zip, 'cassandra-driver-' + ver))

# the driver needs dependencies
third_parties = ('pure_sasl-', 'wcwidth-')
third_parties = ('pure_sasl-', 'wcwidth-', 'pyasyncore-')

for lib in third_parties:
lib_zip = find_zip(lib)
Expand Down
2 changes: 1 addition & 1 deletion pylib/cassandra-cqlsh-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ set -e # enable immediate exit if venv setup fails
# fresh virtualenv and test logs results everytime
rm -fr ${DIST_DIR}/venv ${DIST_DIR}/test/{html,output,logs}

# re-use when possible the pre-installed virtualenv found in the cassandra-ubuntu2004_test docker image
# re-use when possible the pre-installed virtualenv found in the cassandra-ubuntu-test docker image
virtualenv-clone ${BUILD_HOME}/env${python_version} ${BUILD_DIR}/venv || virtualenv --python=python3 ${BUILD_DIR}/venv
source ${BUILD_DIR}/venv/bin/activate

Expand Down