diff --git a/images/assets/pulp-api b/images/assets/pulp-api index 4b15f24f..28c4a00a 100755 --- a/images/assets/pulp-api +++ b/images/assets/pulp-api @@ -31,12 +31,20 @@ if [ -n "${PULP_ADMIN_PASSWORD}" ]; then fi set -x +if which pulpcore-api +then + PULP_API_GUNICORN="pulpcore-api" +else + PULP_API_GUNICORN="gunicorn pulpcore.app.wsgi:application" +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 \ +exec ${PULP_API_GUNICORN} \ +--bind '[::]:24817' \ --name pulp-api \ --timeout "${PULP_GUNICORN_TIMEOUT}" \ --workers "${PULP_API_WORKERS}" diff --git a/images/assets/pulp-worker b/images/assets/pulp-worker index 450d8976..6fba4d06 100755 --- a/images/assets/pulp-worker +++ b/images/assets/pulp-worker @@ -3,16 +3,7 @@ /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 DJANGO_SETTINGS_MODULE=pulpcore.app.settings +export PULP_SETTINGS=/etc/pulp/settings.py +export PATH=/usr/local/bin:/usr/bin/ +exec /usr/local/bin/pulpcore-worker diff --git a/images/s6_assets/init/pulpcore-api b/images/s6_assets/init/pulpcore-api index 767aba84..8e5826be 100755 --- a/images/s6_assets/init/pulpcore-api +++ b/images/s6_assets/init/pulpcore-api @@ -5,4 +5,12 @@ 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_GUNICORN="pulpcore-api" +else + PULP_API_GUNICORN="gunicorn pulpcore.app.wsgi:application" +fi + +exec ${OTEL_PREFIX} ${PULP_API_GUNICORN} --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}