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.

  1. For the required MDAI cluster resources, clone the mdai-labs GitHub repo. This repo also contains the scripts and 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.

  3. Run the installation commands from the cloned mdai-labs repo’s root directory.

Choose an Installation Method

Use mdai.sh script for installation

Run this to make the MDAI script file executable.

chmod +x ./cli/mdai.sh

Add an mdai alias

Recommended! You can create an alias in your .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

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

Confirm that the cluster is running.

kubectl get pods --all-namespaces

You should see a list of pods like the following.

cert-manager         cert-manager-cainjector-5dc9c8b4f7-xgccc            1/1     Running   0              3d3h
cert-manager         cert-manager-df4b69479-q72gk                        1/1     Running   93 (25m ago)   3d3h
cert-manager         cert-manager-webhook-769bbb594d-flt8l               1/1     Running   0              3d3h
kube-system          coredns-6f6b679f8f-c8brn                            1/1     Running   0              3d3h
kube-system          coredns-6f6b679f8f-n7rnv                            1/1     Running   0              3d3h
kube-system          etcd-mdai-labs-control-plane                        1/1     Running   0              3d3h
kube-system          kindnet-cq59w                                       1/1     Running   0              3d3h
kube-system          kube-apiserver-mdai-labs-control-plane              1/1     Running   0              3d3h
kube-system          kube-controller-manager-mdai-labs-control-plane     1/1     Running   0              3d3h
kube-system          kube-proxy-54m2l                                    1/1     Running   0              3d3h
kube-system          kube-scheduler-mdai-labs-control-plane              1/1     Running   0              3d3h
local-path-storage   local-path-provisioner-57c5987fd4-b6ltz             1/1     Running   0              3d3h
mdai                 alertmanager-kube-prometheus-stack-alertmanager-0   2/2     Running   0              3d3h
mdai                 kube-prometheus-stack-operator-6b9bcb8467-pxr6q     1/1     Running   0              3d3h
mdai                 mdai-event-hub-55cc8bcb67-kt4kn                     1/1     Running   0              3d3h
mdai                 mdai-gateway-7cf67b66f7-mvs7r                       1/1     Running   0              3d3h
mdai                 mdai-grafana-7b445f858c-vm26f                       3/3     Running   0              3d3h
mdai                 mdai-kube-state-metrics-f6c7956f7-4j262             1/1     Running   0              3d3h
mdai                 mdai-nats-0                                         3/3     Running   0              3d3h
mdai                 mdai-nats-1                                         3/3     Running   0              3d3h
mdai                 mdai-nats-2                                         3/3     Running   0              3d3h
mdai                 mdai-nats-box-d7fd99784-z68jc                       1/1     Running   0              3d3h
mdai                 mdai-operator-controller-manager-6c8d6d665d-qt98b   1/1     Running   0              3d3h
mdai                 mdai-prometheus-node-exporter-f47k9                 1/1     Running   0              3d3h
mdai                 mdai-valkey-primary-0                               1/1     Running   0              3d3h
mdai                 opentelemetry-operator-5f56b69cc7-nqs7n             1/1     Running   0              3d3h
mdai                 prometheus-kube-prometheus-stack-prometheus-0       2/2     Running   0              3d3h

Explore MDAI Use Cases

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