diff --git a/images/assets/pulp-api b/images/assets/pulp-api index 4b15f24f..9d165496 100755 --- a/images/assets/pulp-api +++ b/images/assets/pulp-api @@ -31,12 +31,19 @@ if [ -n "${PULP_ADMIN_PASSWORD}" ]; then fi set -x +if which pulpcore-api +then + PULP_API_ENTRYPOINT=("pulpcore-api") +else + PULP_API_ENTRYPOINT=("gunicorn" "pulpcore.app.wsgi:application" "--bind" "[::]:24817" "--name" "pulp-api" "--access-logformat" "pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"") +fi + # NOTE: Due to the Linux dual-stack functionality, this will listen on both IPv4 # IPv6, even though netstat may seem to indicate it is IPv6 only. # Due to containers using network namespaces, even if the host has this disabled # with /proc/sys/net/ipv6/bindv6only=1, the container will still have # it enabled with /proc/sys/net/ipv6/bindv6only=0 . -exec gunicorn --bind '[::]:24817' pulpcore.app.wsgi:application \ ---name pulp-api \ +exec "${PULP_API_ENTRYPOINT[@]}" \ --timeout "${PULP_GUNICORN_TIMEOUT}" \ ---workers "${PULP_API_WORKERS}" +--workers "${PULP_API_WORKERS}" \ +--access-logfile - diff --git a/images/assets/pulp-content b/images/assets/pulp-content index a66caf10..12550287 100755 --- a/images/assets/pulp-content +++ b/images/assets/pulp-content @@ -3,15 +3,19 @@ /usr/bin/wait_on_postgres.py /usr/bin/wait_on_database_migrations.sh +if which pulpcore-content +then + PULP_CONTENT_ENTRYPOINT=("pulpcore-content") +else + PULP_CONTENT_ENTRYPOINT=("gunicorn" "pulpcore.content:server" "--worker-class" "aiohttp.GunicornWebWorker" "--name" "pulp-content" "--bind" "[::]:24816") +fi + # NOTE: Due to the Linux dual-stack functionality, this will listen on both IPv4 # IPv6, even though netstat may seem to indicate it is IPv6 only. # Due to containers using network namespaces, even if the host has this disabled # with /proc/sys/net/ipv6/bindv6only=1, the container will still have # it enabled with /proc/sys/net/ipv6/bindv6only=0 . -exec gunicorn pulpcore.content:server \ ---name pulp-content \ ---bind '[::]:24816' \ ---worker-class 'aiohttp.GunicornWebWorker' \ +exec "${PULP_CONTENT_ENTRYPOINT[@]}" \ --timeout "${PULP_GUNICORN_TIMEOUT}" \ --workers "${PULP_CONTENT_WORKERS}" \ --access-logfile - diff --git a/images/assets/pulp-worker b/images/assets/pulp-worker index 450d8976..886baa30 100755 --- a/images/assets/pulp-worker +++ b/images/assets/pulp-worker @@ -3,16 +3,6 @@ /usr/bin/wait_on_postgres.py /usr/bin/wait_on_database_migrations.sh -NEW_TASKING_SYSTEM=$(python3 -c "from packaging.version import parse; from pulpcore.app.apps import PulpAppConfig; print('yes' if parse(PulpAppConfig.version) >= parse('3.13.0.dev0') else 'no')") -echo $NEW_TASKING_SYSTEM - -if [[ "$NEW_TASKING_SYSTEM" == "no" ]]; then - # TODO: Set ${PULP_WORKER_NUMBER} to the Pod Number - # In the meantime, the hostname provides uniqueness. - exec rq worker --url "redis://${REDIS_SERVICE_HOST}:${REDIS_SERVICE_PORT}" -w "pulpcore.tasking.worker.PulpWorker" -c "pulpcore.rqconfig" -else - export DJANGO_SETTINGS_MODULE=pulpcore.app.settings - export PULP_SETTINGS=/etc/pulp/settings.py - export PATH=/usr/local/bin:/usr/bin/ - exec pulpcore-worker -fi +export PULP_SETTINGS=/etc/pulp/settings.py +export PATH=/usr/local/bin:/usr/bin/ +exec pulpcore-worker diff --git a/images/s6_assets/init/pulpcore-api b/images/s6_assets/init/pulpcore-api index 767aba84..0a536b8d 100755 --- a/images/s6_assets/init/pulpcore-api +++ b/images/s6_assets/init/pulpcore-api @@ -5,4 +5,16 @@ fi if [ "${PULP_OTEL_ENABLED}" = "true" ]; then OTEL_PREFIX="/usr/local/bin/opentelemetry-instrument --service_name pulp-api" fi -exec $OTEL_PREFIX /usr/local/bin/gunicorn pulpcore.app.wsgi:application --bind "127.0.0.1:24817" --name pulp-api --timeout "${PULP_GUNICORN_TIMEOUT}" --workers "${PULP_API_WORKERS}" --access-logfile - --access-logformat "pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"" ${PULP_GUNICORN_RELOAD_STRING} + +if which pulpcore-api +then + PULP_API_ENTRYPOINT=("pulpcore-api") +else + PULP_API_ENTRYPOINT=("gunicorn" "pulpcore.app.wsgi:application" "--bind" "127.0.0.1:24817" "--name" "pulp-api" "--access-logformat" "pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\"") +fi + +exec ${OTEL_PREFIX} "${PULP_API_ENTRYPOINT[@]}" \ + --timeout "${PULP_GUNICORN_TIMEOUT}" \ + --workers "${PULP_API_WORKERS}" \ + --access-logfile - \ + ${PULP_GUNICORN_RELOAD_STRING} diff --git a/images/s6_assets/init/pulpcore-content b/images/s6_assets/init/pulpcore-content index 5b1551f3..6404b439 100755 --- a/images/s6_assets/init/pulpcore-content +++ b/images/s6_assets/init/pulpcore-content @@ -5,4 +5,16 @@ fi if [ "${PULP_OTEL_ENABLED}" = "true" ]; then OTEL_PREFIX="/usr/local/bin/opentelemetry-instrument --service_name pulp-content" fi -exec $OTEL_PREFIX /usr/local/bin/gunicorn pulpcore.content:server --bind "127.0.0.1:24816" --name pulp-content --timeout "${PULP_GUNICORN_TIMEOUT}" --worker-class "aiohttp.GunicornWebWorker" --workers "${PULP_CONTENT_WORKERS}" --access-logfile - ${PULP_GUNICORN_RELOAD_STRING} + +if which pulpcore-content +then + PULP_CONTENT_ENTRYPOINT=("pulpcore-content") +else + PULP_CONTENT_ENTRYPOINT=("gunicorn" "pulpcore.content:server" "--worker-class" "aiohttp.GunicornWebWorker" "--name" "pulp-content" "--bind" "127.0.0.1:24816") +fi + +exec ${OTEL_PREFIX} "${PULP_CONTENT_ENTRYPOINT[@]}" \ + --timeout "${PULP_GUNICORN_TIMEOUT}" \ + --workers "${PULP_CONTENT_WORKERS}" \ + --access-logfile - \ + ${PULP_GUNICORN_RELOAD_STRING}