5.2. CLI を使用した Google Cloud Platform へのインスタンスのデプロイ
Google Cloud Platform Web コンソールまたは CLI から、新しい RHEL AI Google Cloud Platform イメージを使用してインスタンスを起動できます。インスタンスを起動するには、どちらのデプロイメント方法でも使用できます。次の手順では、CLI を使用してカスタム Google Cloud Platform イメージで Google Cloud Platform インスタンスを起動する方法を示します。
デプロイメントオプションとして CLI を使用する場合、「前提条件」に示すように、いくつかの設定を作成する必要があります。
前提条件
- RHEL AI Google Cloud Platform イメージを作成している。詳細は、「RHEL AI イメージの Google Cloud Platform イメージへの変換」を参照してください。
- 特定のマシンに Google Cloud Platform CLI をインストールしている。Linux に Google Cloud Platform CLI をインストールする を参照してください。
手順
次のコマンドを実行して、Google Cloud Platform アカウントにログインします。
$ gcloud auth login- CLI で Google Cloud Platform インスタンスを起動する前に、インスタンス用にいくつかの設定変数を作成する必要があります。
デプロイメントに使用するインスタンスプロファイルを選択する必要があります。次のコマンドを実行して、目的のリージョン内のすべてのプロファイルをリスト表示します。
$ gcloud compute machine-types list --zones=<zone>希望するマシンタイプをメモしてください。インスタンスのデプロイメントに必要になります。
これで、Google Cloud Platform インスタンスの作成を開始できます。インスタンスを作成するときに環境変数を設定します。
name=my-rhelai-instance zone=us-central1-a machine_type=a3-highgpu-8g accelerator="type=nvidia-h100-80gb,count=8" image=my-custom-rhelai-image disk_size=1024 subnet=default使用するゾーンを設定します。
$ gcloud config set compute/zone $zone次のコマンドを実行して、インスタンスを起動できます。
$ gcloud compute instances create \ ${name} \ --machine-type ${machine_type} \ --image $image \ --zone $zone \ --subnet $subnet \ --boot-disk-size ${disk_size} \ --boot-disk-device-name ${name} \ --accelerator=$accelerator
検証
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/auser/.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 convert model convert diff taxonomy diff download model download evaluate model evaluate generate data generate init config init list model list serve model serve sysinfo system info test model test train model train