Deploying Stable Diffusion Web UI on GKE Autopilot

Deploying Stable Diffusion WebUI on K8s can be challenging, but no more. Learn how to do it by:

  1. Creating a GKE autopilot cluster
  2. Deploying AUTOMATIC1111 Stable Diffusion Web UI
  3. Accessing the UI through port forwarding

Not up for a challenge? Maybe deploying Stable Diffusion on a GCE VM is easier …

Continue reading »

Deploying Stable Diffusion Web UI using Docker on GCE T4 VM

A short guide on how to deploy Stable Diffusion Web UI on a Google Cloud Compute Engine VM with 1 T4 GPU.

Creating the GCE VM with T4 using the Google Cloud Deep Learning Image:

export IMAGE_FAMILY="common-cu110-ubuntu-2004"
export ZONE="us-west1-b"
export INSTANCE_NAME="stable-diffusion"
export INSTANCE_TYPE="n1-standard-4"
gcloud compute instances …

Continue reading »

GKE Nodepool Add Labels Without overwriting existing labels

GKE has a feature to add node labels to all nodes in the nodepool. GKE will add the label to both the nodes already running in the cluster and also to newly added nodes.

You can use the feature like this:

gcloud container node-pools update my-node-pool \
  --cluster my-cluster --labels sam …

Continue reading »

GKE list tainted nodepools with a specific taint

A use case for upgrades involved being able to list all the node pools that have scaled down back to 0 and have a specific taint. This blog post shows the commands you can use to get this information.

List the GKE nodepools that have been tainted with key=upgrade …

Continue reading »

3 tips for GKE ML/batch workloads

There has been an influx of large batch and ML training workloads on GKE. I've personally had the please of working with one of those workloads. The things that batch and ML workload often require from GKE are the following:

  • Minimize pod disruptions since pods often can't simply be restarted …

Continue reading »

GKE Safely Drain a Nodepool without pod disruptions

GKE/K8s wasn't originally designed for workloads that spin up single pods and want those pods to stay up and running on the same node for very time. That doesn't mean those kind of workloads aren't running on GKE. In fact, there are large GKE ML/batch platform workloads running …

Continue reading »

Removing sidebar from storefront theme

By default, storefront comes with a large sidebar that isn't really useful for ecommerce websites. This post shows you how to remove the sidebar by creating a functions.php file in your storefront child theme.

See my previous post on creating a storefront child theme if you don't have a …

Continue reading »

Creating a woocommerce storefront child theme

The free storefront theme has a lot of features but it doesn't look great by default. Luckily, it's quite easy to create a child theme to make it more attractive. For example, using a child theme you can remove the sidebar and remove the footer credits. This blog post will …

Continue reading »

Find files with ack and replace string with sed

ack is a nice to tool to search in files in your current directory and subdirectores, but ack won't do search and replace. Luckily, we can easily combine ack and sed using xargs.

ack -l "app.kubernetes.io/name: myapp" | xargs sed -i 's|app.kubernetes.io/name: myapp|app …

Continue reading »

Python Create UUID from random string of words

Context: I'm loading data from one database (A) to another database (Weaviate). Weaviate only supports UUID, however database A is using strings as the primary identifier for some tables.

Problem: In order to not duplicate data I need to ensure that the string identifier gets converted to an UUID in …

Continue reading »