5. Management¶
5.1. Configuration¶
-
class
cloudmesh.management.configuration.counter.
Counter
(counter_file_path='~/.cloudmesh/counter.yaml')[source]¶ A counter is used to keep track of some value that can be increased and is associated with a user. Typically it is used to increment the vm id or the job id.
We use a uniform naming convention method. The name is defined by different kinds of objects. The name is a string
its syntax is defined in a yaml file located at ~/.cloudmesh/name.yaml
order:
- experiment
- group
- user
- kind
- counter
schema: '{experiment}-{group}-{user}-{kind}-{counter}'
experiment: exp
group: grp
user: gregor
kind: container
counter: 2
This file is automatically generated if it does not exists by a simple Name object that can include an ordered number of dictionary keys such as
Experiment: | is an experiment that all cloud objects can be placed under. |
---|---|
Group: | A group formulates a number of objects that logically build an entity, such as a number of virtual machines building a cluster |
User: | A user name that may control the group |
Kind: | A kind that identifies which kind of resource this is |
The last is a counter which is always increased and written into this file in order to assure that the latest value is safely included in it.
A typical use is
n = Name(experiment="exp",
group="grp",
user="gregor",
kind="vm",
counter=1)
n.incr()
counter = n.get()
Which will return
exp-grp-gregor-vm-1
5.2. Printer¶
5.3. Names¶
We use a uniform naming convention method. The name is defined by different kinds of objects. The name is a string
its syntax is defined in a yaml file located at ~/.cloudmesh/name.yaml
order:
- experiment
- group
- user
- kind
- counter
schema: '{experiment}-{group}-{user}-{kind}-{counter}'
experiment: exp
group: grp
user: gregor
kind: container
counter: 2
This file is automatically generated if it does not exists by a simple Name object that can include an ordered number of dictionary keys such as
Experiment: | is an experiment that all cloud objects can be placed under. |
---|---|
Group: | A group formulates a number of objects that logically build an entity, such as a number of virtual machines building a cluster |
User: | A user name that may control the group |
Kind: | A kind that identifies which kind of resource this is |
The last is a counter which is always increased and written into this file in order to assure that the latest value is safely included in it.
A typical use is
n = Name(experiment="exp",
group="grp",
user="gregor",
kind="vm",
counter=1)
n.incr()
counter = n.get()
Which will return
exp-grp-gregor-vm-1
-
class
cloudmesh.management.configuration.name.
Name
(order=None, **kwargs)[source]
5.4. Script¶
A convenient method to execute shell commands and return their output. Note: that this method requires that the command be completely executed before the output is returned. For many activities in cloudmesh this is sufficient.
-
class
cloudmesh.management.script.
Script
[source]¶ Executing a script defined by a simple text parameter
-
class
cloudmesh.management.script.
SystemPath
[source]¶ Managing the System path in the .bashrc or .bash_profile files
-
cloudmesh.management.script.
find_process
(name)[source]¶ find a process by name
Parameters: name – the name of the process Returns: A list of dicts in which the attributes pid, command, and created are available and the name matches the specified name argument. TODO: at one point this should be moved to cloudmesh.common
Return a list of processes matching ‘name’.