Deploying HabanaAI Operator

This section provides guidelines on how to install HabanaAI Operator on OpenShift and create a DeviceConfig instance.

You can install HabanaAI Operator either by using RedHat OpenShift Console or by using the CLI. Both methods are described below.

Using RedHat OpenShift Console

  1. Go to Operators.

  2. Click OperatorHub.

  3. In All Items field, search for Habana AI.

  4. Click Install.

../../_images/HabanaAI_Operator_Installation.png

Using the CLI

  1. Create habana-ai-operator-install.yaml file containing the following:

apiVersion: v1
kind: Namespace
metadata:
name: habana-ai-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
generateName: habana-ai-operator-
name: habana-ai-operator
namespace: habana-ai-operator
spec:
targetNamespaces:
- habana-ai-operator
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: habana-ai-operator
namespace: habana-ai-operator
spec:
channel: "WANTET_HABANA_DRIVER_VERSION"
installPlanApproval: Automatic
name: habana-ai-operator
source: certified-operators
sourceNamespace: openshift-marketplace
  1. Apply the yaml file.

oc apply -f habana-ai-operator-install.yaml

Creating the DeviceConfig Instance

The DeviceConfig is the main Custom Resource Definition (CRD) of the HabanaAI Operator.

The table below describes the required fields for creating the DeviceConfig instance.

Field

Description

Scheme

Required

DriverImage

The Habana Driver image to be used.

String

True

DriverVersion

The Habana Driver version to be used.

String

True

NodeSelector

Specifies the node selector to be used for this DeviceConfig map[string]

String

False

You can create the DeviceConfig instance either by using RedHat OpenShift Console or by using the CLI. Both methods are described below.

Using RedHat OpenShift Console

  1. Go to Operators.

  2. Click Installed Operators.

  3. In the Name field, define the instance as habana-ai-deviceconfig-instance.

  4. In the DriverImage field, add the Habana Driver image to use: vault.habana.ai/habana-ocp-operator/<Version>/habana-ai-driver.

  5. In the DriverVersion field, define the Habana Driver version to use.

../../_images/Create_DeviceConfig_Instance.png

Using the CLI

  1. Create deviceconfig.yaml file containing the following:

apiVersion: habana.ai/v1
kind: DeviceConfig
metadata:
name: habana-ai-deviceconfig-instance
namespace: habana-ai-operator
spec:
driverImage: PATH_TO_DEVICE_CONFIG_IMAGE
driverVersion: WANTED_HABANA_DRIVER_VERSION
  1. Apply the yaml file.

oc apply -f deviceconfig.yaml