6.2. 使用 CLI 在 Azure 上部署实例
您可以从 Azure web 控制台或 CLI 使用新的 RHEL AI Azure 镜像启动实例。您可以使用您要启动实例的部署方法。以下流程演示了如何使用 CLI 使用自定义 Azure 镜像启动 Azure 实例
如果您选择将 CLI 用作部署选项,您必须创建几个配置,如"先决条件"所示。
先决条件
- 您创建了 RHEL AI Azure 镜像。如需更多信息,请参阅"将 RHEL AI 镜像转换为 Azure 镜像"。
- 您在特定机器上安装了 Azure CLI,请参阅在 Linux 上安装 Azure CLI。
流程
运行以下命令登录到您的 Azure 帐户:
$ az login您需要选择要用于部署的实例配置集。运行以下命令列出所需区域中的所有配置集:
$ az vm list-sizes --location <region> --output table记录您首选的实例配置文件,您将需要它用于您的实例部署。
现在,您可以开始创建 Azure 实例。在创建实例时填充环境变量。
name=my-rhelai-instance az_location=eastus az_resource_group=my_resource_group az_admin_username=azureuser az_vm_size=Standard_ND96isr_H100_v5 az_image=my-custom-rhelai-image sshpubkey=$HOME/.ssh/id_rsa.pub disk_size=1024您可以运行以下命令来启动实例:
$ az vm create \ --resource-group $az_resource_group \ --name ${name} \ --image ${az_image} \ --size ${az_vm_size} \ --location ${az_location} \ --admin-username ${az_admin_username} \ --ssh-key-values @$sshpubkey \ --authentication-type ssh \ --nic-delete-option Delete \ --accelerated-networking true \ --os-disk-size-gb 1024 \ --os-disk-name ${name}-${az_location}
验证
要验证您的 Red Hat Enterprise Linux AI 工具是否已正确安装,请运行
ilab命令:$ ilab输出示例
$ ilab Usage: ilab [OPTIONS] COMMAND [ARGS]... CLI for interacting with InstructLab. If this is your first time running ilab, it's best to start with `ilab config init` to create the environment. Options: --config PATH Path to a configuration file. [default: /home/<user>/.config/instructlab/config.yaml] -v, --verbose Enable debug logging (repeat for even more verbosity) --version Show the version and exit. --help Show this message and exit. Commands: config Command Group for Interacting with the Config of InstructLab. data Command Group for Interacting with the Data generated by... model Command Group for Interacting with the Models in InstructLab. system Command group for all system-related command calls taxonomy Command Group for Interacting with the Taxonomy of InstructLab. Aliases: chat model chat generate data generate serve model serve train model train
更新 Red Hat Enterprise Linux AI
要更新到 RHEL AI 的最新 z-stream 版本,请按照 更新 Red Hat Enterprise Linux AI 文档中的步骤 操作。