Skip to content

Commit

Permalink
DEVX-2595: start-docker-kraft.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyzek committed Apr 30, 2021
1 parent 5fa428d commit 5c9a6ae
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions cp-quickstart/start-docker-kraft.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Source library
source ../utils/helper.sh

wget -O docker-compose.yml https://raw.githubusercontent.com/confluentinc/cp-all-in-one/${CONFLUENT_RELEASE_TAG_OR_BRANCH}/cp-all-in-one-kraft/docker-compose.yml
wget -O update_run.sh https://raw.githubusercontent.com/confluentinc/cp-all-in-one/${CONFLUENT_RELEASE_TAG_OR_BRANCH}/cp-all-in-one-kraft/update_run.sh
chmod 744 update_run.sh

./stop-docker.sh

docker-compose up -d

# Verify Kafka Connect worker has started
MAX_WAIT=120
echo "Waiting up to $MAX_WAIT seconds for Connect to start"
retry $MAX_WAIT check_connect_up connect || exit 1
sleep 2 # give connect an exta moment to fully mature
echo "connect has started!"

# Configure datagen connectors
source ./connectors/submit_datagen_pageviews_config.sh
source ./connectors/submit_datagen_users_config.sh

# Verify topics exist
MAX_WAIT=30
echo -e "\nWaiting up to $MAX_WAIT seconds for topics (pageviews, users) to exist"
retry $MAX_WAIT check_topic_exists broker broker:9092 pageviews || exit 1
retry $MAX_WAIT check_topic_exists broker broker:9092 users || exit 1
echo "Topics exist!"

# Run the KSQL queries
docker-compose exec ksqldb-cli bash -c "ksql http://ksqldb-server:8088 <<EOF
run script '/tmp/statements.sql';
exit ;
EOF"

0 comments on commit 5c9a6ae

Please sign in to comment.