Add pulsar to CLI tools, fix Kafka smoke test (#1576)
diff --git a/installer/cli/.env b/installer/cli/.env
index 25fcb8a..d0ed018 100644
--- a/installer/cli/.env
+++ b/installer/cli/.env
@@ -27,9 +27,9 @@
# Configuration to set prioritized protocol in backend service
# needs to be changed in case one of the 'nats' or 'minimal' options is selected
-# options: kafka, mqtt, jms, nats
+# options: kafka, mqtt, jms, nats, pulsar
# default: kafka
-#SP_PRIORITIZED_PROTOCOL=nats
+SP_PRIORITIZED_PROTOCOL=kafka
# Configuration to set MQTT host in backend service
#
diff --git a/installer/cli/deploy/standalone/pulsar/docker-compose.dev.yml b/installer/cli/deploy/standalone/pulsar/docker-compose.dev.yml
new file mode 100644
index 0000000..f722fc4
--- /dev/null
+++ b/installer/cli/deploy/standalone/pulsar/docker-compose.dev.yml
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+version: "3.4"
+services:
+ broker:
+ environment:
+ - advertisedListeners=external:pulsar://127.0.0.1:6650
+ ports:
+ - "6650:6650"
+ - "8080:8080"
diff --git a/installer/cli/deploy/standalone/pulsar/docker-compose.yml b/installer/cli/deploy/standalone/pulsar/docker-compose.yml
new file mode 100644
index 0000000..7dcdb1e
--- /dev/null
+++ b/installer/cli/deploy/standalone/pulsar/docker-compose.yml
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+version: "3.4"
+services:
+ zookeeper:
+ image: apachepulsar/pulsar:3.0.0
+ container_name: zookeeper
+ restart: on-failure
+ networks:
+ spnet:
+ volumes:
+ - pulsarzkdata:/pulsar/data/zookeeper
+ environment:
+ - metadataStoreUrl=zk:zookeeper:2181
+ - PULSAR_MEM=-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m
+ command: >
+ bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \
+ bin/generate-zookeeper-config.sh conf/zookeeper.conf && \
+ exec bin/pulsar zookeeper"
+ healthcheck:
+ test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"]
+ interval: 10s
+ timeout: 5s
+ retries: 30
+
+ # Init cluster metadata
+ pulsar-init:
+ container_name: pulsar-init
+ hostname: pulsar-init
+ image: apachepulsar/pulsar:3.0.0
+ networks:
+ spnet:
+ command: >
+ bin/pulsar initialize-cluster-metadata \
+ --cluster cluster-a \
+ --zookeeper zookeeper:2181 \
+ --configuration-store zookeeper:2181 \
+ --web-service-url http://broker:8080 \
+ --broker-service-url pulsar://broker:6650
+ depends_on:
+ zookeeper:
+ condition: service_healthy
+
+ # Start bookie
+ bookie:
+ image: apachepulsar/pulsar:3.0.0
+ container_name: bookie
+ restart: on-failure
+ networks:
+ spnet:
+ environment:
+ - clusterName=cluster-a
+ - zkServers=zookeeper:2181
+ - metadataServiceUri=metadata-store:zk:zookeeper:2181
+ # otherwise every time we run docker compose uo or down we fail to start due to Cookie
+ # See: https://github.com/apache/bookkeeper/blob/405e72acf42bb1104296447ea8840d805094c787/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java#L57-68
+ - advertisedAddress=bookie
+ - BOOKIE_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
+ depends_on:
+ zookeeper:
+ condition: service_healthy
+ pulsar-init:
+ condition: service_completed_successfully
+ # Map the local directory to the container to avoid bookie startup failure due to insufficient container disks.
+ volumes:
+ - pulsarbkdata:/pulsar/data/bookkeeper
+ command: bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf && exec bin/pulsar bookie"
+
+ # Start broker
+ broker:
+ image: apachepulsar/pulsar:3.0.0
+ container_name: broker
+ hostname: broker
+ restart: on-failure
+ networks:
+ spnet:
+ environment:
+ - metadataStoreUrl=zk:zookeeper:2181
+ - zookeeperServers=zookeeper:2181
+ - clusterName=cluster-a
+ - managedLedgerDefaultEnsembleSize=1
+ - managedLedgerDefaultWriteQuorum=1
+ - managedLedgerDefaultAckQuorum=1
+ - advertisedAddress=broker
+ - advertisedListeners=external:pulsar://127.0.0.1:6650
+ - PULSAR_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
+ depends_on:
+ zookeeper:
+ condition: service_healthy
+ bookie:
+ condition: service_started
+ command: bash -c "bin/apply-config-from-env.py conf/broker.conf && exec bin/pulsar broker"
+
+volumes:
+ pulsarzkdata:
+ pulsarbkdata:
+
+networks:
+ spnet:
+ external: true
diff --git a/installer/cli/environments/basic-pulsar b/installer/cli/environments/basic-pulsar
new file mode 100644
index 0000000..fe220cc
--- /dev/null
+++ b/installer/cli/environments/basic-pulsar
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+[environment:basic-pulsar]
+consul
+couchdb
+influxdb
+pulsar
diff --git a/installer/cli/environments/lite-pulsar b/installer/cli/environments/lite-pulsar
new file mode 100644
index 0000000..791e49a
--- /dev/null
+++ b/installer/cli/environments/lite-pulsar
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+[environment:lite-pulsar]
+ui
+backend
+consul
+couchdb
+influxdb
+extensions-all-jvm
+pulsar
diff --git a/ui/cypress/tests/thirdparty/Kafka.smoke.spec.ts b/ui/cypress/tests/thirdparty/Kafka.smoke.spec.ts
index b34d8f2..fd79c9b 100644
--- a/ui/cypress/tests/thirdparty/Kafka.smoke.spec.ts
+++ b/ui/cypress/tests/thirdparty/Kafka.smoke.spec.ts
@@ -56,7 +56,7 @@
.addProtocolInput('input', 'host', host)
.addProtocolInput('input', 'port', port)
.addProtocolInput('click', 'sp-reload', '')
- .addProtocolInput('select', topicName, 'check')
+ .addProtocolInput('checkbox', topicName, 'check')
.setFormat('json')
.addFormatInput('checkbox', 'json_options-single_object', '')
.build();