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. Copy linkLink copied to clipboard!
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
Log in to Google Cloud Platform with the following command:
gcloud auth login
$ gcloud auth login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of the login.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You need to set up some Google Cloud Platform configurations and create your GCP Storage Container before creating the GCP image.
Configure Google Cloud Platform CLI to use your project.
gcloud_project=your-gcloud-project gcloud config set project $gcloud_project
$ gcloud_project=your-gcloud-project $ gcloud config set project $gcloud_project
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an environment variable defining the region where you want to operate.
gcloud_region=us-central1
$ gcloud_region=us-central1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Google Cloud Platform Storage Container.
gcloud_bucket=name-for-your-bucket gsutil mb -l $gcloud_region gs://$gcloud_bucket
$ gcloud_bucket=name-for-your-bucket $ gsutil mb -l $gcloud_region gs://$gcloud_bucket
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
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. Unzip the
tar.gz
file with the following command:gunzip <downloaded-gcp-gz-image>
$ gunzip <downloaded-gcp-gz-image>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the name you want to use as the RHEL AI Google Cloud Platform image.
image_name=rhel-ai-1-2
$ image_name=rhel-ai-1-2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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"
$ gsutil cp rhelai_gcp.tar.gz "gs://${gcloud_bucket}/$image_name.tar.gz"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
$ gcloud compute images create \ "$image_name" \ --source-uri="gs://${gcloud_bucket}/$image_name.tar.gz" \ --family "rhel-ai" \ --guest-os-features=GVNIC
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Deploying your instance on Google Cloud Platform using the CLI Copy linkLink copied to clipboard!
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
Log in to your Google Cloud Platform account by running the following command:
gcloud auth login
$ gcloud auth login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Before launching your Google Cloud Platform instance on the CLI, you need to create several configuration variables for your instance.
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>
$ gcloud compute machine-types list --zones=<zone>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make a note of your preferred machine type, you will need it for your instance deployment.
You can now start creating your Google Cloud Platform instance. Populate environment variables for when you create the instance.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the zone to be used.
gcloud config set compute/zone $zone
$ gcloud config set compute/zone $zone
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can now launch your instance, by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
To verify that your Red Hat Enterprise Linux AI tools are installed correctly, run the
ilab
command:ilab
$ ilab
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Updating Red Hat Enterprise Linux AI
To update to the latest z-stream version of RHEL AI, follow the procedures in the Updating Red Hat Enterprise Linux AI documentation.