From df0091f5437113d2764cabb7433eee25fba6a4b6 Mon Sep 17 00:00:00 2001 From: Alex Ayars Date: Wed, 30 Aug 2017 14:15:31 -0700 Subject: [PATCH] Extract kafka-streams-examples into own repo (#317) --- Makefile | 8 +- bin/build-debian | 3 - debian/kafka-streams-examples/Dockerfile | 77 ------ .../docker/admin.properties.template | 4 - .../include/etc/confluent/docker/configure | 34 --- .../include/etc/confluent/docker/ensure | 35 --- .../include/etc/confluent/docker/launch | 28 -- .../include/etc/confluent/docker/run | 35 --- docs/tutorials/kafka-streams-examples.rst | 256 +----------------- docs/tutorials/tutorials.rst | 1 - examples/kafka-streams-examples/README.md | 25 -- .../kafka-streams-examples/docker-compose.yml | 136 ---------- .../standalone-config.yml | 90 ------ .../standalone-network.yml | 117 -------- tests/test_kafka_streams_examples.py | 127 --------- 15 files changed, 3 insertions(+), 973 deletions(-) delete mode 100644 debian/kafka-streams-examples/Dockerfile delete mode 100644 debian/kafka-streams-examples/include/etc/confluent/docker/admin.properties.template delete mode 100755 debian/kafka-streams-examples/include/etc/confluent/docker/configure delete mode 100755 debian/kafka-streams-examples/include/etc/confluent/docker/ensure delete mode 100755 debian/kafka-streams-examples/include/etc/confluent/docker/launch delete mode 100755 debian/kafka-streams-examples/include/etc/confluent/docker/run delete mode 100644 examples/kafka-streams-examples/README.md delete mode 100644 examples/kafka-streams-examples/docker-compose.yml delete mode 100644 tests/fixtures/debian/kafka-streams-examples/standalone-config.yml delete mode 100644 tests/fixtures/debian/kafka-streams-examples/standalone-network.yml delete mode 100644 tests/test_kafka_streams_examples.py diff --git a/Makefile b/Makefile index 9e596482..edbb82e0 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ CONFLUENT_VERSION ?= ${CONFLUENT_MAJOR_VERSION}.${CONFLUENT_MINOR_VERSION}.${CON KAFKA_VERSION ?= 0.11.0.1 -COMPONENTS := base zookeeper kafka kafka-rest schema-registry kafka-connect-base kafka-connect enterprise-control-center kafkacat enterprise-replicator enterprise-kafka kafka-streams-examples +COMPONENTS := base zookeeper kafka kafka-rest schema-registry kafka-connect-base kafka-connect enterprise-control-center kafkacat enterprise-replicator enterprise-kafka COMMIT_ID := $(shell git rev-parse --short HEAD) MYSQL_DRIVER_VERSION := 5.1.39 @@ -155,9 +155,6 @@ test-enterprise-kafka: venv clean-containers build-debian build-test-images test-control-center: venv clean-containers build-debian build-test-images IMAGE_DIR=$(pwd) venv/bin/py.test tests/test_control_center.py -v -test-kafka-streams-examples: venv clean-containers build-debian build-test-images - IMAGE_DIR=$(pwd) venv/bin/py.test tests/test_kafka_streams_examples.py -v - test-all: \ venv \ clean \ @@ -171,5 +168,4 @@ test-all: \ test-enterprise-replicator \ test-schema-registry \ test-kafka-rest \ - test-control-center \ - test-kafka-streams-examples + test-control-center diff --git a/bin/build-debian b/bin/build-debian index 715fd053..b4413b1a 100755 --- a/bin/build-debian +++ b/bin/build-debian @@ -6,9 +6,6 @@ for component in ${COMPONENTS} ; do if [ "${component}" = "base" ]; then BUILD_ARGS="--build-arg ALLOW_UNSIGNED=${ALLOW_UNSIGNED} --build-arg CONFLUENT_PACKAGES_REPO=${CONFLUENT_PACKAGES_REPO} --build-arg CONFLUENT_MVN_LABEL=${CONFLUENT_MVN_LABEL}" - elif [ "${component}" = "kafka-streams-examples" ]; then - BUILD_ARGS="--build-arg CONFLUENT_MVN_LABEL=${CONFLUENT_MVN_LABEL}" - else BUILD_ARGS="" fi diff --git a/debian/kafka-streams-examples/Dockerfile b/debian/kafka-streams-examples/Dockerfile deleted file mode 100644 index d7a1d6b6..00000000 --- a/debian/kafka-streams-examples/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright 2017 Confluent Inc. -# -# 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. - -# Builds a docker image for Confluent's example applications for the Kafka Streams API - -FROM confluentinc/cp-base - -MAINTAINER partner-support@confluent.io -LABEL io.confluent.docker=true -ARG COMMIT_ID=unknown -LABEL io.confluent.docker.git.id=$COMMIT_ID -ARG BUILD_NUMBER=-1 -LABEL io.confluent.docker.build.number=$BUILD_NUMBER - -WORKDIR /build -ENV COMPONENT=kafka-streams-examples - -# We run the Kafka Streams demo application as a non-priviledged user. -ENV STREAMS_USER="streams" -ENV STREAMS_GROUP=$STREAMS_USER - -ENV STREAMS_EXAMPLES_BRANCH="${CONFLUENT_MAJOR_VERSION}.${CONFLUENT_MINOR_VERSION}.x" -ENV STREAMS_EXAMPLES_FATJAR="streams-examples-${CONFLUENT_VERSION}${CONFLUENT_MVN_LABEL}-standalone.jar" -ENV STREAMS_APP_DIRECTORY="/app" -ENV STREAMS_EXAMPLES_FATJAR_DEPLOYED="$STREAMS_APP_DIRECTORY/$STREAMS_EXAMPLES_FATJAR" -ENV KAFKA_MUSIC_APP_CLASS="io.confluent.examples.streams.interactivequeries.kafkamusic.KafkaMusicExample" -ENV KAFKA_MUSIC_APP_REST_HOST=localhost -ENV KAFKA_MUSIC_APP_REST_PORT=7070 - -EXPOSE $KAFKA_MUSIC_APP_REST_PORT - -# This affects how strings in Java class files are interpreted. We want UTF-8, and this is the only locale in the -# base image that supports it -ENV LANG="C.UTF-8" - -# Uncomment for CI snapshots (bring your own settings) -# COPY settings.xml /root/.m2/settings.xml - -ENV BUILD_PACKAGES="git maven" -RUN echo "===> Installing packages to build Confluent demo applications" \ - && apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y $BUILD_PACKAGES \ - && echo "===> Building Confluent demo applications for Kafka Streams API (github.com/confluentinc/examples) ..." \ - && git clone https://github.com/confluentinc/examples \ - && cd examples/kafka-streams \ - && git checkout $STREAMS_EXAMPLES_BRANCH \ - && mvn -DskipTests=true clean package \ - && echo "===> Moving fat jar to application directory ${STREAMS_APP_DIRECTORY} ..." \ - && mkdir -p $STREAMS_APP_DIRECTORY \ - && chmod 0755 $STREAMS_APP_DIRECTORY \ - && mv -f target/$STREAMS_EXAMPLES_FATJAR $STREAMS_APP_DIRECTORY \ - && echo "===> Setting up ${COMPONENT} dirs ..." \ - && mkdir -p /etc/"${COMPONENT}" \ - && chmod ag+w /etc/"${COMPONENT}" \ - && echo "===> Cleaning up ..." \ - && apt-get remove --purge -y $BUILD_PACKAGES \ - && apt-get clean && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* \ - && rm -f /root/.m2/settings.xml - -COPY include/etc/confluent/docker /etc/confluent/docker - -RUN groupadd $STREAMS_GROUP && useradd -r -g $STREAMS_GROUP $STREAMS_USER - -USER $STREAMS_USER - -CMD ["/etc/confluent/docker/run"] diff --git a/debian/kafka-streams-examples/include/etc/confluent/docker/admin.properties.template b/debian/kafka-streams-examples/include/etc/confluent/docker/admin.properties.template deleted file mode 100644 index d53a6429..00000000 --- a/debian/kafka-streams-examples/include/etc/confluent/docker/admin.properties.template +++ /dev/null @@ -1,4 +0,0 @@ -{% set streams_props = env_to_props('STREAMS_SECURITY_', '') -%} -{% for name, value in streams_props.iteritems() -%} -{{name}}={{value}} -{% endfor -%} diff --git a/debian/kafka-streams-examples/include/etc/confluent/docker/configure b/debian/kafka-streams-examples/include/etc/confluent/docker/configure deleted file mode 100755 index f64da78b..00000000 --- a/debian/kafka-streams-examples/include/etc/confluent/docker/configure +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2017 Confluent Inc. -# -# 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. - -set -o nounset \ - -o errexit \ - -o verbose \ - -o xtrace - -dub ensure STREAMS_BOOTSTRAP_SERVERS -dub ensure STREAMS_SCHEMA_REGISTRY_HOST -dub ensure STREAMS_SCHEMA_REGISTRY_PORT -dub ensure KAFKA_MUSIC_APP_REST_HOST -dub ensure KAFKA_MUSIC_APP_REST_PORT - -dub ensure STREAMS_EXAMPLES_FATJAR_DEPLOYED -dub path "${STREAMS_EXAMPLES_FATJAR_DEPLOYED}" readable -dub ensure KAFKA_MUSIC_APP_CLASS - -dub path /etc/"${COMPONENT}"/ writable - -dub template "/etc/confluent/docker/admin.properties.template" "/etc/"${COMPONENT}"/admin.properties" diff --git a/debian/kafka-streams-examples/include/etc/confluent/docker/ensure b/debian/kafka-streams-examples/include/etc/confluent/docker/ensure deleted file mode 100755 index 94216e07..00000000 --- a/debian/kafka-streams-examples/include/etc/confluent/docker/ensure +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2017 Confluent Inc. -# -# 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. - -set -o nounset \ - -o errexit \ - -o verbose \ - -o xtrace - -echo "===> Verify that Kafka is healthy ..." - -cub kafka-ready \ - "${STREAMS_CUB_KAFKA_MIN_BROKERS:-1}" \ - "${STREAMS_CUB_KAFKA_TIMEOUT:-40}" \ - -b "$STREAMS_BOOTSTRAP_SERVERS" \ - --config /etc/"${COMPONENT}"/admin.properties - -echo "===> Verify that Confluent Schema Registry is healthy ..." - -cub sr-ready \ - "$STREAMS_SCHEMA_REGISTRY_HOST" \ - "$STREAMS_SCHEMA_REGISTRY_PORT" \ - "${STREAMS_CUB_SCHEMA_REGISTRY_TIMEOUT:-40}" diff --git a/debian/kafka-streams-examples/include/etc/confluent/docker/launch b/debian/kafka-streams-examples/include/etc/confluent/docker/launch deleted file mode 100755 index d43f925f..00000000 --- a/debian/kafka-streams-examples/include/etc/confluent/docker/launch +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2017 Confluent Inc. -# -# 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. - -declare -r STREAMS_SCHEMA_REGISTRY_URL="http://$STREAMS_SCHEMA_REGISTRY_HOST:$STREAMS_SCHEMA_REGISTRY_PORT" -declare -r KAFKA_MUSIC_APP_REST_ENDPOINT="http://$KAFKA_MUSIC_APP_REST_HOST:$KAFKA_MUSIC_APP_REST_PORT" - -echo "===> Launching ${COMPONENT}:" -echo " Running Kafka Music application with REST endpoint at ${KAFKA_MUSIC_APP_REST_ENDPOINT}," -echo " connecting to Kafka cluster at ${STREAMS_BOOTSTRAP_SERVERS} and" -echo " Confluent schema registry at ${STREAMS_SCHEMA_REGISTRY_URL}" -echo " (from fat jar at $STREAMS_EXAMPLES_FATJAR_DEPLOYED)" -exec java -cp $STREAMS_EXAMPLES_FATJAR_DEPLOYED \ - -Dmetadata.max.age.ms=1000 \ - $KAFKA_MUSIC_APP_CLASS \ - $KAFKA_MUSIC_APP_REST_PORT $STREAMS_BOOTSTRAP_SERVERS $STREAMS_SCHEMA_REGISTRY_URL $KAFKA_MUSIC_APP_REST_HOST diff --git a/debian/kafka-streams-examples/include/etc/confluent/docker/run b/debian/kafka-streams-examples/include/etc/confluent/docker/run deleted file mode 100755 index 9db8b7b9..00000000 --- a/debian/kafka-streams-examples/include/etc/confluent/docker/run +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2017 Confluent Inc. -# -# 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. - -set -o nounset \ - -o errexit \ - -o verbose \ - -o xtrace - -echo "===> ENV Variables ..." -env | sort - -echo "===> User" -id - -echo "===> Configuring ..." -/etc/confluent/docker/configure - -echo "===> Running preflight checks ... " -/etc/confluent/docker/ensure - -echo "===> Launching ... " -exec /etc/confluent/docker/launch diff --git a/docs/tutorials/kafka-streams-examples.rst b/docs/tutorials/kafka-streams-examples.rst index 5bc50f0d..3a08a1c9 100644 --- a/docs/tutorials/kafka-streams-examples.rst +++ b/docs/tutorials/kafka-streams-examples.rst @@ -3,259 +3,5 @@ Kafka Streams Examples ---------------------- -In this tutorial we will run Confluent's -:cp-examples:`Kafka Music demo application|src/main/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExample.java` -for the Kafka Streams API. +`This content has moved. `_ -The Kafka Music application demonstrates how to build of a simple music charts application that continuously computes, -in real-time, the latest charts such as Top 5 songs per music genre. It exposes its latest processing results -- the -latest charts -- via Kafka's :ref:`Interactive Queries ` feature and a REST -API. The application's input data is in Avro format and comes from two sources: a stream of play events (think: "song -X was played") and a stream of song metadata ("song X was written by artist Y"); see -:ref:`inspecting the input data ` in the -:ref:`Appendix ` for how the input data looks like. - -More specifically, we will run the following services: - -- Confluent's - :cp-examples:`Kafka Music demo application|src/main/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExample.java` -- a single-node Kafka cluster with a single-node ZooKeeper ensemble -- :ref:`Confluent Schema Registry ` - - -Requirements -~~~~~~~~~~~~ - -This tutorial uses `Docker Compose `__. - -* You must install `Docker `__ and - `Docker Compose `__. -* The Confluent Docker images require Docker version 1.11 or greater. - - -Running the Kafka Music demo application -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want to see an appetizer of what we will do in this section, take a look at the following screencast: - -.. raw:: html - -

- - - -

-

- - Screencast: Running Confluent's Kafka Music demo application (3 mins) - -

- -Ready now? Let's start! - -Clone the Confluent Docker Images repository: - - .. sourcecode:: bash - - # Clone the git repository - $ git clone https://github.com/confluentinc/cp-docker-images - - # Change into the directory for this tutorial - $ cd cp-docker-images/examples/kafka-streams-examples - - # Switch to the `master` branch - $ git checkout master - -Now we can launch the Kafka Music demo application including the services it depends on such as Kafka. - - .. sourcecode:: bash - - $ docker-compose up -d - -After a few seconds the application and the services are up and running. One of the started containers is continuously -generating input data for the application by writing into its input topics. This allows us to look at live, real-time -data when playing around with the Kafka Music application. - -Now we can use our web browser or a CLI tool such as ``curl`` to interactively query the latest processing results of -the Kafka Music application by accessing its REST API. - -**REST API example 1: list all running application instances of the Kafka Music application:** - -.. sourcecode:: bash - - $ curl -sXGET http://localhost:7070/kafka-music/instances - - # You should see output similar to following, though here - # the output is pretty-printed so that it's easier to read: - [ - { - "host": "localhost", - "port": 7070, - "storeNames": [ - "all-songs", - "song-play-count", - "top-five-songs", - "top-five-songs-by-genre" - ] - } - ] - -**REST API example 2: get the latest Top 5 songs across all music genres:** - -.. sourcecode:: bash - - $ curl -sXGET http://localhost:7070/kafka-music/charts/top-five - - # You should see output similar to following, though here - # the output is pretty-printed so that it's easier to read: - [ - { - "artist": "Jello Biafra And The Guantanamo School Of Medicine", - "album": "The Audacity Of Hype", - "name": "Three Strikes", - "plays": 70 - }, - { - "artist": "Hilltop Hoods", - "album": "The Calling", - "name": "The Calling", - "plays": 67 - }, - - ... rest omitted... - ] - -The REST API exposed by the -:cp-examples:`Kafka Music application|src/main/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExample.java` -supports further operations. See the -:cp-examples:`top-level instructions in its source code|src/main/java/io/confluent/examples/streams/interactivequeries/kafkamusic/KafkaMusicExample.java` -for details. - -Once you're done playing around you can stop all the services and containers with: - -.. sourcecode:: bash - - $ docker-compose down - -We hope you enjoyed this tutorial! - - -Running further Confluent demo applications for the Kafka Streams API -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The container named ``kafka-music-application``, which runs the Kafka Music demo application, actually contains all of -Confluent's `Kafka Streams demo applications `__. The demo applications are -packaged in the fat jar at ``/app/streams-examples-3.3.0-standalone.jar`` inside this container. -This means you can easily run any of these applications from inside the container via a command similar to: - -.. sourcecode:: bash - - # Example: Launch the WordCount demo application (inside the `kafka-music-application` container) - $ docker-compose exec kafka-music-application \ - java -cp /app/streams-examples-3.3.0-standalone.jar \ - io.confluent.examples.streams.WordCountLambdaExample \ - kafka:29092 - -Of course you can also modify the tutorial's ``docker-compose.yml`` for repeatable deployments. - -Note that you must follow the full instructions of each demo application (see its respective source code at -https://github.com/confluentinc/examples). These instructions include, for example, the creation of the application's -input and output topics. Also, each demo application supports CLI arguments. Typically, the first CLI argument is -the ``bootstrap.servers`` parameter and the second argument, if any, is the ``schema.registry.url`` setting. - -Available endpoints **from within the containers** as well as **on your host machine**: - -+---------------------------+-------------------------+---------------------------------+--------------------------------+ -| Endpoint | Parameter | Value (from within containers) | Value (from your host machine) | -+===========================+=========================+=================================+================================+ -| Kafka Cluster | ``bootstrap.servers`` | ``kafka:29092`` | ``localhost:9092`` | -+---------------------------+-------------------------+---------------------------------+--------------------------------+ -| Confluent Schema Registry | ``schema.registry.url`` | ``http://schema-registry:8081`` | ``http://localhost:8081`` | -+---------------------------+-------------------------+---------------------------------+--------------------------------+ -| ZooKeeper ensemble | ``zookeeper.connect`` | ``zookeeper:32181`` | ``localhost:32181`` | -+---------------------------+-------------------------+---------------------------------+--------------------------------+ - -The ZooKeeper endpoint is not required by Kafka Streams applications, but you need it to e.g. -:ref:`manually create new Kafka topics ` or to -:ref:`list available Kafka topics `. - - -.. _docker-tutorial_kafka-streams-examples_appendix: - -Appendix -~~~~~~~~ - - -.. _docker-tutorial_kafka-streams-examples_inspect-input-data: - -Inspecting the input topics of the Kafka Music application -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -Inspect the "play-events" input topic, which contains messages in Avro format: - -.. sourcecode:: bash - - # Use the kafka-avro-console-consumer to read the "play-events" topic - $ docker-compose exec schema-registry \ - kafka-avro-console-consumer \ - --bootstrap-server kafka:29092 \ - --topic play-events --from-beginning - - # You should see output similar to: - {"song_id":11,"duration":60000} - {"song_id":10,"duration":60000} - {"song_id":12,"duration":60000} - {"song_id":2,"duration":60000} - {"song_id":1,"duration":60000} - - -Inspect the "song-feed" input topic, which contains messages in Avro format: - -.. sourcecode:: bash - - # Use the kafka-avro-console-consumer to read the "song-feed" topic - $ docker-compose exec schema-registry \ - kafka-avro-console-consumer \ - --bootstrap-server kafka:29092 \ - --topic song-feed --from-beginning - - # You should see output similar to: - {"id":1,"album":"Fresh Fruit For Rotting Vegetables","artist":"Dead Kennedys","name":"Chemical Warfare","genre":"Punk"} - {"id":2,"album":"We Are the League","artist":"Anti-Nowhere League","name":"Animal","genre":"Punk"} - {"id":3,"album":"Live In A Dive","artist":"Subhumans","name":"All Gone Dead","genre":"Punk"} - {"id":4,"album":"PSI","artist":"Wheres The Pope?","name":"Fear Of God","genre":"Punk"} - - -.. _docker-tutorial_kafka-streams-examples_topics-create: - -Creating new topics -""""""""""""""""""" - -You can create topics manually with the ``kafka-topics`` CLI tool, which is available on the ``kafka`` container. - -.. sourcecode:: bash - - # Create a new topic named "my-new-topic", using the `kafka` container - $ docker-compose exec kafka kafka-topics \ - --zookeeper zookeeper:32181 \ - --create --topic my-new-topic --partitions 2 --replication-factor 1 - - # You should see a line similar to: - Created topic "my-new-topic". - - -.. _docker-tutorial_kafka-streams-examples_topics-list: - -Listing available topics -"""""""""""""""""""""""" - -You can list all available topics with the ``kafka-topics`` CLI tool, which is available on the ``kafka`` container. - -.. sourcecode:: bash - - # List available topics, using the `kafka` container - $ docker-compose exec kafka kafka-topics \ - --zookeeper zookeeper:32181 \ - --list - -Additional topic information is displayed by running ``--describe`` instead of ``-list``. diff --git a/docs/tutorials/tutorials.rst b/docs/tutorials/tutorials.rst index a566b42d..225bc235 100644 --- a/docs/tutorials/tutorials.rst +++ b/docs/tutorials/tutorials.rst @@ -16,4 +16,3 @@ In this section, we provide more advanced tutorials for using specific Confluent connect-avro-jdbc automatic-data-balancing replicator - kafka-streams-examples diff --git a/examples/kafka-streams-examples/README.md b/examples/kafka-streams-examples/README.md deleted file mode 100644 index f6d3bb60..00000000 --- a/examples/kafka-streams-examples/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Confluent's Kafka Streams Examples - -This example launches: - -- Confluent's Kafka Music demo application for the Kafka Streams API. This application demonstrates how to build of a simple music charts application. It uses Kafka's - [Interactive Queries](http://docs.confluent.io/current/streams/developer-guide.html#interactive-queries) feature to - expose its latest processing results (e.g. latest Top 5 songs) via a REST API. Its input data is in Avro format, - hence the use of Confluent Schema Registry (see below). -- a single-node Apache Kafka cluster with a single-node ZooKeeper ensemble -- a [Confluent Schema Registry](https://github.com/confluentinc/schema-registry) instance - -The Kafka Music application demonstrates how to build of a simple music charts application that continuously computes, -in real-time, the latest charts such as Top 5 songs per music genre. It exposes its latest processing results -- the -latest charts -- via Kafka’s Interactive Queries feature and a REST API. The application's input data is in Avro format -and comes from two sources: a stream of play events (think: "song X was played") and a stream of song metadata ("song X -was written by artist Y"). - -More specifically, we will run the following services: - -* Confluent's Kafka Music demo application -* a single-node Kafka cluster with a single-node ZooKeeper ensemble -* Confluent Schema Registry - -You can find detailed documentation at -http://docs.confluent.io/current/cp-docker-images/docs/tutorials/kafka-streams-examples.html. diff --git a/examples/kafka-streams-examples/docker-compose.yml b/examples/kafka-streams-examples/docker-compose.yml deleted file mode 100644 index b349b6ad..00000000 --- a/examples/kafka-streams-examples/docker-compose.yml +++ /dev/null @@ -1,136 +0,0 @@ ---- -version: '2' -services: - zookeeper: - image: confluentinc/cp-zookeeper:3.3.0-SNAPSHOT - hostname: zookeeper - ports: - - '32181:32181' - environment: - ZOOKEEPER_CLIENT_PORT: 32181 - ZOOKEEPER_TICK_TIME: 2000 - extra_hosts: - - "moby:127.0.0.1" - - kafka: - image: confluentinc/cp-kafka:3.3.0-SNAPSHOT - hostname: kafka - ports: - - '9092:9092' - - '29092:29092' - depends_on: - - zookeeper - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter - CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka:29092 - CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:32181 - CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1 - CONFLUENT_METRICS_ENABLE: 'true' - CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous' - extra_hosts: - - "moby:127.0.0.1" - - schema-registry: - image: confluentinc/cp-schema-registry:3.3.0-SNAPSHOT - hostname: schema-registry - depends_on: - - zookeeper - - kafka - ports: - - '8081:8081' - environment: - SCHEMA_REGISTRY_HOST_NAME: schema-registry - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:32181 - extra_hosts: - - "moby:127.0.0.1" - - # This "container" is a workaround to pre-create topics for the Kafka Music application - # until we have a more elegant way to do that. - kafka-create-topics: - image: confluentinc/cp-kafka:3.3.0-SNAPSHOT - depends_on: - - kafka - hostname: kafka-create-topics - # We defined a dependency on "kafka", but `depends_on` will NOT wait for the - # dependencies to be "ready" before starting the "kafka-create-topics" - # container; it waits only until the dependencies have started. Hence we - # must control startup order more explicitly. - # See https://docs.docker.com/compose/startup-order/ - command: "bash -c 'echo Waiting for Kafka to be ready... && \ - cub kafka-ready -b kafka:29092 1 20 && \ - kafka-topics --create --topic play-events --if-not-exists --zookeeper zookeeper:32181 --partitions 4 --replication-factor 1 && \ - kafka-topics --create --topic song-feed --if-not-exists --zookeeper zookeeper:32181 --partitions 4 --replication-factor 1 && \ - sleep infinity'" - environment: - # The following settings are listed here only to satisfy the image's requirements. - # We override the image's `command` anyways, hence this container will not start a broker. - KAFKA_BROKER_ID: ignored - KAFKA_ZOOKEEPER_CONNECT: ignored - extra_hosts: - - "moby:127.0.0.1" - - # Continuously generates input data for the Kafka Music application. - kafka-music-data-generator: - image: confluentinc/cp-kafka-streams-examples:3.3.0-SNAPSHOT - hostname: kafka-music-data-generator - depends_on: - - kafka - - schema-registry - - kafka-create-topics - # Control startup order similarly to the "kafka-create-topics" container above. - command: "bash -c 'echo Waiting for Kafka to be ready... && \ - cub kafka-ready -b kafka:29092 1 20 && \ - echo Waiting for Confluent Schema Registry to be ready... && \ - cub sr-ready schema-registry 8081 20 && \ - java -cp /app/streams-examples-3.3.0-SNAPSHOT-standalone.jar \ - io.confluent.examples.streams.interactivequeries.kafkamusic.KafkaMusicExampleDriver \ - kafka:29092 http://schema-registry:8081'" - environment: - STREAMS_BOOTSTRAP_SERVERS: ignored - STREAMS_SCHEMA_REGISTRY_HOST: ignored - STREAMS_SCHEMA_REGISTRY_PORT: ignored - KAFKA_MUSIC_APP_REST_HOST: ignored - KAFKA_MUSIC_APP_REST_PORT: ignored - extra_hosts: - - "moby:127.0.0.1" - - # Runs the Kafka Music application. - kafka-music-application: - image: confluentinc/cp-kafka-streams-examples:3.3.0-SNAPSHOT - hostname: kafka-music-application - depends_on: - - kafka - - schema-registry - - kafka-create-topics - # Control startup order similarly to the "kafka-create-topics" container above. - # Note: The container's `run` script will perform the same readiness checks - # for Kafka and Confluent Schema Registry, but that's ok because they complete fast. - # The reason we check for readiness here is that we can insert a sleep time - # for topic creation before we start the application. - # - # TODO: Once https://issues.apache.org/jira/browse/KAFKA-5037 is resolved, - # we can remove this `command` and use the image as-is. - command: "bash -c 'echo Waiting for Kafka to be ready... && \ - cub kafka-ready -b kafka:29092 1 20 && \ - echo Waiting for Confluent Schema Registry to be ready... && \ - cub sr-ready schema-registry 8081 20 && \ - echo Waiting a few seconds for topic creation to finish... && \ - sleep 2 && \ - /etc/confluent/docker/run'" - ports: - - '7070:7070' - environment: - STREAMS_BOOTSTRAP_SERVERS: kafka:29092 - STREAMS_SCHEMA_REGISTRY_HOST: schema-registry - STREAMS_SCHEMA_REGISTRY_PORT: 8081 - KAFKA_MUSIC_APP_REST_HOST: localhost - KAFKA_MUSIC_APP_REST_PORT: 7070 - extra_hosts: - - "moby:127.0.0.1" diff --git a/tests/fixtures/debian/kafka-streams-examples/standalone-config.yml b/tests/fixtures/debian/kafka-streams-examples/standalone-config.yml deleted file mode 100644 index 3d10fa2e..00000000 --- a/tests/fixtures/debian/kafka-streams-examples/standalone-config.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -version: '2' -services: - zookeeper: - image: confluentinc/cp-zookeeper:latest - labels: - - io.confluent.docker.testing=true - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - - kafka: - image: confluentinc/cp-kafka:latest - labels: - - io.confluent.docker.testing=true - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181/defaultconfig - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 - - schema-registry: - image: confluentinc/cp-schema-registry:latest - labels: - - io.confluent.docker.testing=true - ports: - - '8081' - environment: - SCHEMA_REGISTRY_HOST_NAME: schema-registry - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181/defaultconfig - - # Used to verify that an invalid configuration (e.g. missing required - # environment variables) results in a failure. - failing-config: - image: confluentinc/cp-kafka-streams-examples:latest - labels: - - io.confluent.docker.testing=true - - # Used to verify that a valid configuration works successfully. - default-config: - image: confluentinc/cp-kafka-streams-examples:latest - labels: - - io.confluent.docker.testing=true - restart: on-failure:3 - ports: - - '7070' - environment: - STREAMS_BOOTSTRAP_SERVERS: kafka:9092 - STREAMS_SCHEMA_REGISTRY_HOST: schema-registry - STREAMS_SCHEMA_REGISTRY_PORT: 8081 - KAFKA_MUSIC_APP_REST_HOST: localhost - KAFKA_MUSIC_APP_REST_PORT: 7070 - - secure-config: - image: confluentinc/cp-kafka-streams-examples:latest - labels: - - io.confluent.docker.testing=true - command: "bash -c '/etc/confluent/docker/configure && touch /tmp/config-is-done && sleep infinity'" - environment: - STREAMS_BOOTSTRAP_SERVERS: kafka:9092 - STREAMS_SCHEMA_REGISTRY_HOST: schema-registry - STREAMS_SCHEMA_REGISTRY_PORT: 8081 - KAFKA_MUSIC_APP_REST_HOST: localhost - KAFKA_MUSIC_APP_REST_PORT: 7070 - # Environment variables prefixed with `STREAMS_SECURITY_` are "converted" to Kafka parameters - # and stored into /etc/kafka-streams-examples/admin.properties in the container. - # - # Details at: - # debian/kafka-streams-examples/include/etc/confluent/docker/{admin.properties.template, configure} - # - # Note: Below we provide different settings for the producer and the consumer used by Kafka Streams, - # which we do primarily for testing purposes. Because these settings happen to be identical - # across the producer and consumer, we could alternatively collapse "paired" variables into one; - # for example, we could collapse - # STREAMS_SECURITY_PRODUCER_SSL_TRUSTSTORE_LOCATION and STREAMS_SECURITY_CONSUMER_SSL_TRUSTSTORE_LOCATION - # into a single STREAMS_SECURITY_SSL_TRUSTSTORE_LOCATION variable. - # - STREAMS_SECURITY_PRODUCER_SECURITY_PROTOCOL: SSL - STREAMS_SECURITY_PRODUCER_SSL_TRUSTSTORE_LOCATION: /path/to/producer-truststore - STREAMS_SECURITY_PRODUCER_SSL_TRUSTSTORE_PASSWORD: producer-password - STREAMS_SECURITY_PRODUCER_SSL_KEYSTORE_LOCATION: /path/to/producer-keystore - STREAMS_SECURITY_PRODUCER_SSL_KEYSTORE_PASSWORD: producer-password - STREAMS_SECURITY_PRODUCER_SSL_KEY_PASSWORD: producer-password - STREAMS_SECURITY_CONSUMER_SECURITY_PROTOCOL: SSL - STREAMS_SECURITY_CONSUMER_SSL_TRUSTSTORE_LOCATION: /path/to/consumer-truststore - STREAMS_SECURITY_CONSUMER_SSL_TRUSTSTORE_PASSWORD: consumer-password - STREAMS_SECURITY_CONSUMER_SSL_KEYSTORE_LOCATION: /path/to/consumer-keystore - STREAMS_SECURITY_CONSUMER_SSL_KEYSTORE_PASSWORD: consumer-password - STREAMS_SECURITY_CONSUMER_SSL_KEY_PASSWORD: consumer-password - labels: - - io.confluent.docker.testing=true diff --git a/tests/fixtures/debian/kafka-streams-examples/standalone-network.yml b/tests/fixtures/debian/kafka-streams-examples/standalone-network.yml deleted file mode 100644 index f5813c5d..00000000 --- a/tests/fixtures/debian/kafka-streams-examples/standalone-network.yml +++ /dev/null @@ -1,117 +0,0 @@ ---- -version: '2' - -networks: - # The name of the network defined here is used in `tests/test_kafka_streams_examples.py` - # as part of the 'NetworkMode' host config for some tests when running docker commands. - acme: - driver: bridge - -services: - - ### - ### Bridge mode - ### - ### In this file, we use the port convention for bridge mode: - ### - Host port = 2 (example: 29092 for a Kafka broker that runs at port 9092) - ### - Container port = 1 (example: 19092 for a Kafka broker that runs at port 9092) - - zookeeper-bridge: - image: confluentinc/cp-zookeeper:latest - labels: - - io.confluent.docker.testing=true - networks: - - acme - ports: - - "22181:12181" - environment: - ZOOKEEPER_CLIENT_PORT: 12181 - ZOOKEEPER_TICK_TIME: 2000 - - kafka-bridge: - image: confluentinc/cp-kafka:latest - labels: - - io.confluent.docker.testing=true - networks: - - acme - ports: - - "29092:19092" - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: zookeeper-bridge:12181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-bridge:19092 - - schema-registry-bridge: - image: confluentinc/cp-schema-registry:latest - labels: - - io.confluent.docker.testing=true - networks: - - acme - ports: - - "28081:18081" - environment: - SCHEMA_REGISTRY_HOST_NAME: schema-registry-bridge - SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:18081 - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper-bridge:12181 - - kafka-streams-examples-bridge: - image: confluentinc/cp-kafka-streams-examples:latest - labels: - - io.confluent.docker.testing=true - networks: - - acme - ports: - - "27070:17070" - environment: - STREAMS_BOOTSTRAP_SERVERS: kafka-bridge:19092 - STREAMS_SCHEMA_REGISTRY_HOST: schema-registry-bridge - STREAMS_SCHEMA_REGISTRY_PORT: 18081 - KAFKA_MUSIC_APP_REST_HOST: localhost - KAFKA_MUSIC_APP_REST_PORT: 17070 - - ### - ### Host mode (`network_mode: host`) - ### - ### In this file, we use the port convention for host mode: - ### - Container port = 3 (example: 39092 for a Kafka broker that runs at port 9092) - - zookeeper-host: - image: confluentinc/cp-zookeeper:latest - labels: - - io.confluent.docker.testing=true - network_mode: host - environment: - ZOOKEEPER_CLIENT_PORT: 32181 - ZOOKEEPER_TICK_TIME: 2000 - - kafka-host: - image: confluentinc/cp-kafka:latest - labels: - - io.confluent.docker.testing=true - network_mode: host - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: localhost:32181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:39092 - - schema-registry-host: - image: confluentinc/cp-schema-registry:latest - labels: - - io.confluent.docker.testing=true - network_mode: host - environment: - SCHEMA_REGISTRY_HOST_NAME: localhost - SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:38081 - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: localhost:32181 - - kafka-streams-examples-host: - image: confluentinc/cp-kafka-streams-examples:latest - labels: - - io.confluent.docker.testing=true - network_mode: host - environment: - STREAMS_BOOTSTRAP_SERVERS: localhost:39092 - STREAMS_SCHEMA_REGISTRY_HOST: localhost - STREAMS_SCHEMA_REGISTRY_PORT: 38081 - KAFKA_MUSIC_APP_REST_HOST: localhost - KAFKA_MUSIC_APP_REST_PORT: 37070 diff --git a/tests/test_kafka_streams_examples.py b/tests/test_kafka_streams_examples.py deleted file mode 100644 index 324147a1..00000000 --- a/tests/test_kafka_streams_examples.py +++ /dev/null @@ -1,127 +0,0 @@ -import os -import unittest -import utils -import time -import string -import json - -CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) -FIXTURES_DIR = os.path.join(CURRENT_DIR, "fixtures", "debian", "kafka-streams-examples") -ZK_READY = "bash -c 'cub zk-ready {servers} 40 && echo PASS || echo FAIL'" -KAFKA_READY = "bash -c 'cub kafka-ready {num_brokers} 40 -z $KAFKA_ZOOKEEPER_CONNECT && echo PASS || echo FAIL'" -SR_READY = "bash -c 'cub sr-ready {host} {port} 20 && echo PASS || echo FAIL'" -KAFKA_MUSIC_APP_HEALTH_CHECK = "bash -c 'dub http-ready {url} 20 && echo PASS || echo FAIL'" - -def props_to_list(props_str): - return sorted([ - p.strip() for p in props_str.split("\n") if len(p.strip()) > 0 - ]) - -class ConfigTest(unittest.TestCase): - - @classmethod - def setUpClass(cls): - machine_name = os.environ["DOCKER_MACHINE_NAME"] - cls.machine = utils.TestMachine(machine_name) - cls.cluster = utils.TestCluster("config-test", FIXTURES_DIR, "standalone-config.yml") - cls.cluster.start() - assert "PASS" in cls.cluster.run_command_on_service("zookeeper", ZK_READY.format(servers="localhost:2181")) - assert "PASS" in cls.cluster.run_command_on_service("kafka", KAFKA_READY.format(num_brokers=1)) - assert "PASS" in cls.cluster.run_command_on_service("schema-registry", SR_READY.format(host="schema-registry", port=8081)) - - @classmethod - def tearDownClass(cls): - cls.cluster.shutdown() - - @classmethod - def is_kafka_music_app_healthy_for_service(cls, service): - list_running_app_instances_url = "http://{host}:{port}/kafka-music/instances".format(host="localhost", port=7070) - assert "PASS" in cls.cluster.run_command_on_service(service, KAFKA_MUSIC_APP_HEALTH_CHECK.format(url=list_running_app_instances_url)) - - def test_required_config_failure(self): - self.assertTrue("STREAMS_BOOTSTRAP_SERVERS is required." in self.cluster.service_logs("failing-config", stopped=True)) - - def test_default_config(self): - self.is_kafka_music_app_healthy_for_service("default-config") - # The default config fixture does not contain any security-related settings. - admin_props = props_to_list(self.cluster.run_command_on_service("default-config", "cat /etc/kafka-streams-examples/admin.properties")) - expected_admin_props = [] - self.assertEquals(expected_admin_props, admin_props) - # TODO: Once https://github.com/apache/kafka/pull/2815 is available for use, - # we should also validate some REST API responses (see `test_kafka_rest.py`)? - - def test_secure_config(self): - output = self.cluster.run_command_on_service("secure-config", "bash -c 'while [ ! -f /tmp/config-is-done ]; do echo waiting && sleep 1; done; echo PASS'") - assert "PASS" in output - - admin_props = props_to_list(self.cluster.run_command_on_service("secure-config", "cat /etc/kafka-streams-examples/admin.properties")) - expected_admin_props = props_to_list(""" - producer.security.protocol=SSL - producer.ssl.truststore.location=/path/to/producer-truststore - producer.ssl.truststore.password=producer-password - producer.ssl.keystore.location=/path/to/producer-keystore - producer.ssl.keystore.password=producer-password - producer.ssl.key.password=producer-password - consumer.security.protocol=SSL - consumer.ssl.truststore.location=/path/to/consumer-truststore - consumer.ssl.truststore.password=consumer-password - consumer.ssl.keystore.location=/path/to/consumer-keystore - consumer.ssl.keystore.password=consumer-password - consumer.ssl.key.password=consumer-password - """) - self.assertEquals(expected_admin_props, admin_props) - - -class StandaloneNetworkingTest(unittest.TestCase): - - @classmethod - def setUpClass(cls): - cls.cluster = utils.TestCluster("standalone-network-test", FIXTURES_DIR, "standalone-network.yml") - cls.cluster.start() - assert "PASS" in cls.cluster.run_command_on_service("zookeeper-bridge", ZK_READY.format(servers="localhost:12181")) - assert "PASS" in cls.cluster.run_command_on_service("kafka-bridge", KAFKA_READY.format(num_brokers=1)) - assert "PASS" in cls.cluster.run_command_on_service("schema-registry-bridge", SR_READY.format(host="schema-registry-bridge", port=18081)) - assert "PASS" in cls.cluster.run_command_on_service("zookeeper-host", ZK_READY.format(servers="localhost:32181")) - assert "PASS" in cls.cluster.run_command_on_service("kafka-host", KAFKA_READY.format(num_brokers=1)) - assert "PASS" in cls.cluster.run_command_on_service("schema-registry-host", SR_READY.format(host="localhost", port=38081)) - - @classmethod - def tearDownClass(cls): - cls.cluster.shutdown() - - @classmethod - def is_kafka_music_app_healthy_for_service(cls, service, port): - list_running_app_instances_url = "http://{host}:{port}/kafka-music/instances".format(host="localhost", port=port) - assert "PASS" in cls.cluster.run_command_on_service(service, KAFKA_MUSIC_APP_HEALTH_CHECK.format(url=list_running_app_instances_url)) - - def test_bridged_network(self): - # Verify access to the containerized application from inside its own container - self.is_kafka_music_app_healthy_for_service("kafka-streams-examples-bridge", port=17070) - - # Verify outside access to the containerized application over the host network from a new container - list_running_app_instances_url_host = "http://{host}:{port}/kafka-music/instances".format(host="localhost", port=27070) - host_network_logs = utils.run_docker_command( - image="confluentinc/cp-kafka-streams-examples", - command=KAFKA_MUSIC_APP_HEALTH_CHECK.format(url=list_running_app_instances_url_host), - host_config={'NetworkMode': 'host'}) - self.assertTrue("PASS" in host_network_logs) - - # Verify outside access to the containerized application over the bridge network from a new container - list_running_app_instances_url_bridge = "http://{host}:{port}/kafka-music/instances".format(host="kafka-streams-examples-bridge", port=17070) - bridge_network_logs = utils.run_docker_command( - image="confluentinc/cp-kafka-streams-examples", - command=KAFKA_MUSIC_APP_HEALTH_CHECK.format(url=list_running_app_instances_url_bridge), - host_config={'NetworkMode': 'standalone-network-test_acme'}) - self.assertTrue("PASS" in bridge_network_logs) - - def test_host_network(self): - # Verify access to the containerized application from inside its own container - self.is_kafka_music_app_healthy_for_service("kafka-streams-examples-host", port=37070) - - # Verify outside access to the containerized application from a new container - list_running_app_instances_url = "http://{host}:{port}/kafka-music/instances".format(host="localhost", port=37070) - logs = utils.run_docker_command( - image="confluentinc/cp-kafka-streams-examples", - command=KAFKA_MUSIC_APP_HEALTH_CHECK.format(url=list_running_app_instances_url), - host_config={'NetworkMode': 'host'}) - self.assertTrue("PASS" in logs)