Browse Source

fix: [docker-host] remove installation of docker-compose as it is not anymore used.

Since ``compose`` is now inside a docker with all its dependencies,
(including ``docker-compose``), we do not need to install it on the
host.
framadate
Valentin Lab 6 years ago
parent
commit
73ec2f1010
  1. 100
      precise/host/hooks/install.d/70-0k.sh

100
precise/host/hooks/install.d/70-0k.sh

@ -171,108 +171,14 @@ sed -ri 's/^#(net\.ipv4\.ip_forward=1)$/\1/g' /etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv4.ip_forward=1
##
## docker-compose
##
if type -p docker-compose >/dev/null; then
#echo "Found docker-compose..." >&2
if ! CURRENT_VERSION_TEXT="$(docker-compose --version 2>/dev/null)"; then
echo "'docker-compose' failed ! Please check your docker-compose binary."
echo "Failed install."
docker-compose --version
exit 1
fi
VALID_VERSION_TEXT="docker-compose version 1.21.2, build "
if ! [[ "$CURRENT_VERSION_TEXT" == "$VALID_VERSION_TEXT"* ]]; then
echo "Invalid version of docker-compose: we need exactly:"
echo "version text: $VALID_VERSION_TEXT"
echo "current version: $CURRENT_VERSION_TEXT"
echo "Failed install."
exit 1
fi
else
if ! [ -d /opt/apps/docker-compose ]; then
(
mkdir -p /opt/apps
cd /opt/apps
git clone https://github.com/docker/compose.git docker-compose &&
cd docker-compose &&
git checkout 0898c783ad2e0d01bd55b47fcb9eb7183edc1015 ## version pinning
)
fi
mkdir -p /opt/venv
if ! type -p virtualenv >/dev/null; then
pip install virtualenv==13.1.2
fi
if ! [ -d /opt/venv/docker-compose ]; then
virtualenv /opt/venv/docker-compose/
fi
set +eux
. /opt/venv/docker-compose/bin/activate
set -eux
## XXXvlab: docker version 3.5.0 is bugged on its requirement list:
## error: Setup script exited with error in docker setup command: 'tests_require' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in pytest==2.9.1; python_version == '3.3' at ; python_version == '3.3'
pip install $(cat <<EOF
backports.ssl-match-hostname==3.5.0.1
cached-property==1.4.3
certifi==2018.4.16
chardet==3.0.4
docker==3.4.1
docker-compose==1.21.2
docker-pycreds==0.3.0
dockerpty==0.4.1
docopt==0.6.2
enum34==1.1.6
functools32==3.2.3.post2
idna==2.5
ipaddress==1.0.22
jsonschema==2.6.0
python-dateutil==2.7.3
pytz==2018.5
PyYAML==3.13
requests==2.17.3
sact.epoch==1.3.0
shyaml==0.5.2
six==1.11.0
texttable==0.9.1
urllib3==1.21.1
websocket-client==0.48.0
wheel==0.24.0
zope.component==4.4.1
zope.event==4.3.0
zope.interface==4.5.0
EOF
)
( cd /opt/apps/docker-compose &&
python setup.py install )
if ! pip freeze | grep "^requests==2.17.3\$" >/dev/null 2>&1; then
pip install requests==2.17.3 --upgrade
fi
deactivate
mkdir -p /etc/compose
if ! grep "^. /opt/venv/docker-compose/bin/activate$" /etc/compose/local.conf >/dev/null 2>&1; then
cat <<EOF >> /etc/compose/local.conf
. /opt/venv/docker-compose/bin/activate
EOF
fi
fi
## ##
## Installation of compose ## Installation of compose
## ##
apt-get install kal-shlib-common kal-shlib-pretty kal-shlib-charm kal-shlib-array -y --force-yes </dev/null
docker pull docker.0k.io/compose
if [ -d "/opt/apps/0k-compose" ]; then if [ -d "/opt/apps/0k-compose" ]; then
cd "/opt/apps/0k-compose" && cd "/opt/apps/0k-compose" &&
git pull -r
git pull -r
else else
mkdir -p /opt/apps && cd /opt/apps mkdir -p /opt/apps && cd /opt/apps
git clone "$GIT_0K_BASE"/0k/0k-compose.git git clone "$GIT_0K_BASE"/0k/0k-compose.git
@ -300,6 +206,8 @@ export CONFIGSTORE=\$DOCKER_DATASTORE/config
EOF EOF
if ! egrep "^DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml$" /etc/compose/local.conf >/dev/null 2>&1; then if ! egrep "^DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml$" /etc/compose/local.conf >/dev/null 2>&1; then
mkdir /etc/compose -p
touch /etc/compose/local.conf
echo "DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml" >> /etc/compose/local.conf echo "DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml" >> /etc/compose/local.conf
fi fi

Loading…
Cancel
Save