Installation

Installation

There are 2 ways to install the MDAI cluster locally.

  • A quick, cli-based install gets the MDAI cluster up and running in minutes.
  • A step-by-step install that let’s you see each of the components composing the MDAI cluster.

Note

Instructions in our documentation are for *nix environments.

Prerequisites

Before you install the MDAI cluster, you’ll need a GitHub account to access resources from MyDecisive repos.

You’ll also need to install the following software.

For the required MDAI cluster resources, clone the mdai-labs GitHub repo. This repo also contains the scripts resources needed for trying out the MyDecisive solutions.

  1. For the required MDAI cluster resources, clone the mdai-labs GitHub repo. This repo also contains the scripts resources needed for trying out the MyDecisive solutions.

    git clone https://github.com/DecisiveAI/mdai-labs.git
  2. Before you install the MDAI cluster, make sure Docker is running.

Choose an Installation Method

Use mdai.sh script for installation

Run to make this file executable

chmod +x ./cli/mdai.sh

Add an mdai alias

Recommended! You can create an alias in you .bashrc, .zshrc, or equivalent to run the command line. We will be using mdai to refer to the ./mdai/cli script in these docs.

In your .bashrc (or equivalent), add this to EOF

# Set this to the path of your local clone of mdai-labs
  export MDAI_LABS_DIR="$HOME/path/to/mdai-labs"
  
  # Set mdai alias
  alias mdai="${MDAI_LABS_DIR%/}/cli/mdai.sh"

You can now call mdai from your terminal and use it like you would any other CLI.

# mdai alias
  mdai <command> [command flags]
  
  # alternative without alias
  ./cli/mdai.sh <command> [command flags]

Install mdai

Run the script to install your local MDAI cluster.

I need a local k8s cluster with k8s

Option 1: Install mdai with cert-manager

This command installs a local kind cluster and mdai.

mdai install --version 0.8.6 -f values/overrides_0.8.6.yaml

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml
Option 2: Install mdai without cert-manager

This command installs a local kind cluster and mdai.

mdai --no-cert-manager install --version 0.8.6 -f values/overrides_0.8.6.yaml

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml

I have a local k8s cluster

Option 1: Install mdai with cert-manager
For this to work, your existing cluster must have cert-manager installed.

This command installs a local kind cluster and mdai.

mdai install_mdai --version 0.8.6 -f values/overrides_0.8.6.yaml

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml
Option 2: Install mdai without cert-manager

This command installs a local kind cluster and mdai.

mdai --no-cert-manager install_mdai --version 0.8.6 -f values/overrides_0.8.6.yaml

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml

You’ll see a number of messages as cluster components are installed.

Install mdai

MDAI runs in a Kubernetes cluster. You’ll use Helm charts to bring up the pods in the cluster.

Install a kind cluster

This command installs a kind cluster

kind create cluster --name mdai

Install mdai

Option 1: With cert-manager

This command installs cert-manager

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
  kubectl wait --for=condition=Established crd/certificates.cert-manager.io --timeout=60s
  kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=cert-manager -n cert-manager --timeout=60s
  kubectl wait --for=condition=Available=True deploy -l app.kubernetes.io/instance=cert-manager -n cert-manager --timeout=60s

This command installs mdai

helm upgrade --install \
      mdai oci://ghcr.io/decisiveai/ \mdai-hub \
      --namespace mdai \
      --create-namespace \
      --version 0.8.6 \
      --set mdai-operator.manager.env.otelSdkDisabled=true \
      --set mdai-gateway.otelSdkDisabled=true \
      --set mdai-s3-logs-reader.enabled=false \
      --values values/overrides_0.8.6.yaml \
      --cleanup-on-fail

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml
Option 2: Without cert-manager

This command installs mdai

helm upgrade --install mdai-hub oci://ghcr.io/decisiveai/mdai-hub \
      --version 0.8.6 \
      --namespace mdai \
      --create-namespace \
      --set mdai-operator.manager.env.otelSdkDisabled=true \
      --set mdai-gateway.otelSdkDisabled=true \
      --set mdai-s3-logs-reader.enabled=false \
      --set opentelemetry-operator.admissionWebhooks.certManager.enabled=false \
      --set opentelemetry-operator.admissionWebhooks.autoGenerateCert.enabled=true \
      --set opentelemetry-operator.admissionWebhooks.autoGenerateCert.recreate=true \
      --set opentelemetry-operator.admissionWebhooks.autoGenerateCert.certPeriodDays=365 \
      --set mdai-operator.admissionWebhooks.certManager.enabled=false \
      --set mdai-operator.admissionWebhooks.autoGenerateCert.enabled=true \
      --set mdai-operator.admissionWebhooks.autoGenerateCert.recreate=true \
      --set mdai-operator.admissionWebhooks.autoGenerateCert.certPeriodDays=365 \
      --values values/overrides_0.8.6.yaml \
      --cleanup-on-fail

Add a role binding for the OpenTelemetry operator

kubectl apply -f 0.8.6/k8s/otel_operator_rbac_patch.yaml

You’ll see a number of messages as cluster components are installed. Verify that the cluster’s pods are running.

kubectl get pods -n mdai

If the cluster is running, you’ll see output similar to the following.

NAME                                                READY   STATUS    RESTARTS     AGE
  alertmanager-kube-prometheus-stack-alertmanager-0   2/2     Running   0            50s
  kube-prometheus-stack-operator-6cfdc788d4-ts297     1/1     Running   0            59s
  mdai-event-hub-556c8897f5-kpn9g                     1/1     Running   0            59s
  mdai-gateway-5df8b6f749-qlm88                       1/1     Running   0            59s
  mdai-grafana-84bb594f6c-d6shj                       3/3     Running   0            59s
  mdai-kube-state-metrics-6cd9fd8458-rhrmr            1/1     Running   0            59s
  mdai-operator-controller-manager-65955fb98b-trn26   1/1     Running   0            59s
  mdai-prometheus-node-exporter-zm8k7                 1/1     Running   0            59s
  mdai-rabbitmq-0                                     1/1     Running   0            59s
  mdai-valkey-primary-0                               1/1     Running   0            59s
  opentelemetry-operator-6d8ddbdc4d-5rjcl             1/1     Running   0            59s
  prometheus-kube-prometheus-stack-prometheus-0       2/2     Running   0            50s

Explore MDAI Use Cases

When you’re done installing the MDAI cluster, visit Recipes List to explore available use cases.