Skip to content

Instantly share code, notes, and snippets.

View 0xE282B0's full-sized avatar

Sven Pfennig 0xE282B0

  • Hanover, Germany
View GitHub Profile
@0xE282B0
0xE282B0 / README.md
Last active September 13, 2023 12:23
KWasm Installer 0.3.0 Test Case

A test consists of three sections cluster setup, test setup, and test result.

Template

Prerequiusits

  • Docker
  • Kind
  • Kubectl
  • Helm
@0xE282B0
0xE282B0 / docker-compose.yaml
Created March 3, 2023 08:36
Run Spin application with docker-compose
# Prerequisites:
# - Latest Docker Desktop
# - KWasm extension: https://open.docker.com/extensions/marketplace?extensionId=0xe282b0/kwasm-docker-desktop
services:
app:
image: felipecruz/tinygo-key-value:latest
command:
- /
platform: wasi/wasm
runtime: io.containerd.spin.v1
@0xE282B0
0xE282B0 / DockerDesktop-extension.md
Created March 1, 2023 19:55
Run Fermyon Spin images in Docker Desktop with KWasm extension
  • Latest Docker Desktop
  • Settings > Features in development > Use containerd for pulling and storing images
  • Install Docker KWasm extension
    • Click on Install Spin Button

Run demo app with docker CLI

docker run --platform wasi/wasm --runtime io.containerd.spin.v1 -p 80:8080 -d ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:latest /
@0xE282B0
0xE282B0 / DockerDesktop-Kubernetes.md
Last active February 16, 2023 15:48
Instructions to enable WebAssembly on Docker Desktop Kubernetes with KWasm

Wasm on Docker Desktop Kubernetes

WARNING: This could cause damage to the VM. WARNING: This could cause damage to the VM. You may need to factory reset Docker Desktop if something goes wrong.
  1. Open Docker Desktop and go to settings (see images)
    1. "Features in Development" Use containerd for pulling and storing images
  2. "Kubernetes" Enable Kubernetes
@0xE282B0
0xE282B0 / AWS-Kubernetes-WasmEdge.sh
Last active March 21, 2024 17:27
A short code listing to run WasmEdge container on AWS Kubernetes with Ubuntu nodes
# Currently only AWS AKS cluster with Ubuntu worker nodes are supported by KWasm.
eksctl create cluster --name wasm-eks --node-type=t3.medium --without-nodegroup --version=1.23
# ATENTION, you need to choose the right region and ami
# Look up the appropriate ami for your region: https://cloud-images.ubuntu.com/locator/ec2/
echo 'apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
@0xE282B0
0xE282B0 / KinD-Kubernetes-WasmEdge.sh
Last active November 1, 2022 19:47
A short code listing to run WasmEdge container on KinD Kubernetes
kind create cluster
# Takes some time ...
# Install KWasm operator
helm repo add kwasm http://kwasm.sh/kwasm-operator/
helm install -n kwasm --create-namespace kwasm-operator kwasm/kwasm-operator
# Provision Nodes
kubectl annotate node --all kwasm.sh/kwasm-node=true
# Add runtime class for crun
echo 'apiVersion: node.k8s.io/v1
@0xE282B0
0xE282B0 / DigitalOcean-Kubernetes-Spin.sh
Created October 24, 2022 19:46
A short code listing to run spin on DigitalOcean Kubernetes
doctl kubernetes cluster create kwasm
# Takes some time ...
doctl kubernetes cluster kubeconfig save kwasm
# Install KWasm operator
helm repo add kwasm http://kwasm.sh/kwasm-operator/
helm install -n kwasm --create-namespace kwasm-operator kwasm/kwasm-operator
# Provision Nodes
kubectl annotate node --all kwasm.sh/kwasm-node=true
# Jump into step 3 and 4 of containerd-wasm-shims https://github.com/deislabs/containerd-wasm-shims#using-a-shim-in-kubernetes
0xc447cD78E195af040Ad17A0acF0A7440609677fA

Keybase proof

I hereby claim:

  • I am 0xE282B0 on github.
  • I am 0xe282b0 (https://keybase.io/0xe282b0) on keybase.
  • I have a public key whose fingerprint is A1CC 932B 7257 62B0 9CCA 04A3 2C71 4624 67F3 A225

To claim this, I am signing this object: