Learning Environment Installation

Learning Environment Installation

The MDAI Learning Environment is a full instance of the MdaiHub with all its clustered components, but running using Kind / Docker on your machine of choice. There are 2 ways to install the Learning Environment.

  • A quick, cli-based install gets the MDAI sandbox up and running in minutes.

  • A step-by-step install that let’s you see each of the components composing an MDAI cluster.

Note

These instructions work for *nix environments. They mostly work on Mac OS as well. (Windows is not supported at this time.)

Prerequisites

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

You’ll also need to install the following software.

  1. You can get a local copy of MDAI’s components by cloning the mdai-labs GitHub repo. Don’t be confused by the “labs” moniker. We use labs to mean both things that you can learn about as well as modular components that install via our sandbox CLI. So go ahead and clone the labs repo in its entirety. It is fun. You get to learn a lot. And most of what you have to get done is available as a lab.

    git clone https://github.com/DecisiveAI/mdai-labs.git
  2. Before you install the MDAI Learning Environment, 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

To simplify running CLI commands, create an alias for mdai.sh.

<!– mdai alias –>
  mdai <command> [command flags]
  
  <!-- alternative without alias -->
  ./cli/mdai.sh <command> [command flags]

Choose Your Installation

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

You’ll see a number of messages as sandbox cluster components are installed. Once installation is complete, verify that the Learning Environment cluster’s pods are running.

kubectl get pods -n mdai

If your Learning Environment 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-nats-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 Labs

When you’re done installing the MDAI Learning Environment, visit the Labs Catalog to explore and learn more.