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:
		@@ -4,29 +4,40 @@
 | 
			
		||||
from libcloud.compute.providers import get_driver
 | 
			
		||||
from libcloud.compute.types import Provider
 | 
			
		||||
 | 
			
		||||
# 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"
 | 
			
		||||
 | 
			
		||||
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():
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
@@ -76,7 +87,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
 | 
			
		||||
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
@@ -133,7 +144,7 @@ def main():
 | 
			
		||||
    ###########################################################################
 | 
			
		||||
 | 
			
		||||
    userdata = '''#!/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 faafo -i messaging -r api -r worker -r demo
 | 
			
		||||
    '''
 | 
			
		||||
 | 
			
		||||
@@ -202,6 +213,10 @@ def main():
 | 
			
		||||
 | 
			
		||||
    print('The Fractals app will be deployed to http://{}'.format(actual_ip_address))
 | 
			
		||||
 | 
			
		||||
    print('You can use ssh to login to the instance using your private key. After login, you can list available '
 | 
			
		||||
          'fractals using "faafo list". To request the generation of new fractals, you can use "faafo create". '
 | 
			
		||||
          'You can also see other options to use the faafo example cloud service using "faafo -h".')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    main()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user