Skip to content

Run soak tests from EC2 #1908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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
12 changes: 0 additions & 12 deletions tests/soak/Dockerfile

This file was deleted.

28 changes: 21 additions & 7 deletions tests/soak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ OpenTelemetry reporting supported through OTLP.

# Installation

TESTID=normal \
LK_VERSION=v2.2.0 \
CKPY_VERSION=v2.2.0 \
CC_BOOSTRAP_SERVERS=_ \
CC_USERNAME=_ \
CC_PASSWORD=_ \
DOCKER_REPOSITORY=_ ./install.sh
1. Edit `ccloud.config`

2. Edit `otel-config.yaml`

3. the first time:
```bash
./bootstrap.sh <python-branch/tag> <librdkafka-branch/tag>
```
4. next times:
```bash
./build.sh <python-branch/tag> <librdkafka-branch/tag>
```

5.
```bash
. venv/bin/activate

5. Run some tests
```bash
TESTID=<testid> ./run.sh ccloud.config
```
56 changes: 18 additions & 38 deletions tests/soak/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,38 @@
#
#

# Bootstrap EC2 instance (Ubuntu 18.04) for soak client use
# Bootstrap EC2 instance (Ubuntu) for soak client use
#
# Usage:
# $0 <python-branch/tag> <librdkafka-branch/tag>

set -e

if [[ $# != 2 ]]; then
echo "Usage: $0 <python-client-branch/tag> <librdkafka-branch/tag>"
echo "Usage: $0 <librdkafka-branch/tag> <python-client-branch/tag>"
exit 1
fi

python_branch=$1
librdkafka_branch=$2
venv=$PWD/venv

sudo apt update
sudo apt install -y git curl make gcc g++ zlib1g-dev libssl-dev libzstd-dev \
python3-dev python3-pip python3-venv

if [[ ! -d confluent-kafka-python ]]; then
git clone https://github.com/confluentinc/confluent-kafka-python
fi

pushd confluent-kafka-python

git checkout $python_branch

echo "Installing librdkafka $librdkafka_branch"
tools/bootstrap-librdkafka.sh --require-ssl $librdkafka_branch /usr
rm -rf tmp-build
librdkafka_branch=$1
python_branch=$2
otel_collector_version=0.130.0
otel_collector_package_url="https://github.com/open-telemetry/"\
"opentelemetry-collector-releases/releases/download/"\
"v${otel_collector_version}/otelcol-contrib_${otel_collector_version}_linux_amd64.deb"

# echo "Installing interceptors"
# tools/install-interceptors.sh

echo "Setting up virtualenv in $venv"
if [[ ! -d $venv ]]; then
python3 -m venv $venv
fi
source $venv/bin/activate

pip install -U pip

pip install -v .[soaktest]

popd # ..python

echo "Verifying python client installation"
python -c "import confluent_kafka; print(confluent_kafka.version(), confluent_kafka.libversion())"
sudo apt update
sudo apt install -y git curl wget make gcc g++ zlib1g-dev libssl-dev \
libzstd-dev python3-dev python3-pip python3-venv
wget -O otel_collector_package.deb $otel_collector_package_url
sudo dpkg -i otel_collector_package.deb
rm otel_collector_package.deb
sudo cp otel-config.yaml /etc/otelcol-contrib/config.yaml
sudo systemctl restart otelcol-contrib

deactivate
./build.sh $librdkafka_branch $python_branch

venv=$PWD/venv
echo "All done, activate the virtualenv in $venv before running the client:"
echo "source $venv/bin/activate"

32 changes: 28 additions & 4 deletions tests/soak/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,50 @@ fi

set -eu

testdir=$PWD
mkdir -p $testdir/librdkafka-installation

if [[ ! -d confluent-kafka-python ]]; then
git clone https://github.com/confluentinc/confluent-kafka-python
fi

venv=$PWD/venv
if [[ ! -d $venv ]]; then
echo "Setting up virtualenv in $venv"
python3 -m venv $venv
source $venv/bin/activate
pip install -U pip
pip install -r $testdir/../../requirements/requirements-soaktest.txt
deactivate
fi

echo "Building and installing librdkafka $librdkafka_version"
if [[ ! -d librdkafka ]]; then
git clone https://github.com/confluentinc/librdkafka.git
fi
pushd librdkafka
sudo make uninstall
git fetch --tags
git checkout $librdkafka_version
./configure --reconfigure
echo "Configuring librdkafka $librdkafka_version with prefix $testdir/librdkafka-installation"
./configure --prefix=$testdir/librdkafka-installation
sudo make uninstall
make clean
make -j
sudo make install
make install
popd

export LIBRARY_PATH=$testdir/librdkafka-installation/lib
export LD_LIBRARY_PATH=$testdir/librdkafka-installation/lib
export CPLUS_INCLUDE_PATH=$testdir/librdkafka-installation/include
export C_INCLUDE_PATH=$testdir/librdkafka-installation/include

echo "Building confluent-kafka-python $cflpy_version"
set +u
source venv/bin/activate
python3 -m pip uninstall -y confluent-kafka
set -u
pushd confluent-kafka-python
rm -rf ./build
git fetch --tags
git checkout $cflpy_version
python3 -m pip install .
Expand All @@ -38,4 +63,3 @@ popd
echo ""
echo "=============================================================================="
(cd / ; python3 -c 'import confluent_kafka as c; print("python", c.version(), "librdkafka", c.libversion())')

9 changes: 9 additions & 0 deletions tests/soak/ccloud.config.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bootstrap.servers=<add your bootstraps here>
sasl.mechanisms=PLAIN
security.protocol=SASL_SSL
sasl.username=<your ccloud access key>
sasl.password=<your ccloud secret>
enable.idempotence=true
debug=eos,generic,broker,security,consumer
linger.ms=2
compression.type=lz4
48 changes: 0 additions & 48 deletions tests/soak/install.sh

This file was deleted.

23 changes: 0 additions & 23 deletions tests/soak/njc-py-soak-tests/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions tests/soak/njc-py-soak-tests/Chart.yaml

This file was deleted.

1 change: 0 additions & 1 deletion tests/soak/njc-py-soak-tests/templates/NOTES.txt

This file was deleted.

62 changes: 0 additions & 62 deletions tests/soak/njc-py-soak-tests/templates/_helpers.tpl

This file was deleted.

Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy