From b7028222f706307cbd59b1c3adcd46df0c3b7d0b Mon Sep 17 00:00:00 2001 From: ofekisr Date: Wed, 8 Dec 2021 14:38:12 +0200 Subject: [PATCH] chore: removing redundant docker-entrypoint --- Dockerfile | 4 ++-- docker/docker-bootstrap.sh | 2 +- docker/docker-ci.sh | 15 +++------------ docker/docker-entrypoint.sh | 34 ---------------------------------- docker/run-server.sh | 32 ++++++++++++++++++++++++++++++++ helm/superset/Chart.yaml | 2 +- helm/superset/values.yaml | 2 +- 7 files changed, 40 insertions(+), 51 deletions(-) delete mode 100755 docker/docker-entrypoint.sh create mode 100644 docker/run-server.sh diff --git a/Dockerfile b/Dockerfile index 7ccef7447b74f..3c72e2f44e436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,7 +106,7 @@ RUN cd /app \ && chown -R superset:superset * \ && pip install -e . -COPY ./docker/docker-entrypoint.sh /usr/bin/ +COPY ./docker/run-server.sh /usr/bin/ WORKDIR /app @@ -116,7 +116,7 @@ HEALTHCHECK CMD curl -f "http://localhost:$SUPERSET_PORT/health" EXPOSE ${SUPERSET_PORT} -ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] +CMD /user/bin/run-server.sh ###################################################################### # Dev image... diff --git a/docker/docker-bootstrap.sh b/docker/docker-bootstrap.sh index 4a8e27966424a..67e5294be5fdc 100755 --- a/docker/docker-bootstrap.sh +++ b/docker/docker-bootstrap.sh @@ -47,5 +47,5 @@ elif [[ "${1}" == "app" ]]; then flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0 elif [[ "${1}" == "app-gunicorn" ]]; then echo "Starting web app..." - /app/docker/docker-entrypoint.sh + /usr/bin/run-server.sh fi diff --git a/docker/docker-ci.sh b/docker/docker-ci.sh index cc84c8adc9340..9e97cbbad493e 100755 --- a/docker/docker-ci.sh +++ b/docker/docker-ci.sh @@ -20,16 +20,7 @@ # TODO: copy config overrides from ENV vars # TODO: run celery in detached state - +export SERVER_THREADS_AMOUNT=8 # start up the web server -gunicorn \ - --bind "0.0.0.0:${SUPERSET_PORT}" \ - --access-logfile '-' \ - --error-logfile '-' \ - --workers 1 \ - --worker-class gthread \ - --threads 8 \ - --timeout 60 \ - --limit-request-line 0 \ - --limit-request-field_size 0 \ - "${FLASK_APP}" + +/usr/bin/run-server.sh diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh deleted file mode 100755 index 57ed13d9cf24c..0000000000000 --- a/docker/docker-entrypoint.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/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 - -if [ "${#}" -ne 0 ]; then - exec "${@}" -else - gunicorn \ - --bind "0.0.0.0:${SUPERSET_PORT}" \ - --access-logfile '-' \ - --error-logfile '-' \ - --workers 1 \ - --worker-class gthread \ - --threads 20 \ - --timeout ${GUNICORN_TIMEOUT:-60} \ - --limit-request-line 0 \ - --limit-request-field_size 0 \ - "${FLASK_APP}" -fi diff --git a/docker/run-server.sh b/docker/run-server.sh new file mode 100644 index 0000000000000..5519ff5d5c6b8 --- /dev/null +++ b/docker/run-server.sh @@ -0,0 +1,32 @@ +#!/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. +# +HYPHEN_SYMBOL='-' + +gunicorn \ + --bind "${SUPERSET_BIND_ADDRESS:-0.0.0.0}:${SUPERSET_PORT:-8088}" \ + --access-logfile "${ACCESS_LOG_FILE:-$HYPHEN_SYMBOL}" \ + --error-logfile "${ERROR_LOG_FILE:-$HYPHEN_SYMBOL}" \ + --workers ${SERVER_WORKER_AMOUNT:-1} \ + --worker-class ${SERVER_WORKER_CLASS:-gthread} \ + --threads ${SERVER_THREADS_AMOUNT:-20} \ + --timeout ${GUNICORN_TIMEOUT:-60} \ + --limit-request-line ${SERVER_LIMIT_REQUEST_LINE:-0} \ + --limit-request-field_size ${SERVER_LIMIT_REQUEST_FIELD_SIZE:-0} \ + "${FLASK_APP}" diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 95867192eda96..53e3625c5e1a6 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -22,7 +22,7 @@ maintainers: - name: craig-rueda email: craig@craigrueda.com url: https://github.com/craig-rueda -version: 0.4.0 +version: 0.5.0 dependencies: - name: postgresql version: 10.2.0 diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index dfbcd1370ff3e..059a8c90e203f 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -208,7 +208,7 @@ supersetNode: command: - "/bin/sh" - "-c" - - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; /usr/bin/docker-entrypoint.sh" + - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; /usr/bin/run-server.sh" connections: redis_host: '{{ template "superset.fullname" . }}-redis-headless' redis_port: "6379"