Files
cyborg/devstack/settings
Sean Mooney 3724b467b4 Add support for pyproject.toml and wsgi module paths
pip 23.1 removed the "setup.py install" fallback for projects that do
not have pyproject.toml and now uses a pyproject.toml which is vendored
in pip [1][2]. pip 24.2 has now deprecated a similar fallback to
"setup.py develop" and plans to fully remove this in pip 25.0 [3][4][5].
pbr supports editable installs since 6.0.0

pip 25.1 has now been released and the removal is complete.
by adding our own minimal pyproject.toml to ensure we are using the
correct build system.

This change also requires that we adapt how we generate our wsgi
entry point. when pyproject.toml is used the wsgi console script is
not generated in an editbale install such as is used in devstck

To adress this we need to refactor our usage of our wsgi applciation
to use a module path instead. This change does not remove
the declaration of our wsgi_script entry point but it shoudl
be considered deprecated and it will be removed in the future.

To unblock the gate the devstack plugin is modifed to to deploy
using the wsgi module instead of the console script.

[1] https://pip.pypa.io/en/stable/news/#v23-1
[2] pypa/pip#8368
[3] https://pip.pypa.io/en/stable/news/#v24-2
[4] pypa/pip#11457
[5] https://ichard26.github.io/blog/2024/08/whats-new-in-pip-24.2/
Closes-Bug: #2109583

Change-Id: I31fb6bff75ce27aedd94f7f73b7bfdd706127fc2
2025-05-14 16:12:35 +01:00

46 lines
1.7 KiB
Plaintext

enable_service cyborg cyborg-api cyborg-cond cyborg-agent
# cyborg setting
# Defaults
# --------
# Set up default directories
# then name of the directory where cyborg is cloned is set by the first
# argument to enable_plugin so we should not assume it will be cyborg
CYBORG_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )
CYBORG_DEVSTACK_DIR=$CYBORG_DIR/devstack
CYBORG_DEVSTACK_FILES_DIR=$CYBORG_DEVSTACK_DIR/files
CYBORG_DATA_DIR=$DATA_DIR/cyborg
CYBORG_STATE_PATH=/var/lib/cyborg
CYBORG_CONF_DIR=${CYBORG_CONF_DIR:-/etc/cyborg}
CYBORG_CONF_FILE=$CYBORG_CONF_DIR/cyborg.conf
CYBORG_API_PASTE_INI=$CYBORG_CONF_DIR/api-paste.ini
CYBORG_POLICY_JSON=$CYBORG_CONF_DIR/policy.yaml
CYBORG_SERVICE_HOST=${CYBORG_SERVICE_HOST:-$SERVICE_HOST}
CYBORG_SERVICE_PORT=${CYBORG_SERVICE_PORT:-6666}
CYBORG_SERVICE_PROTOCOL=${CYBORG_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
CYBORG_ENABLED_DRIVERS=${CYBORG_ENABLED_DRIVERS:-fake_driver}
if [[ -d ${CYBORG_DIR}/bin ]]; then
CYBORG_BIN_DIR=${CYBORG_DIR}/bin
else
CYBORG_BIN_DIR=$(get_python_exec_prefix)
fi
# Toggle for deploying Cyborg-API under a wsgi server
CYBORG_USE_UWSGI=${CYBORG_USE_UWSGI:-True}
CYBORG_UWSGI=cyborg.wsgi.api:application
CYBORG_UWSGI_CONF=$CYBORG_CONF_DIR/cyborg-api-uwsgi.ini
if [[ "$CYBORG_USE_UWSGI" == "True" ]]; then
CYBORG_API_URL="$CYBORG_SERVICE_PROTOCOL://$CYBORG_SERVICE_HOST/accelerator"
else
CYBORG_API_URL="$CYBORG_SERVICE_PROTOCOL://$CYBORG_SERVICE_HOST:$CYBORG_SERVICE_PORT"
fi
# client settings
CYBORG_CLIENT_INSTALL=$(trueorfalse True CYBORG_CLIENT_INSTALL)
CYBORG_CLIENT_REPO=${CYBORG_CLIENT_REPO:-"$GIT_BASE/openstack/python-cyborgclient"}
CYBORG_CLIENT_BRANCH=${CYBORG_CLIENT_BRANCH:-master}
CYBORG_CLIENT_DIR="${DEST}/python-cyborgclient"