summaryrefslogtreecommitdiffstats
path: root/kud/hosting_providers
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2021-07-08 14:04:20 -0700
committerTodd Malsbary <todd.malsbary@intel.com>2021-07-16 11:19:26 -0700
commit7e85528a2c9c6669aa0857d8b9bfaa1e698c2fbc (patch)
tree242cbe6b05bf8de67a07449cc0382c1f1d8f1241 /kud/hosting_providers
parent78ea22d85af1c2d20dc94453948deedf640385a9 (diff)
Update KUD to python3
Issue-ID: MULTICLOUD-1375 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: I0433a55ef2ac9caba976a267fa9e1f41d5353248
Diffstat (limited to 'kud/hosting_providers')
-rw-r--r--kud/hosting_providers/baremetal/README.md4
-rwxr-xr-xkud/hosting_providers/containerized/installer.sh5
-rwxr-xr-xkud/hosting_providers/vagrant/installer.sh14
-rwxr-xr-xkud/hosting_providers/vagrant/node.sh1
-rwxr-xr-xkud/hosting_providers/vagrant/setup.sh18
5 files changed, 25 insertions, 17 deletions
diff --git a/kud/hosting_providers/baremetal/README.md b/kud/hosting_providers/baremetal/README.md
index aabdf2b8..38f6e273 100644
--- a/kud/hosting_providers/baremetal/README.md
+++ b/kud/hosting_providers/baremetal/README.md
@@ -41,7 +41,9 @@ Prepare the environment and clone the repo
`$ sudo apt-get upgrade -y`
-`$ sudo apt-get install -y python-pip`
+`$ sudo apt-get install -y python3-pip`
+
+`$ sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1`
`$ git clone https://git.onap.org/multicloud/k8s/`
diff --git a/kud/hosting_providers/containerized/installer.sh b/kud/hosting_providers/containerized/installer.sh
index 4ed1833b..cdb43dd5 100755
--- a/kud/hosting_providers/containerized/installer.sh
+++ b/kud/hosting_providers/containerized/installer.sh
@@ -33,6 +33,7 @@ function install_prerequisites {
unzip \
vim \
wget
+ update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
}
# _install_ansible() - Install and Configure Ansible program
@@ -40,7 +41,7 @@ function _install_ansible {
local version=$(grep "ansible_version" ${kud_playbooks}/kud-vars.yml |
awk -F ': ' '{print $2}')
mkdir -p /etc/ansible/
- pip3 install --no-cache-dir ansible==$version
+ pip install --no-cache-dir ansible==$version
}
function install_kubespray {
@@ -59,7 +60,7 @@ function install_kubespray {
rm $tarball
pushd $dest_folder/kubespray-$version/
- pip3 install --no-cache-dir -r ./requirements.txt
+ pip install --no-cache-dir -r ./requirements.txt
make mitogen
popd
rm -f $kud_inventory_folder/group_vars/all.yml 2> /dev/null
diff --git a/kud/hosting_providers/vagrant/installer.sh b/kud/hosting_providers/vagrant/installer.sh
index 75472913..cf6c0362 100755
--- a/kud/hosting_providers/vagrant/installer.sh
+++ b/kud/hosting_providers/vagrant/installer.sh
@@ -42,14 +42,16 @@ function _install_go {
# _install_ansible() - Install and Configure Ansible program
function _install_ansible {
- sudo apt-get install -y python3-pip
- sudo -E pip3 install --no-cache-dir --upgrade pip
+ sudo apt-get install -y python3 python3-pip
+ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 --force
+ sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 --force
+ sudo -E pip install --no-cache-dir --upgrade pip
if $(ansible --version &>/dev/null); then
- sudo pip3 uninstall -y ansible
+ sudo pip uninstall -y ansible
fi
local version=$(grep "ansible_version" ${kud_playbooks}/kud-vars.yml | awk -F ': ' '{print $2}')
sudo mkdir -p /etc/ansible/
- sudo -E pip3 install --no-cache-dir ansible==$version
+ sudo -E pip install --no-cache-dir ansible==$version
}
function _set_environment_file {
@@ -79,7 +81,7 @@ function install_k8s {
rm $tarball
pushd $dest_folder/kubespray-$version/
- sudo -E pip3 install --no-cache-dir -r ./requirements.txt
+ sudo -E pip install --no-cache-dir -r ./requirements.txt
make mitogen
popd
rm -f $kud_inventory_folder/group_vars/all.yml 2> /dev/null
@@ -204,7 +206,7 @@ function install_addons {
# install_plugin() - Install ONAP Multicloud Kubernetes plugin
function install_plugin {
echo "Installing multicloud/k8s plugin"
- sudo -E pip3 install --no-cache-dir docker-compose
+ sudo -E pip install --no-cache-dir docker-compose
sudo mkdir -p /opt/{kubeconfig,consul/config}
sudo cp $HOME/.kube/config /opt/kubeconfig/kud
diff --git a/kud/hosting_providers/vagrant/node.sh b/kud/hosting_providers/vagrant/node.sh
index a51be19b..6695d585 100755
--- a/kud/hosting_providers/vagrant/node.sh
+++ b/kud/hosting_providers/vagrant/node.sh
@@ -80,6 +80,7 @@ case ${ID,,} in
*suse)
;;
ubuntu|debian)
+ apt-get update
apt-get install -y cpu-checker
kvm-ok
;;
diff --git a/kud/hosting_providers/vagrant/setup.sh b/kud/hosting_providers/vagrant/setup.sh
index 7251872a..35393e1e 100755
--- a/kud/hosting_providers/vagrant/setup.sh
+++ b/kud/hosting_providers/vagrant/setup.sh
@@ -61,7 +61,7 @@ packages=()
case ${ID,,} in
*suse)
INSTALLER_CMD="sudo -H -E zypper -q install -y --no-recommends"
- packages+=(python-devel)
+ packages+=(python-devel python-pip)
# Vagrant installation
if [[ "${enable_vagrant_install+x}" ]]; then
@@ -95,7 +95,7 @@ case ${ID,,} in
ubuntu|debian)
INSTALLER_CMD="sudo -H -E apt-get -y -q=3 install"
- packages+=(python-dev)
+ packages+=(python3-dev python3-pip)
# Vagrant installation
if [[ "${enable_vagrant_install+x}" ]]; then
@@ -125,7 +125,7 @@ case ${ID,,} in
PKG_MANAGER=$(which dnf || which yum)
sudo "$PKG_MANAGER" updateinfo
INSTALLER_CMD="sudo -H -E ${PKG_MANAGER} -q -y install"
- packages+=(python-devel)
+ packages+=(python-devel python-pip)
# Vagrant installation
if [[ "${enable_vagrant_install+x}" ]]; then
@@ -174,11 +174,13 @@ fi
sudo modprobe vhost_net
${INSTALLER_CMD} "${packages[@]}"
-if ! which pip; then
- curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python
-else
- sudo -H -E pip install --no-cache-dir --upgrade pip
-fi
+case ${ID,,} in
+ ubuntu|debian)
+ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 --force
+ sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 --force
+ ;;
+esac
+sudo -H -E pip install --no-cache-dir --upgrade pip
sudo -H -E pip install --no-cache-dir tox
if [[ ${http_proxy+x} ]]; then
vagrant plugin install vagrant-proxyconf