Skip to content

Commit

Permalink
chore: removing redundant docker-entrypoint (apache#17687)
Browse files Browse the repository at this point in the history
* chore: removing redundant docker-entrypoint

* chore: chmod the run-server

* Update Dockerfile

Co-authored-by: Amit Miran <47772523+amitmiran137@users.noreply.github.com>
  • Loading branch information
ofekisr and amitmiran137 committed Dec 8, 2021
1 parent 8c25f2f commit aee5c9a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 51 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ RUN cd /app \
&& chown -R superset:superset * \
&& pip install -e .

COPY ./docker/docker-entrypoint.sh /usr/bin/
COPY ./docker/run-server.sh /usr/bin/

RUN chmod a+x /usr/bin/run-server.sh

WORKDIR /app

Expand All @@ -116,7 +118,7 @@ HEALTHCHECK CMD curl -f "http://localhost:$SUPERSET_PORT/health"

EXPOSE ${SUPERSET_PORT}

ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD /usr/bin/run-server.sh

######################################################################
# Dev image...
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 3 additions & 12 deletions docker/docker-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 0 additions & 34 deletions docker/docker-entrypoint.sh

This file was deleted.

32 changes: 32 additions & 0 deletions docker/run-server.sh
Original file line number Diff line number Diff line change
@@ -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}"
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit aee5c9a

Please sign in to comment.