File: ubuntu-bootstrap.sh

package info (click to toggle)
python-confluent-kafka 1.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,900 kB
  • sloc: python: 8,335; ansic: 6,065; sh: 1,203; makefile: 178
file content (64 lines) | stat: -rwxr-xr-x 1,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#
#

# Bootstrap EC2 instance (Ubuntu 18.04) 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>"
    exit 1
fi

python_branch=$1
librdkafka_branch=$2

sudo apt update
sudo apt install -y make gcc g++ zlib1g-dev libssl-dev libzstd-dev screen \
     python3.6-dev python3-pip python3-virtualenv

pushd $HOME

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

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

venv=$HOME/venv
echo "Setting up virtualenv in $venv"
if [[ ! -d $venv ]]; then
    virtualenv -p python3.6 $venv
fi
source $venv/bin/activate

pip install -U pip

pip install -v .

pip install -r tests/soak/requirements.txt

popd # ..python

echo "Verifying python client installation"
python -c "import confluent_kafka; print(confluent_kafka.version(), confluent_kafka.libversion())"

deactivate

popd # $HOME

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