Skip to content

Commit

Permalink
Use new entrypoint cmd per guidance from Pulp team
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: Christian M. Adams <[email protected]>
  • Loading branch information
rooftopcellist committed Mar 26, 2024
1 parent 6af55dc commit 05c407f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
9 changes: 5 additions & 4 deletions docker/bin/start-api
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ set -o errexit
set -o nounset


readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/venv/bin/pulpcore-api'}
readonly GUNICORN_FORWARDED_ALLOW_IPS="${GUNICORN_FORWARDED_ALLOW_IPS:-}"
readonly GUNICORN_WORKERS="${GUNICORN_WORKERS:-4}"
readonly GUNICORN_LOGGER_CLASS="${GUNICORN_LOGGER_CLASS:-}"
readonly GUNICORN_TIMEOUT="${GUNICORN_TIMEOUT:-60}"

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT=${GUNICORN_PORT:-8000}
readonly APP_MODULE='pulpcore.app.wsgi:application'


GUNICORN_OPTIONS=(
--bind "${BIND_HOST}:${BIND_PORT}"
--workers "${GUNICORN_WORKERS}"
--access-logfile -
--limit-request-field_size 32768
--timeout "${GUNICORN_TIMEOUT}"
)

# Note: add back the following option as soon as there is a fix for the pulpcore issue
# --limit-request-field-size 32768

if [[ -n "${GUNICORN_FORWARDED_ALLOW_IPS}" ]]; then
GUNICORN_OPTIONS+=(--forwarded-allow-ips "${GUNICORN_FORWARDED_ALLOW_IPS}")
fi
Expand All @@ -31,4 +32,4 @@ if [[ -n "${GUNICORN_LOGGER_CLASS}" ]]; then
GUNICORN_OPTIONS+=(--logger-class "${GUNICORN_LOGGER_CLASS}")
fi

exec "${GUNICORN}" "${GUNICORN_OPTIONS[@]}" "${APP_MODULE}"
exec "${ENTRYPOINT}" "${GUNICORN_OPTIONS[@]}"
5 changes: 2 additions & 3 deletions docker/bin/start-api-reload
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ set -o errexit
set -o nounset


readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/venv/bin/pulpcore-api'}
readonly GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
readonly GUNICORN_LOGGER_CLASS="${GUNICORN_LOGGER_CLASS:-}"

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT=8000
readonly APP_MODULE='pulpcore.app.wsgi:application'

GUNICORN_OPTIONS=(
--bind "${BIND_HOST}:${BIND_PORT}"
Expand All @@ -27,4 +26,4 @@ if [[ -n "${GUNICORN_LOGGER_CLASS}" ]]; then
GUNICORN_OPTIONS+=(--logger-class "${GUNICORN_LOGGER_CLASS}")
fi

exec "${GUNICORN}" "${GUNICORN_OPTIONS[@]}" "${APP_MODULE}"
exec "${ENTRYPOINT}" "${GUNICORN_OPTIONS[@]}"
10 changes: 3 additions & 7 deletions docker/bin/start-content-app
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
set -o errexit
set -o nounset

readonly GUNICORN=${GUNICORN:-'/venv/bin/gunicorn'}
readonly ENTRYPOINT=${ENTRYPOINT:-'/venv/bin/pulpcore-content'}
readonly GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}

readonly BIND_HOST='0.0.0.0'
readonly BIND_PORT="${GUNICORN_PORT:-24816}"
readonly WORKER_CLASS='aiohttp.GunicornWebWorker'
readonly APP_MODULE='pulpcore.content:server'

exec "${GUNICORN}" \
exec "${ENTRYPOINT}" \
--bind "${BIND_HOST}:${BIND_PORT}" \
--worker-class "${WORKER_CLASS}" \
--workers "${GUNICORN_WORKERS}" \
--access-logfile - \
"${APP_MODULE}"
--access-logfile -

0 comments on commit 05c407f

Please sign in to comment.