Package: cloudmesh-cmsd
Cloudmesh cmsdCloudmeshcmsdis a command to run cloudmesh in a container regardless
of the OS. Thus it is extremely easy to install and use in case your
machine has docker installed.cmsduses the locally installed keys in~/.sshand typically
cloud configurations stored in~/.cloudmesh/cloudmesh.yaml. This YAML
file is created upon the first call ofcmsdif it is not available.PrerequesitesDockerPython 3.8 or newerWe strongly recommended using a python virtual environmentssh public key in ~/.ssh/id_rsa.pubHow to usecmsdImportant. You must have cms in debug off mode. to use the cmsd command$ cms debug offUser installationPlease use a python virtualenv as to not interfere with your system
python and activate your python venv.Linux, osx:$python3.8-mvenv~/ENV3
$source~/ENV3/bin/activate
$pipinstallpip-UIn Windows, you can do this with$python-mvenvENV3
$ENV3\Scripts\activate
$pipinstallpip-UNow you can install cloudmeshcmsdwith$pipinstallcloudmesh-cmsdDeveloper Source installationDevelopers installcmsdfrom source with ourcloudmesh-installerLinux, osx:$python3.8-mvenv~/ENV3
$source~/ENV3/bin/activate
$pipinstallpip-U
$mkdircm$cdcm$pipinstallcloudmesh-installer-U$cloudmesh-installergitclonecmsd$cloudmesh-installerinstallcmsdWindows:$python-mvenvENV3
$ENV3\Scripts\activate
$pipinstallpip-U
$mkdircm$cdcm$pipinstallcloudmesh-installer-U$cloudmesh-installergitclonecmsd$cloudmesh-installerinstallcmsdYou will see in thecmdirectory a number of cloudmesh related
repositories. One of them iscloudmesh-cmsdin which the cmsd command
related code is stored. The other repositories contain code that may be
used bycloudmesh-cmsd.Defult setupTo runcmsd, you need a configuration directory that is mounted
into the container.  The default setup is done with$cmsd--setupThis will set up a number of configurations including a cloudmesh
configuration YAML file inmasOS and Linux:~/.cloudmesh/cloudmesh.yamlWindows%USERPROFILE%\.cloudmesh\cloudmesh.yamlYou are asked to enter some details that are required for the setup,
such as profile details, Mongo DB credentials.Custom cmsd setupIn case you need to place the configuration files elsewhere you can
specify the location with the environment variableCLOUDMESH_CONFIG_DIR.For macOS and Linux you set it with:$ export CLOUDMESH_CONFIG_DIR=<path to CLOUDMESH_HOME_DIR>For Windows you set it with:> set CLOUDMESH_CONFIG_DIR=<path to CLOUDMESH_HOME_DIR>Note:avoid spaces:CLOUDMESH_CONFIG_DIRpath must not have in any spaces in it.
For exampleC:\.cloudmeshwill work, so doesC:\Users\gregor\.cloudmesh, but notC:\Users\gregor von Laszewski\.cloudmesh,
as it includes a space in th eusername.Note:grant access:Make sure that the drive of theCLOUDMESH_CONFIG_DIRis granted file
access in Docker settingsNext, you run the setup just like in the default case. If you are running
setup on an emptyCLOUDMESH_CONFIG_DIR,  you will be asked to enter
some details that are required for the setup, such as profile details,
Mongo DB credentials.$ cmsd --setupContainersIt the setup installs cloudmesh into two containerscontainers. The containers are calledcloudmesh-cmsfor the cms commandcloudmesh-mongofor the mongodb that is used by cmsRun the command$ cmsd --psto see if the containers are running. Additionally, checkCLOUDMESH_CONFIG_DIRor ~/.cloudmesh contains thecloudmesh.yamlfile, dependent where you askedcmsdto look for it.CommandsTo list the containers, please use$ cmsd --psRun the following to verify if the configurations you entered have been
properly reflected in thecloudmesh.yamlfile.$ cmsd config catTo initialize the cloudmesh database use$ cmsd initTo test if things are working use$ cmsd key listTo stop the containers use$ cmsd --stopTo start the containers use$ cmsd --startTo remove the containers use$ cmsd --cleanTo login to the container via a shell use$ cmsd --shellExample Usecase - Creating a vm in Chameleon CloudTo modify the parameters use the commandcmsd --gui quickand make sure the MongoDB MODE is set torunning. This is automatically
done by the setup. Make sure you add your username and password, as
well as the network id and the project id and name. Test if it works withcmsd flavor list --refreshExample Usecase - Creating a vm in AWSCreate an AWS account and add the authentication information in theCLOUDMESH_HOME_DIR/cloudmesh.yamlfile. Please see theCloudmesh
Manual -
AWSform more details about AWS.Set the cloud toaws$ cmsd set cloud=aws$ cmsd key upload --cloud=awswhere the key name is specified bycms var keyorcms config get cloudmesh.profile.userorMake sure you have an ssh key generated prior to booting a vm with the
default configuration with$ cmsd vm bootMongoDB and Mongo client connectionscmsdis running an official MongoDB container fromDockerHub.The Mongo server container is bound to127.0.0.1:27071. You can use
use any Mongo client to explore the database by connecting to this port.Using cmsd to spawn a mongo container/ serviceYou can usecmsdto start a mongo container as a service.SetupCLOUDMESH_CONFIG_DIRenvironment variable, as perviously (If not set, this would take the~/.cloudmeshas default)Clean cmsd containerscmsd --cleanUse setup commad with--mongoflagcmsd --setup --mongoNow you should have a mongoDB server bound to127.0.0.1:27071(as a container)Starting, stopping containers would be done as mentioned in the previous section.Manual PageUsage:cmsd--helpcmsd--setup[--mongo]cmsd--clean[--force]cmsd--versioncmsd--updatecmsd--startcmsd--stopcmsd--pscmsd--guiCOMMAND...cmsd--shellcmsd--pipecmsdCOMMAND...Thiscommandpassestheargumentstoadockercontainerthatrunscloudmesh.Arguments:COMMANDthecommandswebassalongDescription:cmsd--helpprintsthismanualpagecmsd--setup[--mongo]setsupcmsdcontainers.If--mongoflagispassed,onlythemongocontainerwillbesetup.cmsd--clean[--force]stopsandremovescmsdcontainersIf--cleanflagispassed,containerimageswillalsoberemoved.cmsd--versionprintsouttheversionofcmsdandtheversionofthecontainercmsd--updateupdatesthecloudmeshrepositoriesinsidethecms-containercmsd--startstartscmsdcontainerscmsd--stopstopscmsdcontainerscmsd--psliststhecontainerprocessescmsd--guihelpfindoutwhichguicommandsareavailablecmsd--guiquickrunscloudmeshguionthedockercontainercmsd--shellentersthecmscontainerandstartsaninteractiveshellcmsd--pipeYoucanpipecommandsorscriptstothecmsdcontainerecho"banner a"|cmsd--pipecmsdCOMMANDThecommandwillbeexecutedwithinthecontainer,justasincaseofcms.cmsdWhennocommandisspecified,cmsdwillberunininteractivemode.QuickstartmacOS with python 3.8.1 from python.orgRequirements:Have a username without a space.Have docker installed and accessible to the user.Have python 3.8.1 from python.org installed.Create a key~/.ssh/id_rsaif you do not already have one$ssh-keygenInstall:In a new terminal execute$python3.8-mvenv~/ENV3
$source~/ENV3/bin/activate
$pipinstallcloudmesh-cmsd
$cmsd--setup
$cmsdinit
$cmsdhelpOutput:Documented commands (type help <topic>):
========================================
EOF       config     help       man        quit      ssh        vcluster      
admin     container  host       open       register  start      version       
aws       data       image      openstack  sec       stop       vm            
azure     debug      info       pause      service   stopwatch  workflow_draft
banner    default    init       plugin     set       sys      
check     echo       inventory  provider   shell     test     
clear     flavor     ip         py         sleep     var      
commands  group      key        q          source    vboxTesting banner command:$cmsdbannerhelloOutput:banner
######################################################################
# hello
######################################################################Testing sec command:$cmsdsecrulelistOutput:+-------+----------+-----------+-----------+
| Name  | Protocol | Ports     | IP Range  |
+-------+----------+-----------+-----------+
| ssh   | tcp      | 22:22     | 0.0.0.0/0 |
| icmp  | icmp     |           | 0.0.0.0/0 |
| flask | tcp      | 8000:8000 | 0.0.0.0/0 |
| http  | tcp      | 80:80     | 0.0.0.0/0 |
| https | tcp      | 443:443   | 0.0.0.0/0 |
+-------+----------+-----------+-----------+Demonstration of the different uses of cmsdCommandline$cmsdbannerhallo

banner####################################################################### hello######################################################################Pipe$ echo "banner hello" | cmsd --pipe

+-------------------------------------------------------+
|   ____ _                 _                     _      |
|  / ___| | ___  _   _  __| |_ __ ___   ___  ___| |__   |
| | |   | |/ _ \| | | |/ _` | '_ ` _ \ / _ \/ __| '_ \  |
| | |___| | (_) | |_| | (_| | | | | | |  __/\__ \ | | | |
|  \____|_|\___/ \__,_|\__,_|_| |_| |_|\___||___/_| |_| |
+-------------------------------------------------------+
|                  Cloudmesh CMD5 Shell                 |
+-------------------------------------------------------+

cms> banner
######################################################################
# hello
######################################################################   ```Interactive$ cmsd
start cms interactively

+-------------------------------------------------------+
|   ____ _                 _                     _      |
|  / ___| | ___  _   _  __| |_ __ ___   ___  ___| |__   |
| | |   | |/ _ \| | | |/ _` | '_ ` _ \ / _ \/ __| '_ \  |
| | |___| | (_) | |_| | (_| | | | | | |  __/\__ \ | | | |
|  \____|_|\___/ \__,_|\__,_|_| |_| |_|\___||___/_| |_| |
+-------------------------------------------------------+
|                  Cloudmesh CMD5 Shell                 |
+-------------------------------------------------------+

cms> banner hello
banner
######################################################################
# hello
######################################################################
cms> quitAccess container shell for development$cmsd--shell

root@docker-desktop:/cm#ls-1
cloudmesh-aws
cloudmesh-azure
cloudmesh-cloud
cloudmesh-cmd5
cloudmesh-common
cloudmesh-configuration
cloudmesh-inventory
cloudmesh-openstack
cloudmesh-sys
cloudmesh-test
root@docker-desktop:/cm#