Skip to content

Commit

Permalink
feat: [ZNO-2042] add analytical DB (clickhouse)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Kaliberda committed Sep 29, 2023
1 parent 6c7896f commit 7a3002b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker-compose-non-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,25 @@ services:
healthcheck:
disable: true

clickhouse:
image: clickhouse/clickhouse-server:22.3
user: "101:101"
env_file: docker/.env-non-dev
container_name: superset_clickhouse
hostname: clickhouse
restart: unless-stopped
volumes:
- clickhouse:/var/lib/clickhouse
ports:
- "127.0.0.1:8123:8123"
- "127.0.0.1:9000:9000"

volumes:
superset_home:
external: false
db_home:
external: false
redis:
external: false
clickhouse:
external: false
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,25 @@ services:
healthcheck:
test: ["CMD-SHELL", "celery inspect ping -A superset.tasks.celery_app:app -d celery@$$HOSTNAME"]

clickhouse:
image: clickhouse/clickhouse-server:22.3
user: "101:101"
env_file: docker/.env
container_name: superset_clickhouse
hostname: clickhouse
restart: unless-stopped
volumes:
- clickhouse:/var/lib/clickhouse
ports:
- "127.0.0.1:8123:8123"
- "127.0.0.1:9000:9000"

volumes:
superset_home:
external: false
db_home:
external: false
redis:
external: false
clickhouse:
external: false
7 changes: 7 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ SUPERSET_LOAD_EXAMPLES=yes
CYPRESS_CONFIG=false
SUPERSET_PORT=8088
MAPBOX_API_KEY=''

SUPERSET_CLICKHOUSE_INIT=yes
CLICKHOUSE_URI=clickhousedb://superset:superset@clickhouse:8123/superset
CLICKHOUSE_DB=superset
CLICKHOUSE_USER=superset
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
CLICKHOUSE_PASSWORD=superset
7 changes: 7 additions & 0 deletions docker/.env-non-dev
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ SUPERSET_SECRET_KEY=TEST_NON_DEV_SECRET
CYPRESS_CONFIG=false
SUPERSET_PORT=8088
MAPBOX_API_KEY=''

SUPERSET_CLICKHOUSE_INIT=yes
CLICKHOUSE_URI=clickhousedb://superset:superset@clickhouse:8123/superset
CLICKHOUSE_DB=superset
CLICKHOUSE_USER=superset
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
CLICKHOUSE_PASSWORD=superset
10 changes: 10 additions & 0 deletions docker/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then
fi
echo_step "4" "Complete" "Loading examples"
fi

if [ "$SUPERSET_CLICKHOUSE_INIT" = "yes" ]; then
# Setup clickhouse DB
echo_step "5" "Starting" "Setup clickhouse DB"
# If Cypress run which consumes superset_test_config – load required data for tests
superset set-database-uri \
--database_name clickhouse \
--uri "$CLICKHOUSE_URI"
echo_step "5" "Complete" "Setup clickhouse DB"
fi

0 comments on commit 7a3002b

Please sign in to comment.