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 の更新 ドキュメントの手順に従ってください。