changed Ubuntu to 20.04, made python3 the default while installing faafo, added comment to show use of different faafo branches for cloud-init
This commit is contained in:
		@@ -78,6 +78,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
    if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
        sudo apt-get update
 | 
			
		||||
    elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
        # fedora currently not tested nor supported
 | 
			
		||||
        sudo dnf update -y
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
@@ -89,6 +90,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
            #sudo sed -i -e "/bind-address/d" /etc/mysql/my.cnf
 | 
			
		||||
            sudo service mysql restart
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y mariadb-server python-mysql
 | 
			
		||||
            printf "[mysqld]\nbind-address = 127.0.0.1\n" | sudo tee /etc/my.cnf.d/faafo.conf
 | 
			
		||||
            sudo systemctl enable mariadb
 | 
			
		||||
@@ -106,6 +108,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            sudo apt-get install -y rabbitmq-server
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y rabbitmq-server
 | 
			
		||||
            sudo systemctl enable rabbitmq-server
 | 
			
		||||
            sudo systemctl start rabbitmq-server
 | 
			
		||||
@@ -117,6 +120,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
 | 
			
		||||
    if [[ $INSTALL_FAAFO -eq 1 ]]; then
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            # TODO: needs to be updated for Ubuntu >= 20.04
 | 
			
		||||
            sudo apt-get install -y python-dev python-pip supervisor git zlib1g-dev libmysqlclient-dev python-mysqldb
 | 
			
		||||
            # Following is needed because of
 | 
			
		||||
            # https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740
 | 
			
		||||
@@ -131,6 +135,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y python-devel python-pip supervisor git zlib-devel mariadb-devel gcc which python-mysql
 | 
			
		||||
            sudo systemctl enable supervisord
 | 
			
		||||
            sudo systemctl start supervisord
 | 
			
		||||
@@ -171,6 +176,7 @@ startretries=0"
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            echo "$faafo_api" | sudo tee -a /etc/supervisor/conf.d/faafo.conf
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            echo "$faafo_api" | sudo tee -a /etc/supervisord.d/faafo.ini
 | 
			
		||||
        else
 | 
			
		||||
            echo "error: distribution $ID not supported"
 | 
			
		||||
@@ -188,6 +194,7 @@ startretries=0"
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            echo "$faafo_worker" | sudo tee -a /etc/supervisor/conf.d/faafo.conf
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            echo "$faafo_worker" | sudo tee -a /etc/supervisord.d/faafo.ini
 | 
			
		||||
        else
 | 
			
		||||
            echo "error: distribution $ID not supported"
 | 
			
		||||
 
 | 
			
		||||
@@ -78,6 +78,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
    if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
        sudo apt-get update
 | 
			
		||||
    elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
        # fedora currently not tested nor supported
 | 
			
		||||
        sudo dnf update -y
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
@@ -89,6 +90,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
            #sudo sed -i -e "/bind-address/d" /etc/mysql/my.cnf
 | 
			
		||||
            sudo service mysql restart
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y mariadb-server python3-mysql
 | 
			
		||||
            printf "[mysqld]\nbind-address = 127.0.0.1\n" | sudo tee /etc/my.cnf.d/faafo.conf
 | 
			
		||||
            sudo systemctl enable mariadb
 | 
			
		||||
@@ -106,6 +108,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            sudo apt-get install -y rabbitmq-server
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y rabbitmq-server
 | 
			
		||||
            sudo systemctl enable rabbitmq-server
 | 
			
		||||
            sudo systemctl start rabbitmq-server
 | 
			
		||||
@@ -117,7 +120,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
 | 
			
		||||
    if [[ $INSTALL_FAAFO -eq 1 ]]; then
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            sudo apt-get install -y python3-dev python3-pip supervisor git zlib1g-dev libmysqlclient-dev python3-mysqldb
 | 
			
		||||
            sudo apt-get install -y python3-dev python3-pip supervisor git zlib1g-dev libmysqlclient-dev python3-mysqldb python-is-python3
 | 
			
		||||
            # Following is needed because of
 | 
			
		||||
            # https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740
 | 
			
		||||
            if [ $(lsb_release --short --codename) = xenial ]; then
 | 
			
		||||
@@ -131,6 +134,7 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            sudo dnf install -y python3-devel python3-pip supervisor git zlib-devel mariadb-devel gcc which python3-mysql
 | 
			
		||||
            sudo systemctl enable supervisord
 | 
			
		||||
            sudo systemctl start supervisord
 | 
			
		||||
@@ -142,12 +146,13 @@ if [[ -e /etc/os-release ]]; then
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        # HSFD changed to local repo
 | 
			
		||||
        git clone https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples
 | 
			
		||||
        #git clone https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples
 | 
			
		||||
        git clone --branch dev_faafo https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples
 | 
			
		||||
        cd cloud-computing-msc-ai-examples/faafo
 | 
			
		||||
        # following line required by bug 1636150
 | 
			
		||||
        sudo pip install --upgrade pbr
 | 
			
		||||
        sudo pip install -r requirements.txt
 | 
			
		||||
        sudo python setup.py install
 | 
			
		||||
        sudo python3 setup.py install
 | 
			
		||||
 | 
			
		||||
        sudo sed -i -e "s#transport_url = .*#transport_url = $URL_MESSAGING#" /etc/faafo/faafo.conf
 | 
			
		||||
        sudo sed -i -e "s#database_url = .*#database_url = $URL_DATABASE#" /etc/faafo/faafo.conf
 | 
			
		||||
@@ -165,6 +170,7 @@ startretries=0"
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            echo "$faafo_api" | sudo tee -a /etc/supervisor/conf.d/faafo.conf
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            echo "$faafo_api" | sudo tee -a /etc/supervisord.d/faafo.ini
 | 
			
		||||
        else
 | 
			
		||||
            echo "error: distribution $ID not supported"
 | 
			
		||||
@@ -182,6 +188,7 @@ startretries=0"
 | 
			
		||||
        if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
 | 
			
		||||
            echo "$faafo_worker" | sudo tee -a /etc/supervisor/conf.d/faafo.conf
 | 
			
		||||
        elif [[ $ID = 'fedora' ]]; then
 | 
			
		||||
            # fedora currently not tested nor supported
 | 
			
		||||
            echo "$faafo_worker" | sudo tee -a /etc/supervisord.d/faafo.ini
 | 
			
		||||
        else
 | 
			
		||||
            echo "error: distribution $ID not supported"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user