本文整理匯總了Python中cloudmesh_client.cloud.default.Default.get_cluster方法的典型用法代碼示例。如果您正苦於以下問題:Python Default.get_cluster方法的具體用法?Python Default.get_cluster怎麽用?Python Default.get_cluster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cloudmesh_client.cloud.default.Default
的用法示例。
在下文中一共展示了Default.get_cluster方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_hpc
# 需要導入模塊: from cloudmesh_client.cloud.default import Default [as 別名]
# 或者: from cloudmesh_client.cloud.default.Default import get_cluster [as 別名]
def do_hpc(self, args, arguments):
# noinspection PyPep8
"""
::
Usage:
hpc queue [--job=NAME][--cluster=CLUSTER][--format=FORMAT]
hpc info [--cluster=CLUSTER][--format=FORMAT]
hpc run list [ID] [--cluster=CLUSTER]
hpc run output [ID] [--cluster=CLUSTER]
hpc run rm [ID] [--cluster=CLUSTER]
hpc run SCRIPT [--queue=QUEUE] [--t=TIME] [--N=nodes] [--name=NAME] [--cluster=CLUSTER][--dir=DIR][--group=GROUP][--format=FORMAT]
hpc delete --job=NAME [--cluster=CLUSTER][--group=GROUP]
hpc delete all [--cluster=CLUSTER][--group=GROUP][--format=FORMAT]
hpc status [--job=name] [--cluster=CLUSTER] [--group=GROUP]
hpc test --cluster=CLUSTER [--time=SECONDS]
Options:
--format=FORMAT the output format [default: table]
Examples:
Special notes
if the group is specified only jobs from that group are
considered. Otherwise the default group is used. If the
group is set to None, all groups are used.
cm hpc queue
lists the details of the queues of the hpc cluster
cm hpc queue --job=NAME
lists the details of the job in the queue of the hpc cluster
cm hpc info
lists the details of the hpc cluster
cm hpc run SCRIPT
submits the script to the cluster. The script will be
copied prior to execution into the home directory on the
remote machine. If a DIR is specified it will be copied
into that dir.
The name of the script is either specified in the script
itself, or if not the default naming scheme of
cloudmesh is used using the same index incremented name
as in vms fro clouds: cloudmes husername-index
cm hpc delete all
kills all jobs on the default hpc group
cm hpc delete --job=NAME
kills a job with a given name or job id
cm default cluster=NAME
sets the default hpc cluster
cm hpc status
returns the status of all jobs
cm hpc status job=ID
returns the status of the named job
cm hpc test --cluster=CLUSTER --time=SECONDS
submits a simple test job to the named cluster and returns
if the job could be successfully executed. This is a
blocking call and may take a long time to complete
dependent on if the queuing system of that cluster is
busy. It will only use one node/core and print the message
#CLOUDMESH: Test ok
in that is being looked for to identify if the test is
successful. If time is used, the job is terminated
after the time is elapsed.
Examples:
cm hpc queue
cm hpc queue --job=xxx
cm hpc info
cm hpc delete --job=6
cm hpc delete all
cm hpc status
cm hpc status --job=6
cm hpc run uname
cm hpc run ~/test.sh --cluster=india
"""
format = arguments['--format']
cluster = arguments['--cluster'] or Default.get_cluster()
arguments["CLUSTER"] = cluster
if cluster is None:
Console.error("Default cluster doesn't exist")
return
batch = BatchProvider(cluster)
if arguments["queue"]:
name = arguments['--job']
result = batch.queue(cluster, format=format, job=name)
#.........這裏部分代碼省略.........
示例2: do_hpc
# 需要導入模塊: from cloudmesh_client.cloud.default import Default [as 別名]
# 或者: from cloudmesh_client.cloud.default.Default import get_cluster [as 別名]
def do_hpc(self, args, arguments):
# noinspection PyPep8
"""
::
Usage:
hpc queue [--job=NAME][--cluster=CLUSTER][--format=FORMAT]
hpc info [--cluster=CLUSTER][--format=FORMAT]
hpc run SCRIPT [--queue=QUEUE] [--t=TIME] [--N=nodes] [--name=NAME] [--cluster=CLUSTER][--dir=DIR][--group=GROUP][--format=FORMAT]
hpc delete --job=NAME [--cluster=CLUSTER][--group=GROUP]
hpc delete all [--cluster=CLUSTER][--group=GROUP][--format=FORMAT]
hpc status [--job=name] [--cluster=CLUSTER] [--group=GROUP]
hpc test --cluster=CLUSTER [--time=SECONDS]
Options:
--format=FORMAT the output format [default: table]
Examples:
Special notes
if the group is specified only jobs from that group are
considered. Otherwise the default group is used. If the
group is set to None, all groups are used.
cm hpc queue
lists the details of the queues of the hpc cluster
cm hpc queue --name=NAME
lists the details of the job in the queue of the hpc cluster
cm hpc info
lists the details of the hpc cluster
cm hpc run SCRIPT
submits the script to the cluster. The script will be
copied prior to execution into the home directory on the
remote machine. If a DIR is specified it will be copied
into that dir.
The name of the script is either specified in the script
itself, or if not the default nameing scheme of
cloudmesh is used using the same index incremented name
as in vms fro clouds: cloudmeshusername-index
cm hpc delete all
kills all jobs on the default hpc cluster
cm hpc delete all -cluster=all
kills all jobs on all clusters
cm hpc delete --job=NAME
kills a job with a given name or job id
cm hpc default cluster=NAME
sets the default hpc cluster
cm hpc status
returns the status of all jobs
cm hpc status job=ID
returns the status of the named job
cm hpc test --cluster=CLUSTER --time=SECONDS
submits a simple test job to the named cluster and returns
if the job could be successfully executed. This is a
blocking call and may take a long time to complete
dependent on if the queuing system of that cluster is
busy. It will only use one node/core and print the message
#CLOUDMESH: Test ok
in that is being looked for to identify if the test is
successful. If time is used, the job is terminated
after the time is elapsed.
Examples:
cm hpc queue
cm hpc queue --job=xxx
cm hpc info
cm hpc delete --job=6
cm hpc run uname
"""
format = arguments['--format']
cluster = arguments['--cluster'] or Default.get_cluster()
print ("CCC", cluster)
if cluster is None:
Console.error("Default cluster doesn't exist")
return
batch = BatchProvider(cluster)
if arguments["queue"]:
name = arguments['--job']
result = batch.queue(cluster, format=format, job=name)
Console.msg(result)
elif arguments["info"]:
#.........這裏部分代碼省略.........