You can use the ecluster commands to manage the resource lifecycle and view logs of running processes.

ecluster commands

The following table describes commands supported by ecluster.
Command Description Example
export Queries information about an Alibaba Cloud account. When you use FastGPU on your machine, you must obtain information such as the AccessKey pair, default region, and default zone.
  • export ALIYUN_ACCESS_KEY_ID=L****
  • export ALIYUN_ACCESS_KEY_SECRET=v****
  • export ALIYUN_DEFAULT_REGION=cn-hangzhou
  • export ALIYUN_DEFAULT_ZONE=cn-hangzhou-i
ecluster [help,-h,--help] Views all ecluster commands. ecluster --help
ecluster {command} --help Views a specific ecluster command. ecluster ls --help
ecluster create --config create.cfg Creates an instance based on a configuration file. The create.cfg file specifies the configuration environment of an instance. You must create a create.cfg file before you run this command. For more information, see Create a configuration file. ecluster create --config create.cfg
ecluster create --name {instance_name} --machines {instance_num} ... Creates an instance based on the parameters. ecluster create --name task0.ncluster-v100 --machines 1
ecluster ls Lists the automatically created instances. The following parameters of the instances are displayed:
  • name: the name of the instance.
  • hours_live: the duration from the time when the instance was created to the current time. Unit: hours.
  • instance_type: the type of the instance.
  • public_ip: the public IP address of the instance.
  • key/owner: the key pair or username of the instance.
  • private_ip: the internal IP address of the instance.
  • instance_id: the ID of the instance.
ecluster ls
ecluster ssh {instance_name} Logs on to a specific instance. ecluster ssh task0.ncluster-v100
ecluster tmux {instance_name} Connects to a running task. If no tmux sessions exist, SSH is used. ecluster tmux task0.ncluster-v100
ecluster stop {instance_name} Stops a specific instance.
  • ecluster stop task0.ncluster-v100: stops the instance used when task0 is being executed.
  • ecluster stop {ncluster-v100}: stops all instances used when tasks in a job are being executed.
ecluster start {instance_name} Starts a specific instance.
  • ecluster start task0.ncluster-v100: starts the instance used when task0 is being executed.
  • ecluster start {ncluster-v100}: starts all instances used when tasks in a job are being executed.
ecluster kill {instance_name} Releases a specific instance.
  • ecluster kill task0.ncluster-v100: releases the instance used when task0 is being executed.
  • ecluster kill {ncluster-v100}: releases all instances used when tasks in a job are being executed.
ecluster mount {instance_name} Attaches a NAS file system to the /ncluster directory of a specific instance. ecluster mount task0.ncluster-v100
ecluster scp {source} {destination} Provides a secure copy of a file or directory. ecluster scp /local/path/to/upload task0.ncluster-v100:/remote/path/to/save
ecluster addip {instance_name} Adds the public IP address of an instance used in a specific task to a security group. ecluster addip task0.ncluster-v100
ecluster rename {old_name} {new_name} Renames a specific instance. ecluster rename task0.ncluster-v100 task1.ncluster-v100

Create a configuration file

When you create an instance based on a configuration file, you can refer to the following code to create the configuration file:
; config.ini

[ncluster]
; The job name for current creation job.
name=ncluster-v100
; The number of machine you want to create
machines=1
; The system disk size for instances in GB
system_disk_size=300
; The data disk size for instances in GB
data_disk_size=0
; The system image name you want to installed in the instances.
image_name=ubuntu_18_04_64_20G_alibase_20190624.vhd
; The instance type you want to create at Alibaba Cloud.
instance_type=ecs.gn6v-c10g1.20xlarge
; The spot instance option; If you want to buy spot instance, please set it to True.
spot=False
; If only used to create instances, it can set to True.
confirm_cost=False
; Confirm the next operation will cost money, if set to True will default confirmed.
skip_setup=True
; Nas create/mount options; Set True will disable nas mount for current job.
disable_nas=True
; The zone id info. The option provided to use resource in the zone.
zone_id=cn-hangzhou-i
; Specify the vpc name
vpc_name=ncluster-vpc

[cmd]
install_script=pwd