summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/vm_dev_setup
diff options
context:
space:
mode:
Diffstat (limited to 'utils/infra_setup/vm_dev_setup')
-rw-r--r--utils/infra_setup/vm_dev_setup/README.rst14
-rw-r--r--utils/infra_setup/vm_dev_setup/common.sh70
-rw-r--r--utils/infra_setup/vm_dev_setup/package.conf14
-rwxr-xr-xutils/infra_setup/vm_dev_setup/setup_env.sh140
-rw-r--r--utils/infra_setup/vm_dev_setup/vm_prepare_setup.sh26
5 files changed, 0 insertions, 264 deletions
diff --git a/utils/infra_setup/vm_dev_setup/README.rst b/utils/infra_setup/vm_dev_setup/README.rst
deleted file mode 100644
index 49a8f7f1..00000000
--- a/utils/infra_setup/vm_dev_setup/README.rst
+++ /dev/null
@@ -1,14 +0,0 @@
-.. this folder is used to setup env for bottlenecks after ssh into VMs.
-
-how to use the script in this directory
-=======================================
-
-The script vm_setup.sh is used to git clone the bottlenecks code repo
-and download the dependent packages into the Cache from the public IP
-where they stored.
-
-The parameters are defined in package.conf file.
-
-Revision: _sha1_
-
-Build date: |today|
diff --git a/utils/infra_setup/vm_dev_setup/common.sh b/utils/infra_setup/vm_dev_setup/common.sh
deleted file mode 100644
index a3acfe86..00000000
--- a/utils/infra_setup/vm_dev_setup/common.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-set -x
-
-generate_ssh_key() {
- uname -a
- whoami
- if [ ! -d ~/.ssh ]; then
- mkdir ~/.ssh
- fi
-
- chmod 600 ~/.ssh/id_rsa
-
- if [ ! -d /root/.ssh ]; then
- mkdir /root/.ssh
- fi
-
- sudo sed -ie 's/ssh-rsa/\n&/g' /root/.ssh/authorized_keys
- sudo sed -ie '/echo/d' /root/.ssh/authorized_keys
-}
-
-configue_nameserver()
-{
- echo "Bottlenecks: configue nameserver"
- sudo rm /etc/resolv.conf
- sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf
- sudo echo "nameserver 8.8.4.4" >> /etc/resolv.conf
-
- ping -c 1 www.google.com
-}
-
-install_packages()
-{
- echo "Bottlenecks: install preinstall packages in VM"
- sudo apt-get update
-
- for i in $@; do
- if ! apt --installed list 2>/dev/null |grep "\<$i\>"
- then
- sudo apt-get install -y --force-yes $i
- fi
- done
-}
-
-hosts_config()
-{
- echo "Bottlnecks: hosts config"
- sudo echo "
-$rubbos_benchmark rubbos-benchmark
-$rubbos_client1 rubbos-client1
-$rubbos_client2 rubbos-client2
-$rubbos_client3 rubbos-client3
-$rubbos_client4 rubbos-client4
-$rubbos_control rubbos-control
-$rubbos_httpd rubbos-httpd
-$rubbos_mysql1 rubbos-mysql1
-$rubbos_tomcat1 rubbos-tomcat1
-" >> /etc/hosts
-}
-
-set +x
-
diff --git a/utils/infra_setup/vm_dev_setup/package.conf b/utils/infra_setup/vm_dev_setup/package.conf
deleted file mode 100644
index 6af6152b..00000000
--- a/utils/infra_setup/vm_dev_setup/package.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-TIMEOUT=10
-export PACKAGE_URL=${PACKAGE_URL:-http://artifacts.opnfv.org/bottlenecks}
-
-export BOTTLENECKS_REPO=${BOTTLENECKS_REPO:-https://gerrit.opnfv.org/gerrit/bottlenecks}
-export BOTTLENECKS_REPO_DIR=${BOTTLENECKS_REPO_DIR:-/bottlenecks}
-export RUBBOS_DIR=${RUBBOS_DIR:-$BOTTLENECKS_REPO_DIR/rubbos}
-export RUBBOS_MULINI6_DIR=${RUBBOS_MULINI6_DIR:-$RUBBOS_DIR/rubbos_scripts}
-export RUBBOS_RUN_DIR=${RUBBOS_RUN_DIR:-$BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts}
-export RUBBOS_EXE_DIR=${RUBBOS_EXE_DIR:-$BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts}
-export RUBBOS_APP_TOOLS_URL=${RUBBOS_APP_TOOLS_URL:-$PACKAGE_URL/rubbos/app_tools.tar.gz}
-export RUBBOS_MULINI6_URL=${RUBBOS_MULINI6_URL:-$PACKAGE_URL/rubbos/rubbosMulini6.tar.gz}
-
-export PreInstall_Packages="git gcc gettext g++ libaio1 libaio-dev make"
-
diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh
deleted file mode 100755
index db280e77..00000000
--- a/utils/infra_setup/vm_dev_setup/setup_env.sh
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-set -x
-
-wait_vm_ok() {
- ip=$1
-
- retry=0
- until timeout 10s ssh $ssh_args ubuntu@$ip "exit" >/dev/null 2>&1
- do
- echo "retry connect rubbos vm ip $ip $retry"
- sleep 1
- let retry+=1
- if [[ $retry -ge $2 ]];then
- echo "rubbos control start timeout !!!"
- #exit 1
- fi
- done
-}
-
-bottlenecks_prepare_env()
-{
- echo "Bottlenecks prepare env"
-
- # configue rubbos control ssh key
- generate_ssh_key
-
- # wait all other VMs ok
- for i in $rubbos_benchmark $rubbos_client1 $rubbos_client2 \
- $rubbos_client3 $rubbos_client4 $rubbos_httpd $rubbos_mysql1 $rubbos_tomcat1
- do
- wait_vm_ok $i 360
- done
-
- # configue other VMs
- for i in $rubbos_benchmark $rubbos_client1 $rubbos_client2 \
- $rubbos_client3 $rubbos_client4 $rubbos_httpd $rubbos_mysql1 $rubbos_tomcat1
- do
- scp $ssh_args -r $SCRIPT_DIR ubuntu@$i:/tmp
- ssh $ssh_args ubuntu@$i "sudo bash $SCRIPT_DIR/vm_prepare_setup.sh" &
- done
-
- # ugly use ssh execute script to fix ubuntu previlege issue
- ssh $ssh_args ubuntu@$rubbos_control "sudo bash $SCRIPT_DIR/vm_prepare_setup.sh"
-
- # test root access
- for i in $rubbos_control $rubbos_benchmark $rubbos_client1 $rubbos_client2 \
- $rubbos_client3 $rubbos_client4 $rubbos_httpd $rubbos_mysql1 $rubbos_tomcat1
- do
- ssh $ssh_args root@$i "uname -a"
- done
-}
-
-git_checkout()
-{
- if sudo git cat-file -e $1^{commit} 2>/dev/null; then
- # branch, tag or sha1 object
- sudo git checkout $1
- else
- # refspec / changeset
- sudo git fetch --tags --progress $2 $1
- sudo git checkout FETCH_HEAD
- fi
-}
-
-bottlenecks_download_repo()
-{
- echo "Bottlenecks: download bottlenecks repo"
-
- sudo git config --global http.sslVerify false
- if [ ! -d $BOTTLENECKS_REPO_DIR ]; then
- sudo git clone $BOTTLENECKS_REPO $BOTTLENECKS_REPO_DIR
- fi
- cd $BOTTLENECKS_REPO_DIR
- sudo git checkout master && sudo git pull
- git_checkout $BOTTLENECKS_BRANCH $BOTTLENECKS_REPO
- cd -
-}
-
-bottlenecks_config_hosts_ip()
-{
- sudo sed -i -e "s/REPLACE_CONTROL_HOST/$rubbos_control/g" \
- -e "s/REPLACE_HTTPD_HOST/$rubbos_httpd/g" \
- -e "s/REPLACE_MYSQL1_HOST/$rubbos_mysql1/g" \
- -e "s/REPLACE_TOMCAT1_HOST/$rubbos_tomcat1/g" \
- -e "s/REPLACE_CLIENT1_HOST/$rubbos_client1/g" \
- -e "s/REPLACE_CLIENT2_HOST/$rubbos_client2/g" \
- -e "s/REPLACE_CLIENT3_HOST/$rubbos_client3/g" \
- -e "s/REPLACE_CLIENT4_HOST/$rubbos_client4/g" \
- -e "s/REPLACE_BENCHMARK_HOST/$rubbos_benchmark/g" \
- $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh
-}
-
-bottlenecks_download_packages()
-{
- echo "Bottlenecks: download rubbos dependent packages from artifacts"
-
- curl --connect-timeout 10 -o /tmp/app_tools.tar.gz $RUBBOS_APP_TOOLS_URL 2>/dev/null
- sudo tar zxf /tmp/app_tools.tar.gz -C $RUBBOS_DIR
- rm -rf /tmp/app_tools.tar.gz
- curl --connect-timeout 10 -o /tmp/rubbosMulini6.tar.gz $RUBBOS_MULINI6_URL 2>/dev/null
- sudo tar zxf /tmp/rubbosMulini6.tar.gz -C $RUBBOS_MULINI6_DIR
- rm -rf /tmp/rubbosMulini6.tar.gz
-}
-
-bottlenecks_rubbos_install_exe()
-{
- echo "Bottlenecks: install and run rubbos"
-
- cd $RUBBOS_RUN_DIR
- sudo ./run.sh
-}
-
-main()
-{
- SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd`
-
- ssh_args="-o StrictHostKeyChecking=no -o BatchMode=yes"
- source $SCRIPT_DIR/hosts.conf
- source $SCRIPT_DIR/package.conf
- source $SCRIPT_DIR/common.sh
-
- bottlenecks_prepare_env
- set -x
- bottlenecks_download_repo
- bottlenecks_config_hosts_ip
- bottlenecks_download_packages
- bottlenecks_rubbos_install_exe
-}
-
-main
-set +x
diff --git a/utils/infra_setup/vm_dev_setup/vm_prepare_setup.sh b/utils/infra_setup/vm_dev_setup/vm_prepare_setup.sh
deleted file mode 100644
index 7c8d8481..00000000
--- a/utils/infra_setup/vm_dev_setup/vm_prepare_setup.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bain/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-main()
-{
- SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd`
-
- source $SCRIPT_DIR/package.conf
- source $SCRIPT_DIR/hosts.conf
- source $SCRIPT_DIR/common.sh
-
- hosts_config
- generate_ssh_key
- configue_nameserver $nameserver_ip
- #install_packages $PreInstall_Packages
-}
-
-main
-