From ee635f5c45212ce9a6b8976691001dfbb6333767 Mon Sep 17 00:00:00 2001 From: arvindksi274-ksolves Date: Tue, 24 Feb 2026 18:34:05 +0530 Subject: [PATCH] Fix instructions in README.asc of pylib patch by Arvind Kandpal; reviewed by Stefan Miklosovic, Michael Semb Wever for CASSANDRA-20181 --- pylib/Dockerfile.ubuntu.py2 | 19 ------------------- pylib/Dockerfile.ubuntu.py3 | 18 ------------------ pylib/Dockerfile.ubuntu.py37 | 13 ------------- pylib/Dockerfile.ubuntu.py38 | 13 ------------- pylib/README.asc | 22 +++++++++------------- 5 files changed, 9 insertions(+), 76 deletions(-) delete mode 100644 pylib/Dockerfile.ubuntu.py2 delete mode 100644 pylib/Dockerfile.ubuntu.py3 delete mode 100644 pylib/Dockerfile.ubuntu.py37 delete mode 100644 pylib/Dockerfile.ubuntu.py38 diff --git a/pylib/Dockerfile.ubuntu.py2 b/pylib/Dockerfile.ubuntu.py2 deleted file mode 100644 index 3469b3cc9a..0000000000 --- a/pylib/Dockerfile.ubuntu.py2 +++ /dev/null @@ -1,19 +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 ubuntu:bionic -RUN apt-get update && apt-get install -y python-minimal diff --git a/pylib/Dockerfile.ubuntu.py3 b/pylib/Dockerfile.ubuntu.py3 deleted file mode 100644 index dbf9cc916a..0000000000 --- a/pylib/Dockerfile.ubuntu.py3 +++ /dev/null @@ -1,18 +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 ubuntu:bionic -RUN apt-get update && apt-get install -y python3-minimal && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 diff --git a/pylib/Dockerfile.ubuntu.py37 b/pylib/Dockerfile.ubuntu.py37 deleted file mode 100644 index a12538409c..0000000000 --- a/pylib/Dockerfile.ubuntu.py37 +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed 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 ubuntu:bionic -RUN apt-get update && apt-get install -y python3.7-minimal && update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 diff --git a/pylib/Dockerfile.ubuntu.py38 b/pylib/Dockerfile.ubuntu.py38 deleted file mode 100644 index 9697baee35..0000000000 --- a/pylib/Dockerfile.ubuntu.py38 +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed 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 ubuntu:bionic -RUN apt-get update && apt-get install -y python3.8-minimal && update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 diff --git a/pylib/README.asc b/pylib/README.asc index b0b6c7dcf6..62a9d14e64 100644 --- a/pylib/README.asc +++ b/pylib/README.asc @@ -14,22 +14,18 @@ new. In order to run tests for cqlshlib, run cassandra-cqlsh-tests.sh in this directory. It will automatically setup a virtualenv with the appropriate version of Python and run tests inside it. -There are Dockerfiles that can be used to test whether cqlsh works with a default, barebones -Python installation. Assuming Cassandra's source is checked out at `$CASSANDRA_DIR`. To test, first -build the Docker image containing the barebones Python installation - +To run cqlsh using publicly available Docker images to connect to Cassandra on the same host, with `$CASSANDRA_DIR` pointing to either the source or install directory where `bin/cqlsh` is located. - $ docker build . --file Dockerfile.ubuntu.py3 -t ubuntu-lts-py3 +For Python 3.11: -Next, run cqlsh inside the newly built image - + $ docker run -v $CASSANDRA_DIR:/code -it python:3.11-slim /code/bin/cqlsh host.docker.internal - $ docker run -v $CASSANDRA_DIR:/code -it ubuntu-lts-py3:latest /code/bin/cqlsh host.docker.internal +For Python 2.7: -If `host.docker.internal` isn't supported, then you can use `--net="host"` with `docker run`: + $ docker run -v $CASSANDRA_DIR:/code -it python:2.7-slim /code/bin/cqlsh host.docker.internal - $ docker run --net="host" -v $CASSANDRA_DIR:/code -it ubuntu-lts-py3:latest /code/bin/cqlsh +If `host.docker.internal` isn't supported, then you can use `--net="host"`: -This will try to spawn a cqlsh instance inside the Docker container running Ubuntu LTS (18.04) -with minimal Python installation. It will try to connect to the Cassandra instance running on the -Docker host at port 9042. If you have Cassandra running elsewhere, replace host.docker.internal -with the IP / hostname as usual. Please ensure that the IP / host is accessible from _within_ the -Docker container. \ No newline at end of file + $ docker run --net="host" -v $CASSANDRA_DIR:/code -it python:3.11-slim /code/bin/cqlsh + +This will try to spawn a cqlsh instance inside the Docker container with a minimal Python installation. It will try to connect to the Cassandra instance running on the Docker host at port 9042. If you have Cassandra running elsewhere, replace host.docker.internal with the IP / hostname as usual. Please ensure that the IP / host is accessible from _within_ the Docker container. \ No newline at end of file