Last active
January 1, 2025 17:42
-
-
Save Slach/ad926dfa30ceb4fe1d168c00c3da98e0 to your computer and use it in GitHub Desktop.
superset + clickhouse docker-compose bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
superset/ | |
superset/clickhouse/ | |
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export SUPERSET_VERSION=${SUPERSET_VERSION:-4.0.2} | |
export CLICKHOUSE_PYTHON_DRIVER=${CLICKHOUSE_PYTHON_DRIVER:-clickhouse-connect} | |
if [[ ! -d superset ]]; then | |
git clone --depth 1 --branch ${SUPERSET_VERSION} https://github.com/apache/superset.git | |
else | |
cd superset | |
git fetch origin | |
git checkout ${SUPERSET_VERSION} | |
fi | |
if [[ "clickhouse-sqlalchemy" == "${CLICKHOUSE_PYTHON_DRIVER}" ]]; then | |
echo "clickhouse-sqlalchemy<0.2.0" > ./docker/requirements-local.txt | |
else | |
echo "clickhouse-connect" > ./docker/requirements-local.txt | |
fi | |
for id in $(docker ps -a -q); do docker stop $id; docker rm -f $id; done | |
docker-compose down --remove-orphan | |
docker-compose up -d db | |
docker-compose run superset-init | |
docker-compose up -d superset-node | |
docker-compose up -d superset-worker-beat | |
docker-compose up -d superset-worker | |
docker-compose up -d superset | |
docker run -d --name=clickhouse --network=superset_default ${CLICKHOUSE_IMAGE:-clickouse}/clickhouse-server:${CLICKHOUSE_VERSION:-latest} | |
cd ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ueo pipefail | |
export SUPERSET_VERSION=${SUPERSET_VERSION:-4.1.1} | |
export CLICKHOUSE_IMAGE=${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server} | |
export CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:-latest} | |
export DOCKER_COMPOSE_FILE=./superset/docker-compose-non-dev.yml | |
export CLICKHOUSE_PYTHON_DRIVER=${CLICKHOUSE_PYTHON_DRIVER:-clickhouse-connect} | |
if [[ ! -d superset ]]; then | |
git clone --depth 1 --branch ${SUPERSET_VERSION} https://github.com/apache/superset.git | |
else | |
cd superset | |
git fetch origin | |
# git checkout ${SUPERSET_VERSION} | |
cd ../ | |
fi | |
cp -fv ./Dockerfile.${CLICKHOUSE_PYTHON_DRIVER} ./superset/Dockerfile | |
mkdir -p ./superset/clickhouse/ | |
cp -fv *.xml ./superset/clickhouse/ | |
cp -fv server.* ./superset/clickhouse/ | |
cp -fv *.pem ./superset/clickhouse/ | |
# you need install latest version of https://mikefarah.gitbook.io/yq/ | |
yq -i eval '.services.superset.build.context = "./"' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.superset.build.dockerfile = "Dockerfile"' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.superset-init.build.dockerfile = "Dockerfile"' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.clickhouse.image = "${CLICKHOUSE_IMAGE:-clickhouse/clickhouse-server}:${CLICKHOUSE_VERSION:-latest}"' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.clickhouse.ports = ["8123:8123","9000:9000","8443:8443","9440:9440"]' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.clickhouse.volumes = ["./clickhouse/config.xml:/etc/clickhouse-server/config.d/config.xml","./clickhouse/default_user.xml:/etc/clickhouse-server/users.d/default_user.xml"]' ${DOCKER_COMPOSE_FILE} | |
yq -i eval '.services.clickhouse.volumes += ["./clickhouse/dhparam.pem:/etc/clickhouse-server/dhparam.pem","./clickhouse/server.key:/etc/clickhouse-server/server.key","./clickhouse/server.crt:/etc/clickhouse-server/server.crt"]' ${DOCKER_COMPOSE_FILE} | |
docker compose -f ${DOCKER_COMPOSE_FILE} build superset superset-init | |
docker compose -f ${DOCKER_COMPOSE_FILE} run --rm superset-init | |
docker compose -f ${DOCKER_COMPOSE_FILE} up -d clickhouse superset superset-worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<yandex> | |
<listen_host>::</listen_host> | |
<listen_host>0.0.0.0</listen_host> | |
<listen_try>1</listen_try> | |
<https_port>8443</https_port> | |
<tcp_port_secure>9440</tcp_port_secure> | |
<openSSL> | |
<server> | |
<certificateFile>/etc/clickhouse-server/server.crt</certificateFile> | |
<privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile> | |
<dhParamsFile>/etc/clickhouse-server/dhparam.pem</dhParamsFile> | |
<cacheSessions>true</cacheSessions> | |
<disableProtocols>sslv2,sslv3</disableProtocols> | |
<loadDefaultCAFile>true</loadDefaultCAFile> | |
<preferServerCiphers>true</preferServerCiphers> | |
<verificationMode>none</verificationMode> | |
</server> | |
</openSSL> | |
</yandex> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<yandex> | |
<profiles> | |
<default></default> | |
</profiles> | |
</yandex> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN DH PARAMETERS----- | |
MIICCAKCAgEAsGc5lXlTRpbIO5/hFhCu7Xr3fvW5yD9gumQuXkyRtk9hC211xPlB | |
j8aiac2NtwPkbmMAL80swp9aorEA2PJl0o4lHP3Cz1Ocy7pNujYNzxRuUmvHhrav | |
MQLE8KjVSnTAkA1qjS5CvkoUflikhzegSiXSaqSAwo7GctrZHaqa0mp0xMn2s+qR | |
lzmtw1foQo6+h6kB9NeaP+0ktbvHTWetZO4oyzlSzgJd11Z2bYaTqg4ypb3BFmkB | |
R+SM7funm9RY6SWqoKN98JBcn274rPjNOYXw2LQWbMO2NAaEh6AGo13f71d+C4If | |
rd8vEGltRwSvmqqhrOI/I+OqCvCvb45hul/Hhtq/Es5/2y4CsRZOcW5RgNSGPAm7 | |
GGqVeOCovSjE1FoTaBCl2LiLiHa6vmBjp69ddMS6JmRGFS1WFy+Wh9tY18U9eAd1 | |
Bl/gql9/n6aXxIJHkxrLxoS7VUNOs1cPKUW/0DukXISC8Uivyh6BRC/QIoYjYKeb | |
wa/0K2cs3sUJSovodi9dnYQ+fgdVUUZSNDrNQYa0he39EjMoKdPeGaqOzbqKGEVL | |
amDQoHVTp9bfM+O1jJmgOvGWVvCxSrCgPtHiPBts1uccG4Hbd+lKGIIuuEclXR25 | |
TfW/GQkulSuB+OF8JbEgsq6L77sDn+M6pK2PFmW6enlJSdnaJhRN+QMCAQI= | |
-----END DH PARAMETERS----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM apache/superset:${SUPERSET_VERSION:-4.1.1} AS dev | |
USER root | |
RUN pip3 install -U clickhouse-connect psycopg2-binary | |
USER superset | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM apache/superset:${SUPERSET_VERSION:-4.1.1} AS dev | |
USER root | |
RUN pip3 install -U "clickhouse-sqlalchemy" psycopg2-binary | |
USER superset | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE----- | |
MIIDCTCCAfGgAwIBAgIUOA0BFCj5oVjwu8ipBdQsr5cVD1IwDQYJKoZIhvcNAQEL | |
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDMxMTA1MjY1MloXDTIyMDMx | |
MTA1MjY1MlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF | |
AAOCAQ8AMIIBCgKCAQEAuEy1sx7KMh2ghd6BGfF62K9hI9vRux1vGxBM2Cu8iTvo | |
sDgaWy2gk+HpIHJUds7L6fnna0RQdwe7ZMh70r9lzo0ulME0S9rvBQh+jorYCeNA | |
J8q6aLQVBC3+YOIl9HmHPsQ9YjtSJHdHGjtP1FaQBFB8+ovw7YfCUernPXxJbarQ | |
LWhp0Y5voa2BClDlETYn7pHM+Ht/eM47/ih9sMC2V8njoeRrmMKIbeEloVPPnXKL | |
jiUiiN/ChPi7axpcio/4Zsr9QkedwXghlEwQLSqmW+DJagbUgOus1hmYBEx6rhOq | |
GZ46HpW1KVySn954a3sEbr3a0Hk9PP1atRzIpEWVnwIDAQABo1MwUTAdBgNVHQ4E | |
FgQUBItfSZn0tSvZ1B453/T9sXzTwFwwHwYDVR0jBBgwFoAUBItfSZn0tSvZ1B45 | |
3/T9sXzTwFwwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAXW2P | |
+92baw7Q11olRuBwva0VIpr0aVP8rnk711yaLQ9WMSQS2Bl8KbLzj1W1XQ3cZwjS | |
m/cEuJh3g8ucYqK83XnJ9GCjOqccXeMFmRwe/ysa1ZqPTaoiioSoMFhUILjIkH1f | |
NQZNnOM57769eOORPgdwpqlpx1FoLD+WBkjwki+cu7zk/DYBV9THYLc6YJKHK9oF | |
VuIHwzizR4gV/VmM9pPK30zQ4P4BZsn1QfKY/znugs7zmdjYqB8W5qpnkDQdFYCQ | |
N2FSYIR3McU1VQUKSfboir1+Qg+jJMy9TqFoA7x66vAtlwrp4XXG88R9JvUPgLZ8 | |
xSj39fI6Bm9Y7nirFg== | |
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PRIVATE KEY----- | |
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4TLWzHsoyH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G | |
JxaUtSG+xQKBgA9xvHtSXUIsS2nQJhoVnihz1Csfx3ESQzZSDopOloHQgx9u52NZ | |
Le83MIYgq8rpG4EYKJ6KENHbkVjEFg08EoKBqB6N4Nc6p3uk9Sx3j5RedtGtURWy | |
UmGqTCg0EfkMr4HlwOLP3fi8UKZ/dMsGkZcZRFrasWZEtLP45ceceCfZAoGBAIKJ | |
Ll6F6GiB5vnlIPqTb2HilW6CUWE+ubGMJNlQBf/HgaemB75vE2sbK08MpsFmmtCC | |
d3DIocLOFyLjgD2x4RGOPpCAQtardet34DCPBcBVbiZFKMN0o1DQCu5YFmFpIJH2 | |
mImWVhNQZbwg47bc+ygedMSh6DG+YlCEY953gb8lAoGBAM6HuCyV78upCjPmIEES | |
9r0goedItL8l5aS1xJE+NeW7DNUJELJqn6muTrIdECecD8WzKSt9Xf1huwlh1zlW | |
WGhOuQPZZr9M45eBPc6Yfxzy10iB5J787iHMl1ZKIAhJrjFd5d8WdRHtNsSI4iwt | |
2zZ2FxNNcSl7OdVFvgkyL4FE | |
-----END PRIVATE KEY----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment