From 0b41674790d5976a65e048b8e424924a055c3697 Mon Sep 17 00:00:00 2001 From: Sebastian Rieger Date: Tue, 25 Apr 2023 23:30:32 +0200 Subject: [PATCH] fixed errors when starting demo2 multiple times, added login and monitoring info in the output at the end of demo2 --- demo2-instance-with-init-script.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/demo2-instance-with-init-script.py b/demo2-instance-with-init-script.py index be59d5e..3adb7eb 100644 --- a/demo2-instance-with-init-script.py +++ b/demo2-instance-with-init-script.py @@ -21,6 +21,7 @@ project_network = 'CloudComp' + str(group_number) + '-net' # The image to look for and use for the started instance ubuntu_image_name = "Ubuntu 18.04 - Bionic Beaver - 64-bit - Cloud Based Image" +# TODO: Ubuntu >18.04 would require major updates to faafo example again/better option: complete rewrite of example? # The public key to be used for SSH connection, please make sure, that you have the corresponding private key # @@ -159,6 +160,7 @@ def main(): if instance_exists: print('Instance ' + testing_instance.name + ' already exists. Skipping creation.') + exit() else: print('Starting new all-in-one instance and wait until it is running...') testing_instance = conn.create_node(name=instance_name, @@ -211,11 +213,17 @@ def main(): elif private_ip: actual_ip_address = private_ip - 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".') + print('\n') + print('The Fractals app will be deployed to http://{}\n'.format(actual_ip_address)) + + print('You can use ssh to login to the instance using your private key. Default user name for official Ubuntu\n' + 'Cloud Images is: ubuntu, so you can use, e.g.: "ssh -i ~/.ssh/id_rsa ubuntu@" if your private\n' + 'key is in the default location.\n\n' + 'After login, you can list or "ssh ubuntu@" available fractals using "faafo list". To request\n' + 'the generation of new fractals, you can use "faafo create".\n\n' + 'You can also see other options to use the faafo example cloud service using "faafo -h".\n\n' + 'If you cannot start faafo command and/or do not see the webpage, you can check the Instance Console Log of\n' + 'the instance, e.g., in OpenStack web interface.') if __name__ == '__main__':