- Helm (
helm
) - (for this README's example only) Azure CLI (
az
) setup with your login credentials- You can use
gcloud
oraws
or even a local k8s cluster if you prefer
- You can use
-
Setup the resource group and cluster name
export RESOURCE_GROUP_NAME=<your resource group name of choice> export CLUSTER_NAME=<your cluster name of choice>
-
Create a new resource group and a new cluster
az group create --name $RESOURCE_GROUP_NAME \ --location eastus az aks create -g $RESOURCE_GROUP_NAME \ -n $CLUSTER_NAME --enable-managed-identity \ --node-count 1 \ --enable-addons monitoring \ --generate-ssh-keys
-
Get the cluster credentials
az aks get-credentials --resource-group $RESOURCE_GROUP_NAME \ --name $CLUSTER_NAME
-
Create a folder named
artifacts
mkdir artifacts
-
Rename your Stable Diffusion to
model.safetensors
and move it toartifacts
-
Build and push the model image to your container registry
CONTAINER_REGISTRY_URL=<your container registry URL> CONTAINER_URL=$CONTAINER_REGISTRY_URL/diffusion:v1.0 docker build . -t $CONTAINER_URL docker push $CONTAINER_URL
NOTE: If you get a
cannot connect to the Docker Daemon
error, you may need to specify your Docker socket tos2i
using the-U
. ex.-U unix:///Users/computer/.docker/run/docker.sock
-
Install Seldon Core on your cluster
kubectl create namespace seldon-system helm install seldon-core seldon-core-operator \ --repo https://storage.googleapis.com/seldon-charts \ --set usageMetrics.enabled=true \ --namespace seldon-system
-
Create the model namespace
kubectl create namespace diffusion
-
Update the
<repository URL>
incharts/model.yaml
containers: - name: diffusion image: <repository URL>/diffusion:v0.1
-
Apply the charts
kubectl apply -f charts/model.yaml