diff --git a/examples/kafka/cifar10/cifar10_kafka.ipynb b/examples/kafka/cifar10/cifar10_kafka.ipynb index 9023e7aa5f..7afc3c491f 100644 --- a/examples/kafka/cifar10/cifar10_kafka.ipynb +++ b/examples/kafka/cifar10/cifar10_kafka.ipynb @@ -20,9 +20,67 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: confluent-kafka in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.8.2)\n", + "Requirement already satisfied: tensorflow-serving-api in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (2.8.0)\n", + "Requirement already satisfied: grpcio<2,>=1.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow-serving-api->-r requirements.txt (line 2)) (1.38.1)\n", + "Requirement already satisfied: protobuf>=3.6.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow-serving-api->-r requirements.txt (line 2)) (3.17.3)\n", + "Requirement already satisfied: tensorflow<3,>=2.8.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow-serving-api->-r requirements.txt (line 2)) (2.8.0)\n", + "Requirement already satisfied: six>=1.5.2 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from grpcio<2,>=1.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.15.0)\n", + "Requirement already satisfied: astunparse>=1.6.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.6.3)\n", + "Requirement already satisfied: gast>=0.2.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.4.0)\n", + "Requirement already satisfied: numpy>=1.20 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.21.5)\n", + "Requirement already satisfied: setuptools in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (52.0.0.post20210125)\n", + "Requirement already satisfied: keras-preprocessing>=1.1.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.1.2)\n", + "Requirement already satisfied: wrapt>=1.11.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.12.1)\n", + "Requirement already satisfied: keras<2.9,>=2.8.0rc0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.8.0)\n", + "Requirement already satisfied: tensorboard<2.9,>=2.8 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.8.0)\n", + "Requirement already satisfied: libclang>=9.0.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (13.0.0)\n", + "Requirement already satisfied: opt-einsum>=2.3.2 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.3.0)\n", + "Requirement already satisfied: tf-estimator-nightly==2.8.0.dev2021122109 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.8.0.dev2021122109)\n", + "Requirement already satisfied: termcolor>=1.1.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.1.0)\n", + "Requirement already satisfied: h5py>=2.9.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.1.0)\n", + "Requirement already satisfied: google-pasta>=0.1.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.2.0)\n", + "Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.24.0)\n", + "Requirement already satisfied: flatbuffers>=1.12 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.12)\n", + "Requirement already satisfied: absl-py>=0.4.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.13.0)\n", + "Requirement already satisfied: typing-extensions>=3.6.6 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.7.4.3)\n", + "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from astunparse>=1.6.0->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.36.2)\n", + "Requirement already satisfied: cached-property in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from h5py>=2.9.0->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.5.2)\n", + "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.4.4)\n", + "Requirement already satisfied: werkzeug>=0.11.15 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.0.1)\n", + "Requirement already satisfied: requests<3,>=2.21.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.25.1)\n", + "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.8.0)\n", + "Requirement already satisfied: google-auth<3,>=1.6.3 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.32.1)\n", + "Requirement already satisfied: markdown>=2.6.8 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.3.4)\n", + "Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.6.1)\n", + "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (4.2.2)\n", + "Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.2.8)\n", + "Requirement already satisfied: rsa<5,>=3.1.4 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (4.7.2)\n", + "Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.3.0)\n", + "Requirement already satisfied: importlib-metadata in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.10.1)\n", + "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (0.4.8)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (1.26.5)\n", + "Requirement already satisfied: idna<3,>=2.5 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2.10)\n", + "Requirement already satisfied: chardet<5,>=3.0.2 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (4.0.0)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (2021.5.30)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: oauthlib>=3.0.0 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.1.1)\n", + "Requirement already satisfied: zipp>=0.5 in /home/clive/anaconda3/envs/core/lib/python3.7/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow<3,>=2.8.0->tensorflow-serving-api->-r requirements.txt (line 2)) (3.4.1)\n" + ] + } + ], "source": [ "!pip install -r requirements.txt" ] @@ -43,18 +101,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\"strimzi\" already exists with the same configuration, skipping\r\n" + ] + } + ], "source": [ "!helm repo add strimzi https://strimzi.io/charts/" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "NAME: my-release\r\n", + "LAST DEPLOYED: Thu May 19 09:40:16 2022\r\n", + "NAMESPACE: seldon\r\n", + "STATUS: deployed\r\n", + "REVISION: 1\r\n", + "TEST SUITE: None\r\n", + "NOTES:\r\n", + "Thank you for installing strimzi-kafka-operator-0.28.0\r\n", + "\r\n", + "To create a Kafka cluster refer to the following documentation.\r\n", + "\r\n", + "https://strimzi.io/docs/operators/latest/deploying.html#deploying-cluster-operator-helm-chart-str\r\n" + ] + } + ], "source": [ "!helm install my-release strimzi/strimzi-kafka-operator" ] @@ -68,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -78,9 +163,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kafka.kafka.strimzi.io/my-cluster created\r\n" + ] + } + ], "source": [ "if clusterType == \"kind\":\n", " !kubectl apply -f cluster-kind.yaml\n", @@ -97,14 +190,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "env: BROKER=172.18.255.3:9092\n" + ] + } + ], "source": [ "if clusterType == \"kind\":\n", - " res = !kubectl get service my-cluster-kafka-external-bootstrap -n default -o=jsonpath='{.spec.ports[0].nodePort}'\n", - " port = res[0]\n", - " %env BROKER=172.17.0.2:$port\n", + " res = !kubectl get service my-cluster-kafka-plain-bootstrap -n seldon -o=jsonpath='{.status.loadBalancer.ingress[0].ip}'\n", + " ip = res[0]\n", + " %env BROKER=$ip:9092\n", "else:\n", " res = !kubectl get service my-cluster-kafka-external-bootstrap -o=jsonpath='{.status.loadBalancer.ingress[0].hostname}'\n", " if len(res) == 1:\n", @@ -118,9 +219,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Overwriting topics.yaml\n" + ] + } + ], "source": [ "%%writefile topics.yaml\n", "apiVersion: kafka.strimzi.io/v1beta1\n", @@ -166,9 +275,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kafkatopic.kafka.strimzi.io/cifar10-rest-input unchanged\r\n", + "kafkatopic.kafka.strimzi.io/cifar10-rest-output unchanged\r\n", + "kafkatopic.kafka.strimzi.io/cifar10-grpc-input unchanged\r\n", + "kafkatopic.kafka.strimzi.io/cifar10-grpc-output unchanged\r\n" + ] + } + ], "source": [ "!kubectl apply -f topics.yaml" ] @@ -179,8 +299,7 @@ "source": [ "## Install Seldon\n", "\n", - " * [Install Seldon](https://docs.seldon.io/projects/seldon-core/en/latest/workflow/install.html)\n", - " * [Follow our docs to intstall the Grafana analytics](https://docs.seldon.io/projects/seldon-core/en/latest/analytics/analytics.html)." + " * [Install seldon via ansible](https://github.com/SeldonIO/ansible-k8s-collection)" ] }, { @@ -193,9 +312,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "Updates are available for some Google Cloud CLI components. To install them,\n", + "please run:\n", + " $ gcloud components update\n", + "\n", + "Copying gs://seldon-datasets/cifar10/requests/tensorflow/cifar10_tensorflow.json.gz...\n", + "==> NOTE: You are downloading one or more large file(s), which would \n", + "run significantly faster if you enabled sliced object downloads. This\n", + "feature is enabled by default but requires that compiled crcmod be\n", + "installed (see \"gsutil help crcmod\").\n", + "\n", + "/ [1 files][324.3 MiB/324.3 MiB] 13.9 MiB/s \n", + "Operation completed over 1 objects/324.3 MiB. \n", + "gzip: cifar10_tensorflow.json already exists; do you wish to overwrite (y or n)? ^C\n", + "Copying gs://seldon-datasets/cifar10/requests/tensorflow/cifar10_tensorflow.proto...\n", + "==> NOTE: You are downloading one or more large file(s), which would \n", + "run significantly faster if you enabled sliced object downloads. This\n", + "feature is enabled by default but requires that compiled crcmod be\n", + "installed (see \"gsutil help crcmod\").\n", + "\n", + "\\ [1 files][589.3 MiB/589.3 MiB] 13.9 MiB/s \n", + "Operation completed over 1 objects/589.3 MiB. \n" + ] + } + ], "source": [ "!gsutil cp gs://seldon-datasets/cifar10/requests/tensorflow/cifar10_tensorflow.json.gz cifar10_tensorflow.json.gz\n", "!gunzip cifar10_tensorflow.json.gz\n", @@ -218,29 +367,563 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-05-19 13:41:46.005544: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", + "2022-05-19 13:41:46.005581: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n", + "%4|1652964107.403|CONFWARN|clive-T470p#producer-1| [thrd:app]: Configuration property group.id is a consumer property and will be ignored by this producer instance\n", + "%4|1652964107.403|CONFWARN|clive-T470p#producer-1| [thrd:app]: Configuration property auto.offset.reset is a consumer property and will be ignored by this producer instance\n", + "messages sent: 100\n", + "messages sent: 200\n", + "messages sent: 300\n", + "messages sent: 400\n", + "messages sent: 500\n", + "messages sent: 600\n", + "messages sent: 700\n", + "messages sent: 800\n", + "messages sent: 900\n", + "messages sent: 1000\n", + "messages sent: 1100\n", + "messages sent: 1200\n", + "messages sent: 1300\n", + "messages sent: 1400\n", + "messages sent: 1500\n", + "messages sent: 1600\n", + "messages sent: 1700\n", + "messages sent: 1800\n", + "messages sent: 1900\n", + "messages sent: 2000\n", + "messages sent: 2100\n", + "messages sent: 2200\n", + "messages sent: 2300\n", + "messages sent: 2400\n", + "messages sent: 2500\n", + "messages sent: 2600\n", + "messages sent: 2700\n", + "messages sent: 2800\n", + "messages sent: 2900\n", + "messages sent: 3000\n", + "messages sent: 3100\n", + "messages sent: 3200\n", + "messages sent: 3300\n", + "messages sent: 3400\n", + "messages sent: 3500\n", + "messages sent: 3600\n", + "messages sent: 3700\n", + "messages sent: 3800\n", + "messages sent: 3900\n", + "messages sent: 4000\n", + "messages sent: 4100\n", + "messages sent: 4200\n", + "messages sent: 4300\n", + "messages sent: 4400\n", + "messages sent: 4500\n", + "messages sent: 4600\n", + "messages sent: 4700\n", + "messages sent: 4800\n", + "messages sent: 4900\n", + "messages sent: 5000\n", + "messages sent: 5100\n", + "messages sent: 5200\n", + "messages sent: 5300\n", + "messages sent: 5400\n", + "messages sent: 5500\n", + "messages sent: 5600\n", + "messages sent: 5700\n", + "messages sent: 5800\n", + "messages sent: 5900\n", + "messages sent: 6000\n", + "messages sent: 6100\n", + "messages sent: 6200\n", + "messages sent: 6300\n", + "messages sent: 6400\n", + "messages sent: 6500\n", + "messages sent: 6600\n", + "messages sent: 6700\n", + "messages sent: 6800\n", + "messages sent: 6900\n", + "messages sent: 7000\n", + "messages sent: 7100\n", + "messages sent: 7200\n", + "messages sent: 7300\n", + "messages sent: 7400\n", + "messages sent: 7500\n", + "messages sent: 7600\n", + "messages sent: 7700\n", + "messages sent: 7800\n", + "messages sent: 7900\n", + "messages sent: 8000\n", + "messages sent: 8100\n", + "messages sent: 8200\n", + "messages sent: 8300\n", + "messages sent: 8400\n", + "messages sent: 8500\n", + "messages sent: 8600\n", + "messages sent: 8700\n", + "messages sent: 8800\n", + "messages sent: 8900\n", + "messages sent: 9000\n", + "messages sent: 9100\n", + "messages sent: 9200\n", + "messages sent: 9300\n", + "messages sent: 9400\n", + "messages sent: 9500\n", + "messages sent: 9600\n", + "messages sent: 9700\n", + "messages sent: 9800\n", + "messages sent: 9900\n", + "messages sent: 10000\n", + "messages sent: 10100\n", + "messages sent: 10200\n", + "messages sent: 10300\n", + "messages sent: 10400\n", + "messages sent: 10500\n", + "messages sent: 10600\n", + "messages sent: 10700\n", + "messages sent: 10800\n", + "messages sent: 10900\n", + "messages sent: 11000\n", + "messages sent: 11100\n", + "messages sent: 11200\n", + "messages sent: 11300\n", + "messages sent: 11400\n", + "messages sent: 11500\n", + "messages sent: 11600\n", + "messages sent: 11700\n", + "messages sent: 11800\n", + "messages sent: 11900\n", + "messages sent: 12000\n", + "messages sent: 12100\n", + "messages sent: 12200\n", + "messages sent: 12300\n", + "messages sent: 12400\n", + "messages sent: 12500\n", + "messages sent: 12600\n", + "messages sent: 12700\n", + "messages sent: 12800\n", + "messages sent: 12900\n", + "messages sent: 13000\n", + "messages sent: 13100\n", + "messages sent: 13200\n", + "messages sent: 13300\n", + "messages sent: 13400\n", + "messages sent: 13500\n", + "messages sent: 13600\n", + "messages sent: 13700\n", + "messages sent: 13800\n", + "messages sent: 13900\n", + "messages sent: 14000\n", + "messages sent: 14100\n", + "messages sent: 14200\n", + "messages sent: 14300\n", + "messages sent: 14400\n", + "messages sent: 14500\n", + "messages sent: 14600\n", + "messages sent: 14700\n", + "messages sent: 14800\n", + "messages sent: 14900\n", + "messages sent: 15000\n", + "messages sent: 15100\n", + "messages sent: 15200\n", + "messages sent: 15300\n", + "messages sent: 15400\n", + "messages sent: 15500\n", + "messages sent: 15600\n", + "messages sent: 15700\n", + "messages sent: 15800\n", + "messages sent: 15900\n", + "messages sent: 16000\n", + "messages sent: 16100\n", + "messages sent: 16200\n", + "messages sent: 16300\n", + "messages sent: 16400\n", + "messages sent: 16500\n", + "messages sent: 16600\n", + "messages sent: 16700\n", + "messages sent: 16800\n", + "messages sent: 16900\n", + "messages sent: 17000\n", + "messages sent: 17100\n", + "messages sent: 17200\n", + "messages sent: 17300\n", + "messages sent: 17400\n", + "messages sent: 17500\n", + "messages sent: 17600\n", + "messages sent: 17700\n", + "messages sent: 17800\n", + "messages sent: 17900\n", + "messages sent: 18000\n", + "messages sent: 18100\n", + "messages sent: 18200\n", + "messages sent: 18300\n", + "messages sent: 18400\n", + "messages sent: 18500\n", + "messages sent: 18600\n", + "messages sent: 18700\n", + "messages sent: 18800\n", + "messages sent: 18900\n", + "messages sent: 19000\n", + "messages sent: 19100\n", + "messages sent: 19200\n", + "messages sent: 19300\n", + "messages sent: 19400\n", + "messages sent: 19500\n", + "messages sent: 19600\n", + "messages sent: 19700\n", + "messages sent: 19800\n", + "messages sent: 19900\n", + "messages sent: 20000\n", + "messages sent: 20100\n", + "messages sent: 20200\n", + "messages sent: 20300\n", + "messages sent: 20400\n", + "messages sent: 20500\n", + "messages sent: 20600\n", + "messages sent: 20700\n", + "messages sent: 20800\n", + "messages sent: 20900\n", + "messages sent: 21000\n", + "messages sent: 21100\n", + "messages sent: 21200\n", + "messages sent: 21300\n", + "messages sent: 21400\n", + "messages sent: 21500\n", + "messages sent: 21600\n", + "messages sent: 21700\n", + "messages sent: 21800\n", + "messages sent: 21900\n", + "messages sent: 22000\n", + "messages sent: 22100\n", + "messages sent: 22200\n", + "messages sent: 22300\n", + "messages sent: 22400\n", + "messages sent: 22500\n", + "messages sent: 22600\n", + "messages sent: 22700\n", + "messages sent: 22800\n", + "messages sent: 22900\n", + "messages sent: 23000\n", + "messages sent: 23100\n", + "messages sent: 23200\n", + "messages sent: 23300\n", + "messages sent: 23400\n", + "messages sent: 23500\n", + "messages sent: 23600\n", + "messages sent: 23700\n", + "messages sent: 23800\n", + "messages sent: 23900\n", + "messages sent: 24000\n", + "messages sent: 24100\n", + "messages sent: 24200\n", + "messages sent: 24300\n", + "messages sent: 24400\n", + "messages sent: 24500\n", + "messages sent: 24600\n", + "messages sent: 24700\n", + "messages sent: 24800\n", + "messages sent: 24900\n", + "messages sent: 25000\n", + "messages sent: 25100\n", + "messages sent: 25200\n", + "messages sent: 25300\n", + "messages sent: 25400\n", + "messages sent: 25500\n", + "messages sent: 25600\n", + "messages sent: 25700\n", + "messages sent: 25800\n", + "messages sent: 25900\n", + "messages sent: 26000\n", + "messages sent: 26100\n", + "messages sent: 26200\n", + "messages sent: 26300\n", + "messages sent: 26400\n", + "messages sent: 26500\n", + "messages sent: 26600\n", + "messages sent: 26700\n", + "messages sent: 26800\n", + "messages sent: 26900\n", + "messages sent: 27000\n", + "messages sent: 27100\n", + "messages sent: 27200\n", + "messages sent: 27300\n", + "messages sent: 27400\n", + "messages sent: 27500\n", + "messages sent: 27600\n", + "messages sent: 27700\n", + "messages sent: 27800\n", + "messages sent: 27900\n", + "messages sent: 28000\n", + "messages sent: 28100\n", + "messages sent: 28200\n", + "messages sent: 28300\n", + "messages sent: 28400\n", + "messages sent: 28500\n", + "messages sent: 28600\n", + "messages sent: 28700\n", + "messages sent: 28800\n", + "messages sent: 28900\n", + "messages sent: 29000\n", + "messages sent: 29100\n", + "messages sent: 29200\n", + "messages sent: 29300\n", + "messages sent: 29400\n", + "messages sent: 29500\n", + "messages sent: 29600\n", + "messages sent: 29700\n", + "messages sent: 29800\n", + "messages sent: 29900\n", + "messages sent: 30000\n", + "messages sent: 30100\n", + "messages sent: 30200\n", + "messages sent: 30300\n", + "messages sent: 30400\n", + "messages sent: 30500\n", + "messages sent: 30600\n", + "messages sent: 30700\n", + "messages sent: 30800\n", + "messages sent: 30900\n", + "messages sent: 31000\n", + "messages sent: 31100\n", + "messages sent: 31200\n", + "messages sent: 31300\n", + "messages sent: 31400\n", + "messages sent: 31500\n", + "messages sent: 31600\n", + "messages sent: 31700\n", + "messages sent: 31800\n", + "messages sent: 31900\n", + "messages sent: 32000\n", + "messages sent: 32100\n", + "messages sent: 32200\n", + "messages sent: 32300\n", + "messages sent: 32400\n", + "messages sent: 32500\n", + "messages sent: 32600\n", + "messages sent: 32700\n", + "messages sent: 32800\n", + "messages sent: 32900\n", + "messages sent: 33000\n", + "messages sent: 33100\n", + "messages sent: 33200\n", + "messages sent: 33300\n", + "messages sent: 33400\n", + "messages sent: 33500\n", + "messages sent: 33600\n", + "messages sent: 33700\n", + "messages sent: 33800\n", + "messages sent: 33900\n", + "messages sent: 34000\n", + "messages sent: 34100\n", + "messages sent: 34200\n", + "messages sent: 34300\n", + "messages sent: 34400\n", + "messages sent: 34500\n", + "messages sent: 34600\n", + "messages sent: 34700\n", + "messages sent: 34800\n", + "messages sent: 34900\n", + "messages sent: 35000\n", + "messages sent: 35100\n", + "messages sent: 35200\n", + "messages sent: 35300\n", + "messages sent: 35400\n", + "messages sent: 35500\n", + "messages sent: 35600\n", + "messages sent: 35700\n", + "messages sent: 35800\n", + "messages sent: 35900\n", + "messages sent: 36000\n", + "messages sent: 36100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "messages sent: 36200\n", + "messages sent: 36300\n", + "messages sent: 36400\n", + "messages sent: 36500\n", + "messages sent: 36600\n", + "messages sent: 36700\n", + "messages sent: 36800\n", + "messages sent: 36900\n", + "messages sent: 37000\n", + "messages sent: 37100\n", + "messages sent: 37200\n", + "messages sent: 37300\n", + "messages sent: 37400\n", + "messages sent: 37500\n", + "messages sent: 37600\n", + "messages sent: 37700\n", + "messages sent: 37800\n", + "messages sent: 37900\n", + "messages sent: 38000\n", + "messages sent: 38100\n", + "messages sent: 38200\n", + "messages sent: 38300\n", + "messages sent: 38400\n", + "messages sent: 38500\n", + "messages sent: 38600\n", + "messages sent: 38700\n", + "messages sent: 38800\n", + "messages sent: 38900\n", + "messages sent: 39000\n", + "messages sent: 39100\n", + "messages sent: 39200\n", + "messages sent: 39300\n", + "messages sent: 39400\n", + "messages sent: 39500\n", + "messages sent: 39600\n", + "messages sent: 39700\n", + "messages sent: 39800\n", + "messages sent: 39900\n", + "messages sent: 40000\n", + "messages sent: 40100\n", + "messages sent: 40200\n", + "messages sent: 40300\n", + "messages sent: 40400\n", + "messages sent: 40500\n", + "messages sent: 40600\n", + "messages sent: 40700\n", + "messages sent: 40800\n", + "messages sent: 40900\n", + "messages sent: 41000\n", + "messages sent: 41100\n", + "messages sent: 41200\n", + "messages sent: 41300\n", + "messages sent: 41400\n", + "messages sent: 41500\n", + "messages sent: 41600\n", + "messages sent: 41700\n", + "messages sent: 41800\n", + "messages sent: 41900\n", + "messages sent: 42000\n", + "messages sent: 42100\n", + "messages sent: 42200\n", + "messages sent: 42300\n", + "messages sent: 42400\n", + "messages sent: 42500\n", + "messages sent: 42600\n", + "messages sent: 42700\n", + "messages sent: 42800\n", + "messages sent: 42900\n", + "messages sent: 43000\n", + "messages sent: 43100\n", + "messages sent: 43200\n", + "messages sent: 43300\n", + "messages sent: 43400\n", + "messages sent: 43500\n", + "messages sent: 43600\n", + "messages sent: 43700\n", + "messages sent: 43800\n", + "messages sent: 43900\n", + "messages sent: 44000\n", + "messages sent: 44100\n", + "messages sent: 44200\n", + "messages sent: 44300\n", + "messages sent: 44400\n", + "messages sent: 44500\n", + "messages sent: 44600\n", + "messages sent: 44700\n", + "messages sent: 44800\n", + "messages sent: 44900\n", + "messages sent: 45000\n", + "messages sent: 45100\n", + "messages sent: 45200\n", + "messages sent: 45300\n", + "messages sent: 45400\n", + "messages sent: 45500\n", + "messages sent: 45600\n", + "messages sent: 45700\n", + "messages sent: 45800\n", + "messages sent: 45900\n", + "messages sent: 46000\n", + "messages sent: 46100\n", + "messages sent: 46200\n", + "messages sent: 46300\n", + "messages sent: 46400\n", + "messages sent: 46500\n", + "messages sent: 46600\n", + "messages sent: 46700\n", + "messages sent: 46800\n", + "messages sent: 46900\n", + "messages sent: 47000\n", + "messages sent: 47100\n", + "messages sent: 47200\n", + "messages sent: 47300\n", + "messages sent: 47400\n", + "messages sent: 47500\n", + "messages sent: 47600\n", + "messages sent: 47700\n", + "messages sent: 47800\n", + "messages sent: 47900\n", + "messages sent: 48000\n", + "messages sent: 48100\n", + "messages sent: 48200\n", + "messages sent: 48300\n", + "messages sent: 48400\n", + "messages sent: 48500\n", + "messages sent: 48600\n", + "messages sent: 48700\n", + "messages sent: 48800\n", + "messages sent: 48900\n", + "messages sent: 49000\n", + "messages sent: 49100\n", + "messages sent: 49200\n", + "messages sent: 49300\n", + "messages sent: 49400\n", + "messages sent: 49500\n", + "messages sent: 49600\n", + "messages sent: 49700\n", + "messages sent: 49800\n", + "messages sent: 49900\n", + "messages sent: 50000\n", + "Final messages sent count: 50000\n" + ] + } + ], "source": [ "!python ../../../util/kafka/test-client.py produce $BROKER cifar10-rest-input --file cifar10_tensorflow.json" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "env: BROKER_CIP=10.96.66.27\n" + ] + } + ], "source": [ - "res = !kubectl get service my-cluster-kafka-external-bootstrap -o=jsonpath='{.spec.clusterIP}'\n", + "res = !kubectl get service my-cluster-kafka-plain-bootstrap -o=jsonpath='{.spec.clusterIP}'\n", "ip = res[0]\n", "%env BROKER_CIP=$ip" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Overwriting cifar10_rest.yaml\n" + ] + } + ], "source": [ "%%writefile cifar10_rest.yaml\n", "apiVersion: machinelearning.seldon.io/v1\n", @@ -285,11 +968,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "seldondeployment.machinelearning.seldon.io/tfserving-cifar10 created\r\n" + ] + } + ], "source": [ - "!cat cifar10_rest.yaml | sed s/BROKER_IP/$BROKER_CIP:9094/ | kubectl apply -f -" + "!cat cifar10_rest.yaml | sed s/BROKER_IP/$BROKER_CIP:9092/ | kubectl apply -f -" ] }, { @@ -303,9 +994,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "seldondeployment.machinelearning.seldon.io \"tfserving-cifar10\" deleted\r\n" + ] + } + ], "source": [ "!kubectl delete -f cifar10_rest.yaml" ] @@ -326,29 +1025,563 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 41, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-05-19 15:23:40.161293: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", + "2022-05-19 15:23:40.161322: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n", + "%4|1652970223.000|CONFWARN|clive-T470p#producer-1| [thrd:app]: Configuration property group.id is a consumer property and will be ignored by this producer instance\n", + "%4|1652970223.000|CONFWARN|clive-T470p#producer-1| [thrd:app]: Configuration property auto.offset.reset is a consumer property and will be ignored by this producer instance\n", + "Messages sent: 100\n", + "Messages sent: 200\n", + "Messages sent: 300\n", + "Messages sent: 400\n", + "Messages sent: 500\n", + "Messages sent: 600\n", + "Messages sent: 700\n", + "Messages sent: 800\n", + "Messages sent: 900\n", + "Messages sent: 1000\n", + "Messages sent: 1100\n", + "Messages sent: 1200\n", + "Messages sent: 1300\n", + "Messages sent: 1400\n", + "Messages sent: 1500\n", + "Messages sent: 1600\n", + "Messages sent: 1700\n", + "Messages sent: 1800\n", + "Messages sent: 1900\n", + "Messages sent: 2000\n", + "Messages sent: 2100\n", + "Messages sent: 2200\n", + "Messages sent: 2300\n", + "Messages sent: 2400\n", + "Messages sent: 2500\n", + "Messages sent: 2600\n", + "Messages sent: 2700\n", + "Messages sent: 2800\n", + "Messages sent: 2900\n", + "Messages sent: 3000\n", + "Messages sent: 3100\n", + "Messages sent: 3200\n", + "Messages sent: 3300\n", + "Messages sent: 3400\n", + "Messages sent: 3500\n", + "Messages sent: 3600\n", + "Messages sent: 3700\n", + "Messages sent: 3800\n", + "Messages sent: 3900\n", + "Messages sent: 4000\n", + "Messages sent: 4100\n", + "Messages sent: 4200\n", + "Messages sent: 4300\n", + "Messages sent: 4400\n", + "Messages sent: 4500\n", + "Messages sent: 4600\n", + "Messages sent: 4700\n", + "Messages sent: 4800\n", + "Messages sent: 4900\n", + "Messages sent: 5000\n", + "Messages sent: 5100\n", + "Messages sent: 5200\n", + "Messages sent: 5300\n", + "Messages sent: 5400\n", + "Messages sent: 5500\n", + "Messages sent: 5600\n", + "Messages sent: 5700\n", + "Messages sent: 5800\n", + "Messages sent: 5900\n", + "Messages sent: 6000\n", + "Messages sent: 6100\n", + "Messages sent: 6200\n", + "Messages sent: 6300\n", + "Messages sent: 6400\n", + "Messages sent: 6500\n", + "Messages sent: 6600\n", + "Messages sent: 6700\n", + "Messages sent: 6800\n", + "Messages sent: 6900\n", + "Messages sent: 7000\n", + "Messages sent: 7100\n", + "Messages sent: 7200\n", + "Messages sent: 7300\n", + "Messages sent: 7400\n", + "Messages sent: 7500\n", + "Messages sent: 7600\n", + "Messages sent: 7700\n", + "Messages sent: 7800\n", + "Messages sent: 7900\n", + "Messages sent: 8000\n", + "Messages sent: 8100\n", + "Messages sent: 8200\n", + "Messages sent: 8300\n", + "Messages sent: 8400\n", + "Messages sent: 8500\n", + "Messages sent: 8600\n", + "Messages sent: 8700\n", + "Messages sent: 8800\n", + "Messages sent: 8900\n", + "Messages sent: 9000\n", + "Messages sent: 9100\n", + "Messages sent: 9200\n", + "Messages sent: 9300\n", + "Messages sent: 9400\n", + "Messages sent: 9500\n", + "Messages sent: 9600\n", + "Messages sent: 9700\n", + "Messages sent: 9800\n", + "Messages sent: 9900\n", + "Messages sent: 10000\n", + "Messages sent: 10100\n", + "Messages sent: 10200\n", + "Messages sent: 10300\n", + "Messages sent: 10400\n", + "Messages sent: 10500\n", + "Messages sent: 10600\n", + "Messages sent: 10700\n", + "Messages sent: 10800\n", + "Messages sent: 10900\n", + "Messages sent: 11000\n", + "Messages sent: 11100\n", + "Messages sent: 11200\n", + "Messages sent: 11300\n", + "Messages sent: 11400\n", + "Messages sent: 11500\n", + "Messages sent: 11600\n", + "Messages sent: 11700\n", + "Messages sent: 11800\n", + "Messages sent: 11900\n", + "Messages sent: 12000\n", + "Messages sent: 12100\n", + "Messages sent: 12200\n", + "Messages sent: 12300\n", + "Messages sent: 12400\n", + "Messages sent: 12500\n", + "Messages sent: 12600\n", + "Messages sent: 12700\n", + "Messages sent: 12800\n", + "Messages sent: 12900\n", + "Messages sent: 13000\n", + "Messages sent: 13100\n", + "Messages sent: 13200\n", + "Messages sent: 13300\n", + "Messages sent: 13400\n", + "Messages sent: 13500\n", + "Messages sent: 13600\n", + "Messages sent: 13700\n", + "Messages sent: 13800\n", + "Messages sent: 13900\n", + "Messages sent: 14000\n", + "Messages sent: 14100\n", + "Messages sent: 14200\n", + "Messages sent: 14300\n", + "Messages sent: 14400\n", + "Messages sent: 14500\n", + "Messages sent: 14600\n", + "Messages sent: 14700\n", + "Messages sent: 14800\n", + "Messages sent: 14900\n", + "Messages sent: 15000\n", + "Messages sent: 15100\n", + "Messages sent: 15200\n", + "Messages sent: 15300\n", + "Messages sent: 15400\n", + "Messages sent: 15500\n", + "Messages sent: 15600\n", + "Messages sent: 15700\n", + "Messages sent: 15800\n", + "Messages sent: 15900\n", + "Messages sent: 16000\n", + "Messages sent: 16100\n", + "Messages sent: 16200\n", + "Messages sent: 16300\n", + "Messages sent: 16400\n", + "Messages sent: 16500\n", + "Messages sent: 16600\n", + "Messages sent: 16700\n", + "Messages sent: 16800\n", + "Messages sent: 16900\n", + "Messages sent: 17000\n", + "Messages sent: 17100\n", + "Messages sent: 17200\n", + "Messages sent: 17300\n", + "Messages sent: 17400\n", + "Messages sent: 17500\n", + "Messages sent: 17600\n", + "Messages sent: 17700\n", + "Messages sent: 17800\n", + "Messages sent: 17900\n", + "Messages sent: 18000\n", + "Messages sent: 18100\n", + "Messages sent: 18200\n", + "Messages sent: 18300\n", + "Messages sent: 18400\n", + "Messages sent: 18500\n", + "Messages sent: 18600\n", + "Messages sent: 18700\n", + "Messages sent: 18800\n", + "Messages sent: 18900\n", + "Messages sent: 19000\n", + "Messages sent: 19100\n", + "Messages sent: 19200\n", + "Messages sent: 19300\n", + "Messages sent: 19400\n", + "Messages sent: 19500\n", + "Messages sent: 19600\n", + "Messages sent: 19700\n", + "Messages sent: 19800\n", + "Messages sent: 19900\n", + "Messages sent: 20000\n", + "Messages sent: 20100\n", + "Messages sent: 20200\n", + "Messages sent: 20300\n", + "Messages sent: 20400\n", + "Messages sent: 20500\n", + "Messages sent: 20600\n", + "Messages sent: 20700\n", + "Messages sent: 20800\n", + "Messages sent: 20900\n", + "Messages sent: 21000\n", + "Messages sent: 21100\n", + "Messages sent: 21200\n", + "Messages sent: 21300\n", + "Messages sent: 21400\n", + "Messages sent: 21500\n", + "Messages sent: 21600\n", + "Messages sent: 21700\n", + "Messages sent: 21800\n", + "Messages sent: 21900\n", + "Messages sent: 22000\n", + "Messages sent: 22100\n", + "Messages sent: 22200\n", + "Messages sent: 22300\n", + "Messages sent: 22400\n", + "Messages sent: 22500\n", + "Messages sent: 22600\n", + "Messages sent: 22700\n", + "Messages sent: 22800\n", + "Messages sent: 22900\n", + "Messages sent: 23000\n", + "Messages sent: 23100\n", + "Messages sent: 23200\n", + "Messages sent: 23300\n", + "Messages sent: 23400\n", + "Messages sent: 23500\n", + "Messages sent: 23600\n", + "Messages sent: 23700\n", + "Messages sent: 23800\n", + "Messages sent: 23900\n", + "Messages sent: 24000\n", + "Messages sent: 24100\n", + "Messages sent: 24200\n", + "Messages sent: 24300\n", + "Messages sent: 24400\n", + "Messages sent: 24500\n", + "Messages sent: 24600\n", + "Messages sent: 24700\n", + "Messages sent: 24800\n", + "Messages sent: 24900\n", + "Messages sent: 25000\n", + "Messages sent: 25100\n", + "Messages sent: 25200\n", + "Messages sent: 25300\n", + "Messages sent: 25400\n", + "Messages sent: 25500\n", + "Messages sent: 25600\n", + "Messages sent: 25700\n", + "Messages sent: 25800\n", + "Messages sent: 25900\n", + "Messages sent: 26000\n", + "Messages sent: 26100\n", + "Messages sent: 26200\n", + "Messages sent: 26300\n", + "Messages sent: 26400\n", + "Messages sent: 26500\n", + "Messages sent: 26600\n", + "Messages sent: 26700\n", + "Messages sent: 26800\n", + "Messages sent: 26900\n", + "Messages sent: 27000\n", + "Messages sent: 27100\n", + "Messages sent: 27200\n", + "Messages sent: 27300\n", + "Messages sent: 27400\n", + "Messages sent: 27500\n", + "Messages sent: 27600\n", + "Messages sent: 27700\n", + "Messages sent: 27800\n", + "Messages sent: 27900\n", + "Messages sent: 28000\n", + "Messages sent: 28100\n", + "Messages sent: 28200\n", + "Messages sent: 28300\n", + "Messages sent: 28400\n", + "Messages sent: 28500\n", + "Messages sent: 28600\n", + "Messages sent: 28700\n", + "Messages sent: 28800\n", + "Messages sent: 28900\n", + "Messages sent: 29000\n", + "Messages sent: 29100\n", + "Messages sent: 29200\n", + "Messages sent: 29300\n", + "Messages sent: 29400\n", + "Messages sent: 29500\n", + "Messages sent: 29600\n", + "Messages sent: 29700\n", + "Messages sent: 29800\n", + "Messages sent: 29900\n", + "Messages sent: 30000\n", + "Messages sent: 30100\n", + "Messages sent: 30200\n", + "Messages sent: 30300\n", + "Messages sent: 30400\n", + "Messages sent: 30500\n", + "Messages sent: 30600\n", + "Messages sent: 30700\n", + "Messages sent: 30800\n", + "Messages sent: 30900\n", + "Messages sent: 31000\n", + "Messages sent: 31100\n", + "Messages sent: 31200\n", + "Messages sent: 31300\n", + "Messages sent: 31400\n", + "Messages sent: 31500\n", + "Messages sent: 31600\n", + "Messages sent: 31700\n", + "Messages sent: 31800\n", + "Messages sent: 31900\n", + "Messages sent: 32000\n", + "Messages sent: 32100\n", + "Messages sent: 32200\n", + "Messages sent: 32300\n", + "Messages sent: 32400\n", + "Messages sent: 32500\n", + "Messages sent: 32600\n", + "Messages sent: 32700\n", + "Messages sent: 32800\n", + "Messages sent: 32900\n", + "Messages sent: 33000\n", + "Messages sent: 33100\n", + "Messages sent: 33200\n", + "Messages sent: 33300\n", + "Messages sent: 33400\n", + "Messages sent: 33500\n", + "Messages sent: 33600\n", + "Messages sent: 33700\n", + "Messages sent: 33800\n", + "Messages sent: 33900\n", + "Messages sent: 34000\n", + "Messages sent: 34100\n", + "Messages sent: 34200\n", + "Messages sent: 34300\n", + "Messages sent: 34400\n", + "Messages sent: 34500\n", + "Messages sent: 34600\n", + "Messages sent: 34700\n", + "Messages sent: 34800\n", + "Messages sent: 34900\n", + "Messages sent: 35000\n", + "Messages sent: 35100\n", + "Messages sent: 35200\n", + "Messages sent: 35300\n", + "Messages sent: 35400\n", + "Messages sent: 35500\n", + "Messages sent: 35600\n", + "Messages sent: 35700\n", + "Messages sent: 35800\n", + "Messages sent: 35900\n", + "Messages sent: 36000\n", + "Messages sent: 36100\n", + "Messages sent: 36200\n", + "Messages sent: 36300\n", + "Messages sent: 36400\n", + "Messages sent: 36500\n", + "Messages sent: 36600\n", + "Messages sent: 36700\n", + "Messages sent: 36800\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Messages sent: 36900\n", + "Messages sent: 37000\n", + "Messages sent: 37100\n", + "Messages sent: 37200\n", + "Messages sent: 37300\n", + "Messages sent: 37400\n", + "Messages sent: 37500\n", + "Messages sent: 37600\n", + "Messages sent: 37700\n", + "Messages sent: 37800\n", + "Messages sent: 37900\n", + "Messages sent: 38000\n", + "Messages sent: 38100\n", + "Messages sent: 38200\n", + "Messages sent: 38300\n", + "Messages sent: 38400\n", + "Messages sent: 38500\n", + "Messages sent: 38600\n", + "Messages sent: 38700\n", + "Messages sent: 38800\n", + "Messages sent: 38900\n", + "Messages sent: 39000\n", + "Messages sent: 39100\n", + "Messages sent: 39200\n", + "Messages sent: 39300\n", + "Messages sent: 39400\n", + "Messages sent: 39500\n", + "Messages sent: 39600\n", + "Messages sent: 39700\n", + "Messages sent: 39800\n", + "Messages sent: 39900\n", + "Messages sent: 40000\n", + "Messages sent: 40100\n", + "Messages sent: 40200\n", + "Messages sent: 40300\n", + "Messages sent: 40400\n", + "Messages sent: 40500\n", + "Messages sent: 40600\n", + "Messages sent: 40700\n", + "Messages sent: 40800\n", + "Messages sent: 40900\n", + "Messages sent: 41000\n", + "Messages sent: 41100\n", + "Messages sent: 41200\n", + "Messages sent: 41300\n", + "Messages sent: 41400\n", + "Messages sent: 41500\n", + "Messages sent: 41600\n", + "Messages sent: 41700\n", + "Messages sent: 41800\n", + "Messages sent: 41900\n", + "Messages sent: 42000\n", + "Messages sent: 42100\n", + "Messages sent: 42200\n", + "Messages sent: 42300\n", + "Messages sent: 42400\n", + "Messages sent: 42500\n", + "Messages sent: 42600\n", + "Messages sent: 42700\n", + "Messages sent: 42800\n", + "Messages sent: 42900\n", + "Messages sent: 43000\n", + "Messages sent: 43100\n", + "Messages sent: 43200\n", + "Messages sent: 43300\n", + "Messages sent: 43400\n", + "Messages sent: 43500\n", + "Messages sent: 43600\n", + "Messages sent: 43700\n", + "Messages sent: 43800\n", + "Messages sent: 43900\n", + "Messages sent: 44000\n", + "Messages sent: 44100\n", + "Messages sent: 44200\n", + "Messages sent: 44300\n", + "Messages sent: 44400\n", + "Messages sent: 44500\n", + "Messages sent: 44600\n", + "Messages sent: 44700\n", + "Messages sent: 44800\n", + "Messages sent: 44900\n", + "Messages sent: 45000\n", + "Messages sent: 45100\n", + "Messages sent: 45200\n", + "Messages sent: 45300\n", + "Messages sent: 45400\n", + "Messages sent: 45500\n", + "Messages sent: 45600\n", + "Messages sent: 45700\n", + "Messages sent: 45800\n", + "Messages sent: 45900\n", + "Messages sent: 46000\n", + "Messages sent: 46100\n", + "Messages sent: 46200\n", + "Messages sent: 46300\n", + "Messages sent: 46400\n", + "Messages sent: 46500\n", + "Messages sent: 46600\n", + "Messages sent: 46700\n", + "Messages sent: 46800\n", + "Messages sent: 46900\n", + "Messages sent: 47000\n", + "Messages sent: 47100\n", + "Messages sent: 47200\n", + "Messages sent: 47300\n", + "Messages sent: 47400\n", + "Messages sent: 47500\n", + "Messages sent: 47600\n", + "Messages sent: 47700\n", + "Messages sent: 47800\n", + "Messages sent: 47900\n", + "Messages sent: 48000\n", + "Messages sent: 48100\n", + "Messages sent: 48200\n", + "Messages sent: 48300\n", + "Messages sent: 48400\n", + "Messages sent: 48500\n", + "Messages sent: 48600\n", + "Messages sent: 48700\n", + "Messages sent: 48800\n", + "Messages sent: 48900\n", + "Messages sent: 49000\n", + "Messages sent: 49100\n", + "Messages sent: 49200\n", + "Messages sent: 49300\n", + "Messages sent: 49400\n", + "Messages sent: 49500\n", + "Messages sent: 49600\n", + "Messages sent: 49700\n", + "Messages sent: 49800\n", + "Messages sent: 49900\n", + "Messages sent: 50000\n", + "Final messages sent count: 50000\n" + ] + } + ], "source": [ "!python ../../../util/kafka/test-client.py produce $BROKER cifar10-grpc-input --file cifar10_tensorflow.proto --proto_name tensorflow.serving.PredictRequest" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "env: BROKER_CIP=10.96.66.27\n" + ] + } + ], "source": [ - "res = !kubectl get service my-cluster-kafka-external-bootstrap -o=jsonpath='{.spec.clusterIP}'\n", + "res = !kubectl get service my-cluster-kafka-plain-bootstrap -o=jsonpath='{.spec.clusterIP}'\n", "ip = res[0]\n", "%env BROKER_CIP=$ip" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Overwriting cifar10_grpc.yaml\n" + ] + } + ], "source": [ "%%writefile cifar10_grpc.yaml\n", "apiVersion: machinelearning.seldon.io/v1\n", @@ -373,6 +1606,8 @@ " name: resnet32\n", " ports:\n", " - containerPort: 8500\n", + " name: grpc\n", + " - containerPort: 8501\n", " name: http\n", " svcOrchSpec:\n", " env:\n", @@ -386,18 +1621,27 @@ " name: resnet32\n", " type: MODEL\n", " endpoint:\n", - " service_port: 8500\n", + " grpcPort: 8500\n", + " httpPort: 8501\n", " name: model\n", - " replicas: 2" + " replicas: 1" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "seldondeployment.machinelearning.seldon.io/tfserving-cifar10 created\r\n" + ] + } + ], "source": [ - "!cat cifar10_grpc.yaml | sed s/BROKER_IP/$BROKER_CIP:9094/ | kubectl apply -f -" + "!cat cifar10_grpc.yaml | sed s/BROKER_IP/$BROKER_CIP:9092/ | kubectl apply -f -" ] }, { @@ -411,9 +1655,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "seldondeployment.machinelearning.seldon.io \"tfserving-cifar10\" deleted\r\n" + ] + } + ], "source": [ "!kubectl delete -f cifar10_grpc.yaml" ] @@ -428,7 +1680,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -442,7 +1694,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.10" } }, "nbformat": 4, diff --git a/examples/kafka/cifar10/cluster-cloud.yaml b/examples/kafka/cifar10/cluster-cloud.yaml index 51d3ddc80d..b576b65329 100644 --- a/examples/kafka/cifar10/cluster-cloud.yaml +++ b/examples/kafka/cifar10/cluster-cloud.yaml @@ -1,28 +1,40 @@ -apiVersion: kafka.strimzi.io/v1beta1 +apiVersion: kafka.strimzi.io/v1beta2 kind: Kafka metadata: name: my-cluster spec: kafka: - version: 2.5.0 + version: 3.1.0 replicas: 3 listeners: - plain: {} - tls: {} - external: + - name: plain + port: 9092 type: loadbalancer tls: false + - name: tls + port: 9093 + type: loadbalancer + tls: true + storage: + type: jbod + volumes: + - id: 0 + type: persistent-claim + size: 100Gi + deleteClaim: false config: offsets.topic.replication.factor: 3 transaction.state.log.replication.factor: 3 transaction.state.log.min.isr: 2 - log.message.format.version: "2.5" - storage: - type: ephemeral + auto.create.topics.enable: true + default.replication.factor: 1 + min.insync.replicas: 1 zookeeper: replicas: 3 storage: - type: ephemeral + type: persistent-claim + size: 100Gi + deleteClaim: false entityOperator: topicOperator: {} userOperator: {} diff --git a/examples/kafka/cifar10/cluster-kind.yaml b/examples/kafka/cifar10/cluster-kind.yaml index a1af47f98d..60b87635ae 100644 --- a/examples/kafka/cifar10/cluster-kind.yaml +++ b/examples/kafka/cifar10/cluster-kind.yaml @@ -1,16 +1,20 @@ -apiVersion: kafka.strimzi.io/v1beta1 +apiVersion: kafka.strimzi.io/v1beta2 kind: Kafka metadata: name: my-cluster spec: kafka: + version: 3.1.0 replicas: 1 listeners: - plain: {} - tls: {} - external: - type: nodeport + - name: plain + port: 9092 + type: loadbalancer tls: false + - name: tls + port: 9093 + type: loadbalancer + tls: true storage: type: jbod volumes: @@ -22,6 +26,9 @@ spec: offsets.topic.replication.factor: 1 transaction.state.log.replication.factor: 1 transaction.state.log.min.isr: 1 + auto.create.topics.enable: true + default.replication.factor: 1 + min.insync.replicas: 1 zookeeper: replicas: 1 storage: diff --git a/operator/controllers/seldondeployment_engine.go b/operator/controllers/seldondeployment_engine.go index c8beee8008..6b26595abe 100644 --- a/operator/controllers/seldondeployment_engine.go +++ b/operator/controllers/seldondeployment_engine.go @@ -191,6 +191,11 @@ func createExecutorContainer(mlDep *machinelearningv1.SeldonDeployment, p *machi protocol = machinelearningv1.ProtocolSeldon } + transport := mlDep.Spec.Transport + if transport == "" { + transport = machinelearningv1.TransportRest + } + serverType := mlDep.Spec.ServerType if serverType == "" { serverType = machinelearningv1.ServerRPC @@ -231,6 +236,7 @@ func createExecutorContainer(mlDep *machinelearningv1.SeldonDeployment, p *machi "--http_port", strconv.Itoa(http_port), "--grpc_port", strconv.Itoa(grpc_port), "--protocol", string(protocol), + "--transport", string(transport), "--prometheus_path", getPrometheusPath(mlDep), "--server_type", string(serverType), "--log_work_buffer_size", loggerQSize,