fixed demos for new private-cloud environment, added description and comments, added support for Ubuntu 18.04, replaced removed faafo repo with local copy
This commit is contained in:
		@@ -10,30 +10,40 @@ from libcloud.compute.types import Provider
 | 
			
		||||
#   services: nova, glance, neutron
 | 
			
		||||
#   resources: 2 instances (m1.small), 2 floating ips (1 keypair, 2 security groups)
 | 
			
		||||
 | 
			
		||||
# Please use 1-25 for X in username, project etc., as coordinated in the lab sessions
 | 
			
		||||
# Please use 1-29 for X in the following variable to specify your group number. (will be used for the username,
 | 
			
		||||
# project etc., as coordinated in the lab sessions)
 | 
			
		||||
 | 
			
		||||
group_number = 30
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# web service endpoint of the private cloud infrastructure
 | 
			
		||||
auth_url = 'https://private-cloud2.informatik.hs-fulda.de:5000'
 | 
			
		||||
auth_url = 'https://private-cloud.informatik.hs-fulda.de:5000'
 | 
			
		||||
# your username in OpenStack
 | 
			
		||||
auth_username = 'CloudCompX'
 | 
			
		||||
auth_username = 'CloudComp' + str(group_number)
 | 
			
		||||
# your project in OpenStack
 | 
			
		||||
project_name = 'CloudCompGrpX'
 | 
			
		||||
project_name = 'CloudComp' + str(group_number)
 | 
			
		||||
# A network in the project the started instance will be attached to
 | 
			
		||||
project_network = 'CloudComp' + str(group_number) + '-net'
 | 
			
		||||
 | 
			
		||||
# default region
 | 
			
		||||
region_name = 'RegionOne'
 | 
			
		||||
# domain to use, "default" for local accounts, "hsfulda" for LDAP of DVZ, e.g., using fdaiXXXX as auth_username
 | 
			
		||||
domain_name = "default"
 | 
			
		||||
# The image to look for and use for the started instance
 | 
			
		||||
ubuntu_image_name = "Ubuntu 18.04 - Bionic Beaver - 64-bit - Cloud Based Image"
 | 
			
		||||
 | 
			
		||||
ubuntu_image_name = "Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image"
 | 
			
		||||
#ubuntu_image_name = "Ubuntu 18.04 - Bionic Beaver - 64-bit - Cloud Based Image"
 | 
			
		||||
 | 
			
		||||
flavor_name = 'm1.small'
 | 
			
		||||
 | 
			
		||||
network_name = "CloudCompGrpX-net"
 | 
			
		||||
# The public key to be used for SSH connection, please make sure, that you have the corresponding private key
 | 
			
		||||
#
 | 
			
		||||
# id_rsa.pub should look like this (standard sshd pubkey format):
 | 
			
		||||
# ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAw+J...F3w2mleybgT1w== user@HOSTNAME
 | 
			
		||||
 | 
			
		||||
keypair_name = 'srieger-pub'
 | 
			
		||||
pub_key_file = '~/.ssh/id_rsa.pub'
 | 
			
		||||
 | 
			
		||||
flavor_name = 'm1.small'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# default region
 | 
			
		||||
region_name = 'RegionOne'
 | 
			
		||||
# domain to use, "default" for local accounts, "hsfulda" for RZ LDAP, e.g., using fdaiXXXX as auth_username
 | 
			
		||||
domain_name = "default"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
@@ -86,7 +96,7 @@ def main():
 | 
			
		||||
    networks = conn.ex_list_networks()
 | 
			
		||||
    network = ''
 | 
			
		||||
    for net in networks:
 | 
			
		||||
        if net.name == network_name:
 | 
			
		||||
        if net.name == project_network:
 | 
			
		||||
            network = net
 | 
			
		||||
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
@@ -222,7 +232,7 @@ def main():
 | 
			
		||||
    # Thanks to Stefan Friedmann for finding this fix ;)
 | 
			
		||||
 | 
			
		||||
    userdata_service = '''#!/usr/bin/env bash
 | 
			
		||||
    curl -L -s https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh | bash -s -- \
 | 
			
		||||
    curl -L -s https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples/raw/master/faafo/contrib/install.sh | bash -s -- \
 | 
			
		||||
        -i database -i messaging
 | 
			
		||||
    rabbitmqctl add_user faafo guest
 | 
			
		||||
    rabbitmqctl set_user_tags faafo administrator
 | 
			
		||||
@@ -248,8 +258,8 @@ def main():
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
 | 
			
		||||
    userdata_api = '''#!/usr/bin/env bash
 | 
			
		||||
    curl -L -s https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh | bash -s -- \
 | 
			
		||||
        -i faafo -r api -m 'amqp://guest:guest@%(services_ip)s:5672/' \
 | 
			
		||||
    curl -L -s https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples/raw/master/faafo/contrib/install.sh | bash -s -- \
 | 
			
		||||
        -i faafo -r api -m 'amqp://faafo:guest@%(services_ip)s:5672/' \
 | 
			
		||||
        -d 'mysql+pymysql://faafo:password@%(services_ip)s:3306/faafo'
 | 
			
		||||
    ''' % {'services_ip': services_ip}
 | 
			
		||||
 | 
			
		||||
@@ -290,13 +300,13 @@ def main():
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
 | 
			
		||||
    userdata_worker = '''#!/usr/bin/env bash
 | 
			
		||||
    curl -L -s https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh | bash -s -- \
 | 
			
		||||
        -i faafo -r worker -e 'http://%(api_1_ip)s' -m 'amqp://guest:guest@%(services_ip)s:5672/'
 | 
			
		||||
    curl -L -s https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples/raw/master/faafo/contrib/install.sh | bash -s -- \
 | 
			
		||||
        -i faafo -r worker -e 'http://%(api_1_ip)s' -m 'amqp://faafo:guest@%(services_ip)s:5672/'
 | 
			
		||||
    ''' % {'api_1_ip': api_1_ip, 'services_ip': services_ip}
 | 
			
		||||
 | 
			
		||||
    # userdata_api-api-2 = '''#!/usr/bin/env bash
 | 
			
		||||
    # curl -L -s https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh | bash -s -- \
 | 
			
		||||
    #     -i faafo -r worker -e 'http://%(api_2_ip)s' -m 'amqp://guest:guest@%(services_ip)s:5672/'
 | 
			
		||||
    # curl -L -s https://gogs.informatik.hs-fulda.de/srieger/cloud-computing-msc-ai-examples/raw/master/faafo/contrib/install.sh | bash -s -- \
 | 
			
		||||
    #     -i faafo -r worker -e 'http://%(api_2_ip)s' -m 'amqp://faafo:guest@%(services_ip)s:5672/'
 | 
			
		||||
    # ''' % {'api_2_ip': api_2_ip, 'services_ip': services_ip}
 | 
			
		||||
 | 
			
		||||
    print('Starting new app-worker-1 instance and wait until it is running...')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user