Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the demo cluster configuration for Apache Wayang Demos #473

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ pom.xml.*
.vscode
.vscode/*


# Kafka integration configuration for development
/build/env.sh
/conf/kafka/default.properties
/wayang-platforms/wayang-java/src/main/resources/wayang-kafka-defaults.properties
/wayang-platforms/wayang-java/src/main/resources/wayang-kafka-defaults.properties.template
/docker_compose/demo_env_cluster/metabase-data/

# Scala Plugin for VSCode
.metals


6 changes: 6 additions & 0 deletions bin/wayang-submit
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,11 @@ do
ARGS="$ARGS \"${arg}\""
done

<<<<<<< HEAD
WAYANG_CLASSPATH="${WAYANG_CLASSPATH}:${WAYANG_APP_HOME}"

echo "$RUNNER $FLAGS -cp "${WAYANG_CLASSPATH}" $CLASS ${ARGS}"
=======
>>>>>>> cb0abdb393b89099a12a1b3904154717aac754b0
eval "$RUNNER $FLAGS -cp "${WAYANG_CLASSPATH}" $CLASS ${ARGS}"

63 changes: 63 additions & 0 deletions docker_compose/demo_env_cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--
# 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.
-->

# Wayang Demo Cluster
This module provides a configuration for our Apache Wayang playground.

It contains the following services:
- Confluent Platform for Kafka topics incl. Schema Registry and Controle Center
- 2 PostgreSQL databases
- Apache Spark cluster with one master and 2 workers
- AKHQ

## Confluent Platform
The Docker image `confluentinc/confluent-local:7.6.2` is part of **Confluent's platform** for managing **Apache Kafka** deployments. This image typically contains components for setting up Kafka clusters, including **Kafka brokers, Zookeeper, Confluent Control Center, Kafka Connect, Schema Registry, and more**. It's used for **local development** or testing Kafka clusters in containerized environments. The version 7.6.2 refers to a specific release that includes certain updates and bug fixes for Confluent's stack based on Kafka.

This image is particularly useful for creating development environments, enabling quick Kafka setup with integrated Confluent tools.

## Postgres
```
docker exec -it postgres psql -U postgres
```

## Spark
https://github.com/mvillarrealb/docker-spark-cluster/tree/master

## AKHQ
The image tchiotludo/akhq is used for AKHQ, a web-based user interface that provides management, monitoring, and analysis tools for Apache Kafka. It allows users to easily interact with Kafka clusters, topics, consumer groups, and messages in real-time. This Docker image is typically used to deploy AKHQ in containerized environments.

Key features of AKHQ include:

• Viewing and managing topics: Listing Kafka topics, searching messages, creating, deleting, or configuring topics.
• Monitoring consumer groups: Checking the status, offsets, and lag for consumer groups.
• Viewing Kafka messages: Browsing messages, searching, and filtering based on keys or values.
• Schema Registry support: Managing schemas if you’re using Kafka’s schema registry.

This makes it a useful tool for developers, data engineers, and administrators working with Kafka, as it provides a GUI to interact with Kafka more effectively.

You can find more details on the official GitHub repository for AKHQ: https://github.com/tchiotludo/akhq.

## Metabase
The `metabase` service in your Docker Compose setup uses the **Metabase** Docker image (`metabase/metabase:latest`). **Metabase** is an open-source **business intelligence** (BI) tool designed for interactive data analysis and dashboarding.

In this setup:

- The `depends_on` ensures that Metabase waits for the **Postgres** service to be up and running before it starts.
- Metabase will be accessible on **port 3000** of the host machine.
- It's part of the `democluster_net` network, meaning it will communicate with other services in the same network, like Postgres, for querying data.

This configuration allows you to deploy Metabase to query and visualize data from the PostgreSQL database and other supported databases.
35 changes: 35 additions & 0 deletions docker_compose/demo_env_cluster/dataset/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- 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.

\c postgres;

DROP DATABASE IF EXISTS apache_wayang_test_db;

CREATE DATABASE apache_wayang_test_db;

\c apache_wayang_test_db;

CREATE TABLE local_averages(
CategoryID SERIAL PRIMARY KEY,
CategoryName varchar(50),
CategoryCount integer,
CategorySum integer
);
insert into local_averages(CategoryName,CategoryCount,CategorySum)
values ('car',8,4),
('bike', 10, 5),
('bus', 12, 6),
('train', 15, 9),
('plane', 20, 12);
35 changes: 35 additions & 0 deletions docker_compose/demo_env_cluster/dataset/init2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- 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.

\c postgres;

DROP DATABASE IF EXISTS apache_wayang_test_db;

CREATE DATABASE apache_wayang_test_db;

\c apache_wayang_test_db;

CREATE TABLE local_averages(
CategoryID SERIAL PRIMARY KEY,
CategoryName varchar(50),
CategoryCount integer,
CategorySum integer
);
insert into local_averages(CategoryName,CategoryCount,CategorySum)
values ('car',80,40),
('bike', 100, 50),
('bus', 120, 60),
('train', 150, 90),
('plane', 200, 120);
35 changes: 35 additions & 0 deletions docker_compose/demo_env_cluster/dataset/init3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- 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.

\c postgres;

DROP DATABASE IF EXISTS apache_wayang_test_db;

CREATE DATABASE apache_wayang_test_db;

\c apache_wayang_test_db;

CREATE TABLE local_averages(
CategoryID SERIAL PRIMARY KEY,
CategoryName varchar(50),
CategoryCount integer,
CategorySum integer
);
insert into local_averages(CategoryName,CategoryCount,CategorySum)
values ('car',800,400),
('bike', 1000, 500),
('bus', 1200, 600),
('train', 1500, 900),
('plane', 2000, 1200);
Loading
Loading