更新时间:2024-08-16 gmt 08:00

ma-九游平台

鉴权信息说明

  • 在虚拟机及个人pc场景,需要配置鉴权信息,目前支持用户名密码鉴权(默认)和ak/sk鉴权;
  • 在使用账号认证时,需要指定username和password;在使用iam用户认证时,需要指定account、username和password;
  • 在modelarts notebook中可以不用执行鉴权命令,默认使用委托信息,不需要手动进行鉴权操作;
  • 如果用户在modelarts notebook中也配置了鉴权信息,那么将会优先使用用户指定的鉴权信息。

    在鉴权时,注意您的敏感信息数据保护,避免敏感信息泄露。

命令参数总览

$ ma-cli configure -h
usage: ma-cli configure [options]
options:
  -auth, --auth [pwd|aksk|roma]  authentication type.
  -rp, --region-profile path     modelarts region file path.
  -a, --account text             account of an iam user.
  -u, --username text            username of an iam user.
  -p, --password text            password of an iam user
  -ak, --access-key text         user access key.
  -sk, --secret-key text         user secret key.
  -r, --region text              the region you want to visit.
  -pi, --project-id text         user project id.
  -c, --config-file text         configure file path for authorization.
  -d, --debug                    debug mode. shows full stack trace when error occurs.
  -p, --profile text             cli connection profile to use. the default profile is "default".
  -h, -h, --help                 show this message and exit.
表1 鉴权命令参数说明

参数名

参数类型

是否必选

参数说明

-auth / --auth

string

鉴权方式,支持pwd(用户名密码)、aksk(access key和secret key),默认是pwd。

-rp / --region-profile

string

指定modelarts region配置文件信息。

-a / --account

string

iam租户账号,在使用iam用户认证场景时需要指定,属于pwd鉴权的一部分。

-u / --username

string

用户名,在使用账号认证时表示账号名,iam认证时表示iam用户名,在云星账号场景不需要指定,属于pwd鉴权的一部分。

-p / --password

string

密码,属于pwd鉴权的一部分。

-ak / --access-key

string

access key,属于aksk鉴权的一部分。

-sk / --secret-key

string

secret key,属于aksk鉴权的一部分。

-r / --region

string

region名称,如果不填会默认使用region_name环境变量的值。

-pi / --project-id

string

项目id,如果不填会默认使用对应region的值,或者使用project_id环境变量。

-p / --profile

string

鉴权配置项,默认是default。

-c / --config-file

string

配置文件本地路径,默认路径为~/.modelarts/ma-cli-profile.yaml。

配置用户名密码鉴权

以在虚拟机上使用ma-cli configure为例,介绍如何配置用户名密码进行鉴权。

以下样例中所有以${}装饰的字符串都代表一个变量,用户可以根据实际情况指定对应的值。

比如${your_password}表示输入用户自己的密码信息。

# 默认使用default鉴权配置项,默认提示账号、用户名及密码(其中账号和用户名如果不需要填写可以使用enter跳过)
$ ma-cli configure --auth pwd --region ${your_region}
account: ${your_account}
username: ${your_username}
password: ${your_password}  # 输入在控制台不会回显

aksk鉴权

如下命令表示使用aksk进行鉴权,需要交互式输入ak及sk信息。默认提示ak和sk,且输入在控制台不会回显。

以下样例中所有以${}装饰的字符串都代表一个变量,用户可以根据实际情况指定对应的值。

比如${access key}表示输入用户自己的access key。

ma-cli configure --auth aksk
access key [***]: ${access key}
secret key [***]: ${secret key}

执行完鉴权命令后,将会在~/.modelarts/ma-cli-profile.yaml配置文件中保存相应的鉴权信息。

相关文档

网站地图