Superset Docker部署

Superset提供了Docker部署方式挺据,但是基于自己的環(huán)境如何部署,官方并沒有提供其掂,也很少有其他文章油挥,下面給出了幾點總結(jié),僅供參考款熬。

使用自己的MySQL和Redis深寥。注意,經(jīng)過測試贤牛,celery不能使用有密碼的Redis

#
# 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.
#
x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset:${TAG:-latest-dev}
x-superset-volumes:
  &superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
  - ./docker:/app/docker
  - superset_home:/app/superset_home

version: "3.7"
services:
  superset:
    env_file: docker/.env-non-dev
    image: *superset-image
    container_name: superset_app
    command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
    user: "root"
    restart: unless-stopped
    ports:
      - 8088:8088
    volumes: *superset-volumes
    environment:
      - DATABASE_DIALECT=mysql
      - DATABASE_HOST=
      - DATABASE_PORT=3306
      - DATABASE_DB=superset
      - DATABASE_USER=superset
      - DATABASE_PASSWORD=
      - REDIS_HOST=
      - REDIS_PORT=6379

  superset-init:
    image: *superset-image
    container_name: superset_init
    command: ["/app/docker/docker-init.sh"]
    env_file: docker/.env-non-dev
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      disable: true
    environment:
      - DATABASE_DIALECT=mysql
      - DATABASE_HOST=
      - DATABASE_PORT=3306
      - DATABASE_DB=superset
      - DATABASE_USER=superset
      - DATABASE_PASSWORD=
      - REDIS_HOST=
      - REDIS_PORT=6379
      - SUPERSET_LOAD_EXAMPLES=no

  superset-worker:
    image: *superset-image
    container_name: superset_worker
    command: ["/app/docker/docker-bootstrap.sh", "worker"]
    env_file: docker/.env-non-dev
    restart: unless-stopped
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME",
        ]
    environment:
      - DATABASE_DIALECT=mysql
      - DATABASE_HOST=
      - DATABASE_PORT=3306
      - DATABASE_DB=superset
      - DATABASE_USER=superset
      - DATABASE_PASSWORD=
      - REDIS_HOST=
      - REDIS_PORT=6379

  superset-worker-beat:
    image: *superset-image
    container_name: superset_worker_beat
    command: ["/app/docker/docker-bootstrap.sh", "beat"]
    env_file: docker/.env-non-dev
    restart: unless-stopped
    user: "root"
    volumes: *superset-volumes
    healthcheck:
      disable: true
    environment:
      - DATABASE_DIALECT=mysql
      - DATABASE_HOST=
      - DATABASE_PORT=3306
      - DATABASE_DB=superset
      - DATABASE_USER=superset
      - DATABASE_PASSWORD=
      - REDIS_HOST=
      - REDIS_PORT=6379

volumes:
  superset_home:
    external: false
  db_home:
    external: false
  redis:
    external: false

增加驅(qū)動依賴惋鹅,在docker目錄下創(chuàng)建requirements-local.txt文件。比如增加kylin驅(qū)動

kylinpy

使用國內(nèi)源殉簸,修改docker目錄下的docker-bootstrap.sh文件

#!/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 -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r "${REQUIREMENTS_LOCAL}" 
else
  echo "Skipping local overrides"
fi

case "${1}" in
  worker)
    echo "Starting Celery worker..."
    celery --app=superset.tasks.celery_app:app worker -O fair -l INFO
    ;;
  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

重置密碼

docker exec -it superset_app /bin/bash
superset fab reset-password --username admin --password yourpassword
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末闰集,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子般卑,更是在濱河造成了極大的恐慌武鲁,老刑警劉巖,帶你破解...
    沈念sama閱讀 219,188評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件蝠检,死亡現(xiàn)場離奇詭異沐鼠,居然都是意外死亡,警方通過查閱死者的電腦和手機蝇率,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,464評論 3 395
  • 文/潘曉璐 我一進店門迟杂,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人本慕,你說我怎么就攤上這事排拷。” “怎么了锅尘?”我有些...
    開封第一講書人閱讀 165,562評論 0 356
  • 文/不壞的土叔 我叫張陵监氢,是天一觀的道長。 經(jīng)常有香客問我藤违,道長浪腐,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,893評論 1 295
  • 正文 為了忘掉前任顿乒,我火速辦了婚禮议街,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘璧榄。我一直安慰自己特漩,他們只是感情好吧雹,可當(dāng)我...
    茶點故事閱讀 67,917評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著涂身,像睡著了一般雄卷。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上蛤售,一...
    開封第一講書人閱讀 51,708評論 1 305
  • 那天丁鹉,我揣著相機與錄音,去河邊找鬼悴能。 笑死揣钦,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的漠酿。 我是一名探鬼主播拂盯,決...
    沈念sama閱讀 40,430評論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼记靡!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起团驱,我...
    開封第一講書人閱讀 39,342評論 0 276
  • 序言:老撾萬榮一對情侶失蹤摸吠,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后嚎花,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體寸痢,經(jīng)...
    沈念sama閱讀 45,801評論 1 317
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,976評論 3 337
  • 正文 我和宋清朗相戀三年紊选,在試婚紗的時候發(fā)現(xiàn)自己被綠了啼止。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,115評論 1 351
  • 序言:一個原本活蹦亂跳的男人離奇死亡兵罢,死狀恐怖献烦,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情卖词,我是刑警寧澤巩那,帶...
    沈念sama閱讀 35,804評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站此蜈,受9級特大地震影響即横,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜裆赵,卻給世界環(huán)境...
    茶點故事閱讀 41,458評論 3 331
  • 文/蒙蒙 一东囚、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧战授,春花似錦页藻、人聲如沸桨嫁。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,008評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽瞧甩。三九已至,卻和暖如春弥鹦,著一層夾襖步出監(jiān)牢的瞬間肚逸,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,135評論 1 272
  • 我被黑心中介騙來泰國打工彬坏, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留朦促,地道東北人。 一個月前我還...
    沈念sama閱讀 48,365評論 3 373
  • 正文 我出身青樓栓始,卻偏偏與公主長得像务冕,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子幻赚,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,055評論 2 355

推薦閱讀更多精彩內(nèi)容