You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "1c7 (via GitHub)" <gi...@apache.org> on 2023/02/18 02:09:02 UTC

[GitHub] [superset] 1c7 commented on issue #18616: Documentation on how to properly deploy Superset for production environment

1c7 commented on issue #18616:
URL: https://github.com/apache/superset/issues/18616#issuecomment-1435452197

   @SahanSrinivas I deploy Superset on `AWS ECS` (China Region)
   
   ## 1. Write a Dockerfile
   ```dockerfile
   FROM apache/superset:2.0.0
   
   # Install ClickHouse driver
   # Switching to root to install the required packages
   USER root
   RUN pip install clickhouse-driver==0.2.0 && pip install clickhouse-sqlalchemy==0.1.6
   # Switching back to using the `superset` user
   USER superset
   
   # config file
   COPY superset_config.py /app/pythonpath/superset_config.py
   ```
   
   ## 2. use `AWS Codebuild` to build the docker image,
   so my `buildspec.yml` file look like this
   ```yml
   version: 0.2
   
   phases:
     pre_build:
       commands:
         - echo 登录到 Amazon ECR...
         - $(aws ecr get-login --no-include-email --region cn-north-1)
         # https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html
         # 为了让 aws ecr get-login 命令能执行成功,请按照上面文档里给出的 policy 修改一下 IAM。
         # 添加这一段:
         # {
         #   "Action": [
         #     "ecr:BatchCheckLayerAvailability",
         #     "ecr:CompleteLayerUpload",
         #     "ecr:GetAuthorizationToken",
         #     "ecr:InitiateLayerUpload",
         #     "ecr:PutImage",
         #     "ecr:UploadLayerPart"
         #   ],
         #   "Resource": "*",
         #   "Effect": "Allow"
         # },
     build:
       commands:
         - echo Build 的开始时间是 `date`
         - echo 构建 Docker 镜像
         - docker build -t 832343096630.dkr.ecr.cn-north-1.amazonaws.com.cn/miracleplus-superset ./src/
     post_build:
       commands:
         - echo $CODEBUILD_BUILD_SUCCEEDING
         - if [ $CODEBUILD_BUILD_SUCCEEDING == 0 ]; then echo "Build 步骤失败了"; exit 255; else echo "Build 步骤成功了"; fi
         - echo Build 完成时间 `date`
         - echo 开始推送 Docker Image 到 ECR
         - docker push 832343096630.dkr.ecr.cn-north-1.amazonaws.com.cn/miracleplus-superset
   
   ```
   
   ## 3. in the final step of Step 2, the docker image save to AWS ECR.
   
   ## 4. write a `ECS Task definitions`
   * set `Image URI` as the ECR address like `832343096630.dkr.ecr.cn-north-1.amazonaws.com.cn/miracleplus-superset:latest`
   * set environment variable like `DATABASE_PASSWORD` etc
   
   ## 5. last step, create a ECS cluster, create a service, use that task definition
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org