Merge "Install IPA in a virtual environment"
This commit is contained in:
commit
de4d0392d5
@ -1,5 +1,6 @@
|
||||
dhcp-all-interfaces
|
||||
package-installs
|
||||
pip-and-virtualenv
|
||||
pkg-map
|
||||
source-repositories
|
||||
svc-map
|
||||
|
@ -7,27 +7,25 @@ set -eu
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTDIR=$(dirname $0)
|
||||
IPADIR=/usr/share/ironic-python-agent
|
||||
|
||||
# Install the latest version of pip and setuptools which has some
|
||||
# fixes for building behind proxy.
|
||||
curl -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
|
||||
python /tmp/get-pip.py
|
||||
rm -f /tmp/get-pip.py
|
||||
pip install -U setuptools
|
||||
# create the virtual environment
|
||||
virtualenv $IPADIR/venv
|
||||
|
||||
pip install -r /tmp/ironic-python-agent/requirements.txt
|
||||
pip install /tmp/ironic-python-agent
|
||||
# install IPA inside the virtual environment
|
||||
$IPADIR/venv/bin/pip install $IPADIR
|
||||
|
||||
if [ ! -f /usr/bin/ironic-python-agent ]; then
|
||||
ln -s /usr/local/bin/ironic-python-agent /usr/bin/ironic-python-agent
|
||||
fi
|
||||
# FIXME(lucasagomes): Figure out how we can use the "--install-option"
|
||||
# parameter for pip install so we don't have to manually create a symlink
|
||||
# create the launcher link so services can use it
|
||||
ln -s $IPADIR/venv/bin/ironic-python-agent /usr/local/bin/ironic-python-agent
|
||||
|
||||
case "$DIB_INIT_SYSTEM" in
|
||||
upstart)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
|
||||
;;
|
||||
systemd)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/$(svc-map ironic-python-agent).service
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
|
||||
;;
|
||||
sysv)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init
|
||||
|
2
elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf
Executable file → Normal file
2
elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.conf
Executable file → Normal file
@ -17,4 +17,4 @@ pre-start script
|
||||
echo Starting Ironic Python Agent
|
||||
end script
|
||||
|
||||
exec /usr/bin/ironic-python-agent
|
||||
exec /usr/local/bin/ironic-python-agent
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
NAME=ironic-python-agent
|
||||
INIT_NAME=/etc/init.d/${NAME}
|
||||
SCRIPT_NAME=/usr/bin/${NAME}
|
||||
SCRIPT_NAME=/usr/local/bin/${NAME}
|
||||
|
||||
[ -x $SCRIPT_NAME ] || exit 0
|
||||
|
||||
|
2
elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.service
Executable file → Normal file
2
elements/ironic-agent/install.d/ironic-agent-source-install/ironic-python-agent.service
Executable file → Normal file
@ -3,7 +3,7 @@ Description=Ironic Python Agent
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/ironic-python-agent
|
||||
ExecStart=/usr/local/bin/ironic-python-agent
|
||||
Restart=always
|
||||
RestartSec=30s
|
||||
|
||||
|
@ -1 +1 @@
|
||||
ironic-agent git /tmp/ironic-python-agent https://git.openstack.org/openstack/ironic-python-agent
|
||||
ironic-agent git /usr/share/ironic-python-agent https://git.openstack.org/openstack/ironic-python-agent
|
||||
|
Loading…
Reference in New Issue
Block a user