Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new entrypoint cmd per guidance from Pulp team #2105

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 -
Loading