このコンテンツは選択した言語では利用できません。

Chapter 5. Installing RHEL AI on Google Cloud Platform (GCP)


For installing and deploying Red Hat Enterprise Linux AI on Google Cloud Platform, you must first convert the RHEL AI image into an GCP image. You can then launch an instance using the GCP image and deploy RHEL AI on a Google Cloud Platform machine.

5.1. Converting the RHEL AI image into a Google Cloud Platform image.

To create a bootable image in Google Cloud Platform you must configure your Google Cloud Platform account, create an Google Cloud Storage bucket, and create an Google Cloud Platform image using the RHEL AI raw image.

Prerequisites

  • You installed the Google Cloud Platform CLI on your specific machine. For more information about installing the GCP CLI, see Install the Google Cloud Platform CLI on Linux.
  • You must be on a Red Hat Enterprise Linux version 9.2 - 9.4 system
  • Your machine must have an additional 100 GB of disk space.

Procedure

  1. Log in to Google Cloud Platform with the following command:

    $ gcloud auth login

    Example output of the login.

    $ gcloud auth login
    Your browser has been opened to visit:
    
        https://accounts.google.com/o/oauth2/auth?XXXXXXXXXXXXXXXXXXXX
    
    
    You are now logged in as [user@example.com].
    Your current project is [your-project].  You can change this setting by running:
      $ gcloud config set project PROJECT_ID

  2. You need to set up some Google Cloud Platform configurations and create your GCP Storage Container before creating the GCP image.

    1. Configure Google Cloud Platform CLI to use your project.

      $ gcloud_project=your-gcloud-project
      $ gcloud config set project $gcloud_project
    2. Create an environment variable defining the region where you want to operate.

      $ gcloud_region=us-central1
    3. Create a Google Cloud Platform Storage Container.

      $ gcloud_bucket=name-for-your-bucket
      $ gsutil mb -l $gcloud_region gs://$gcloud_bucket
  3. Now that your GCP Storage Container is set up, you need to download the GCP tar.gz image from the Red Hat Enterprise Linux AI download page.
  4. Set the name you want to use as the RHEL AI Google Cloud Platform image.

    $ image_name=rhel-ai-1-3
  5. Upload the tar.gz file to the Google Cloud Platform Storage Container by running the following command:

    $ gsutil cp rhelai_gcp.tar.gz "gs://${gcloud_bucket}/$image_name.tar.gz"
  6. Create an Google Cloud Platform image from the tar.gz file you just uploaded with the following command:

    $ gcloud compute images create \
        "$image_name" \
        --source-uri="gs://${gcloud_bucket}/$image_name.tar.gz" \
        --family "rhel-ai" \
        --guest-os-features=GVNIC

5.2. Deploying your instance on Google Cloud Platform using the CLI

You can launch an instance with your new RHEL AI Google Cloud Platform image from the Google Cloud Platform web console or the CLI. You can use whichever method of deployment you want to launch your instance. The following procedure displays how you can use the CLI to launch an Google Cloud Platform instance with the custom Google Cloud Platform image

If you choose to use the CLI as a deployment option, there are several configurations you have to create, as shown in "Prerequisites".

Prerequisites

  • You created your RHEL AI Google Cloud Platform image. For more information, see "Converting the RHEL AI image to a Google Cloud Platform image".
  • You installed the Google Cloud Platform CLI on your specific machine, see Install the Google Cloud Platform CLI on Linux.

Procedure

  1. Log in to your Google Cloud Platform account by running the following command:

    $ gcloud auth login
  2. Before launching your Google Cloud Platform instance on the CLI, you need to create several configuration variables for your instance.
  3. You need to select the instance profile that you want to use for the deployment. List all the profiles in the desired region by running the following command:

    $ gcloud compute machine-types list --zones=<zone>

    Make a note of your preferred machine type, you will need it for your instance deployment.

  4. You can now start creating your Google Cloud Platform instance. Populate environment variables for when you create the instance.

    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
  5. Configure the zone to be used.

    $ gcloud config set compute/zone $zone
  6. You can now launch your instance, by running the following command:

    $ 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

Verification

  • To verify that your Red Hat Enterprise Linux AI tools are installed correctly, run the ilab command:

    $ ilab

    Example output

    $ 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 logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.