diff --git a/README.md b/README.md index e57657a..8d678cc 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ POSTGRES_USER=my-user POSTGRES_PASSWORD=my-password ./run.sh postgres | Service Type | Service | Supported | |-----------------------------|---------------------------|------------| | Api Gateway | kong | ✅ | +| Cache | redis | ✅ | | Change Data Capture | debezium | ✅ | | Code Analysis | sonarqube | ✅ | | Database | cassandra | ✅ | @@ -147,6 +148,7 @@ POSTGRES_USER=my-user POSTGRES_PASSWORD=my-password ./run.sh postgres | Data Catalog | unitycatalog | ✅ | | Data Collector | fluentd | ✅ | | Data Collector | logstash | ✅ | +| Data Visualisation | superset | ✅ | | Distributed Coordination | zookeeper | ✅ | | Distributed Data Processing | flink | ✅ | | Identity Management | keycloak | ✅ | diff --git a/data/postgres/data/my_data.sql b/data/postgres/data/my_data.sql index 3cbaccf..48f618c 100644 --- a/data/postgres/data/my_data.sql +++ b/data/postgres/data/my_data.sql @@ -52,3 +52,5 @@ CREATE DATABASE keycloak; CREATE DATABASE marquez; CREATE DATABASE druid; CREATE DATABASE kong; +CREATE DATABASE superset; +CREATE DATABASE superset_examples; diff --git a/data/superset/docker/.env b/data/superset/docker/.env new file mode 100644 index 0000000..8a242fd --- /dev/null +++ b/data/superset/docker/.env @@ -0,0 +1,65 @@ +# +# 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. +# + + +COMPOSE_PROJECT_NAME=superset + +# database configurations (do not modify) +DATABASE_DB=superset +DATABASE_HOST=postgres +# Make sure you set this to a unique secure random value on production +DATABASE_PASSWORD=postgres +DATABASE_USER=postgres + +EXAMPLES_DB=superset_examples +EXAMPLES_HOST=postgres +EXAMPLES_USER=postgres +# Make sure you set this to a unique secure random value on production +EXAMPLES_PASSWORD=postgres +EXAMPLES_PORT=5432 + +# database engine specific environment variables +# change the below if you prefer another database engine +DATABASE_PORT=5432 +DATABASE_DIALECT=postgresql +POSTGRES_DB=superset +POSTGRES_USER=postgres +# Make sure you set this to a unique secure random value on production +POSTGRES_PASSWORD=postgres +#MYSQL_DATABASE=superset +#MYSQL_USER=superset +#MYSQL_PASSWORD=superset +#MYSQL_RANDOM_ROOT_PASSWORD=yes + +# Add the mapped in /app/pythonpath_docker which allows devs to override stuff +PYTHONPATH=/app/pythonpath:/app/docker/pythonpath_dev +REDIS_HOST=redis +REDIS_PORT=6379 + +FLASK_DEBUG=true +SUPERSET_ENV=development +SUPERSET_LOAD_EXAMPLES=yes +CYPRESS_CONFIG=false +SUPERSET_PORT=8088 +MAPBOX_API_KEY='' + +# Make sure you set this to a unique secure random value on production +SUPERSET_SECRET_KEY=TEST_NON_DEV_SECRET + +ENABLE_PLAYWRIGHT=false +PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +BUILD_SUPERSET_FRONTEND_IN_DOCKER=false \ No newline at end of file diff --git a/data/superset/docker/docker-bootstrap.sh b/data/superset/docker/docker-bootstrap.sh new file mode 100755 index 0000000..c02c5b5 --- /dev/null +++ b/data/superset/docker/docker-bootstrap.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -eo pipefail + +REQUIREMENTS_LOCAL="/app/docker/requirements-local.txt" +# If Cypress run – overwrite the password for admin and export env variables +if [ "$CYPRESS_CONFIG" == "true" ]; then + export SUPERSET_CONFIG=tests.integration_tests.superset_test_config + export SUPERSET_TESTENV=true + export SUPERSET__SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://superset:superset@db:5432/superset +fi +# +# Make sure we have dev requirements installed +# +if [ -f "${REQUIREMENTS_LOCAL}" ]; then + echo "Installing local overrides at ${REQUIREMENTS_LOCAL}" + pip install --no-cache-dir -r "${REQUIREMENTS_LOCAL}" +else + echo "Skipping local overrides" +# pip install --no-cache-dir /app +fi + +case "${1}" in + worker) + echo "Starting Celery worker..." + # setting up only 2 workers by default to contain memory usage in dev environments + celery --app=superset.tasks.celery_app:app worker -O fair -l INFO --concurrency=${CELERYD_CONCURRENCY:-2} + ;; + beat) + echo "Starting Celery beat..." + rm -f /tmp/celerybeat.pid + celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid -l INFO -s "${SUPERSET_HOME}"/celerybeat-schedule + ;; + app) + echo "Starting web app (using development server)..." + flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0 + ;; + app-gunicorn) + echo "Starting web app..." + /usr/bin/run-server.sh + ;; + *) + echo "Unknown Operation!!!" + ;; +esac \ No newline at end of file diff --git a/data/superset/docker/docker-init.sh b/data/superset/docker/docker-init.sh new file mode 100755 index 0000000..bbb7d2f --- /dev/null +++ b/data/superset/docker/docker-init.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# +# 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. +# +set -e + +# +# Always install local overrides first +# +/app/docker/docker-bootstrap.sh + +STEP_CNT=4 + +echo_step() { +cat <