{"id":20805740,"url":"https://github.com/danbugs/spidey-js","last_synced_at":"2025-07-22T13:04:42.615Z","repository":{"id":161850414,"uuid":"636464346","full_name":"danbugs/spidey-js","owner":"danbugs","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-05T20:14:58.000Z","size":3251,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T15:56:34.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danbugs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-04T22:58:47.000Z","updated_at":"2023-05-05T08:02:32.000Z","dependencies_parsed_at":"2024-03-26T23:00:10.489Z","dependency_job_id":null,"html_url":"https://github.com/danbugs/spidey-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danbugs/spidey-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fspidey-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fspidey-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fspidey-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fspidey-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danbugs","download_url":"https://codeload.github.com/danbugs/spidey-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fspidey-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266499015,"owners_count":23938771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T19:16:08.016Z","updated_at":"2025-07-22T13:04:42.590Z","avatar_url":"https://github.com/danbugs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `spidey-js`\n\nThis is an example app. using JS w/ SpiderLightning working in K3Ds.\n\n## How to use\n\n```bash\n# --\u003e If you have to, build your image:\n# docker buildx build --platform=wasi/wasm --load -t spidey-js:v0.5.0 .\n# ^^^ I already did and pushed to dockerhub (docker tag spidey-js:v0.5.0 danstaken/spidey-js:v0.5.0 \u0026\u0026 docker push danstaken/spidey-js:v0.5.0), so my workload.yaml uses that.\n\n# --\u003e Create a cluster with the shim:\nk3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.6.0 -p \"8081:80@loadbalancer\" --agents 1\n\n# --\u003e If you are using a local image, load it onto the cluster:\n# k3d image load -c wasm-cluster spidey-js:v0.5.0\n# # ^^^ Again, I'm using an image on dockerhub, so I don't need to do this.\n\n# --\u003e Apply the label to the agent:\nkubectl label nodes k3d-wasm-cluster-agent-0 slight-enabled=true\n\n# --\u003e Apply the runtime and workload:\nkubectl apply -f k3d\n\n# --\u003e Verify it works:\nkubectl get pods\n\n# --\u003e Sample successful output:\n# NAME                           READY   STATUS    RESTARTS   AGE\n# wasm-slight-5bf74c979d-r77w8   1/1     Running   0          6s\n\n# Test it:\ncurl -v http://127.0.0.1:8081/get/hello\n\n# --\u003e Sample successful output:\n# *   Trying 127.0.0.1:8081...\n# * Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)\n# \u003e GET /get/hello HTTP/1.1\n# \u003e Host: 127.0.0.1:8081\n# \u003e User-Agent: curl/7.87.0\n# \u003e Accept: */*\n# \u003e \n# * Mark bundle as not supporting multiuse\n# \u003c HTTP/1.1 200 OK\n# \u003c Access-Control-Allow-Headers: *\n# \u003c Access-Control-Allow-Methods: *\n# \u003c Access-Control-Allow-Origin: *\n# \u003c Access-Control-Expose-Headers: *\n# \u003c Content-Length: 15\n# \u003c Date: Fri, 05 May 2023 00:00:26 GMT\n# \u003c Content-Type: text/plain; charset=utf-8\n# \u003c \n# * Connection #0 to host 127.0.0.1 left intact\n# Hello, JS Wasm!% \n```\n\n## Running on AKS Before Official Support\n\nAKS is yet trigger a new release officially supporting the latest versions [containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims) (v0.6.0 w/ slight v0.5.0), so this is a workaround to get it working on AKS until then.\n\n\u003e Note: Most of this tutorial is taken from [here](https://learn.microsoft.com/en-us/azure/aks/use-wasi-node-pools), as they are normal steps to setting up Wasm/WASI node pools – the workaround steps are marked w/ a `*`.\n\n(1) Create an AKS cluster as normal.\n(2) Connect to your AKS cluster.\n(3) Register the 'WasmNodePoolPreview' feature flag (https://learn.microsoft.com/en-us/azure/aks/use-wasi-node-pools#register-the-wasmnodepoolpreview-feature-flag).\n(4) Add a Wasm/WASI node pool to your cluster (https://learn.microsoft.com/en-us/azure/aks/use-wasi-node-pools#add-a-wasmwasi-node-pool-to-an-existing-aks-cluster).\n```bash\naz aks nodepool add \\\n    --resource-group dchiarlone-spidey-js \\\n    --cluster-name spidey-js-wasm-cluster \\\n    --name mywasipool \\\n    --node-count 1 \\\n    --workload-runtime WasmWasi\n```\n(5) Verify the node pool is running \n```bash\nkubectl get nodes -o wide\n# --\u003e Sample successful output:\n# ➜  spidey-js git:(main) ✗ kubectl get nodes -o wide\n# NAME                                 STATUS   ROLES   AGE   VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME\n# aks-agentpool-26499314-vmss000000    Ready    agent   26m   v1.25.6   10.224.0.4    \u003cnone\u003e        Ubuntu 22.04.2 LTS   5.15.0-1036-azure   containerd://1.6.18+azure-1\n# aks-agentpool-26499314-vmss000002    Ready    agent   26m   v1.25.6   10.224.0.5    \u003cnone\u003e        Ubuntu 22.04.2 LTS   5.15.0-1036-azure   containerd://1.6.18+azure-1\n# aks-mywasipool-10429225-vmss000000   Ready    agent   61s   v1.25.6   10.224.0.6    \u003cnone\u003e        Ubuntu 22.04.2 LTS   5.15.0-1036-azure   containerd://1.6.18+azure-1\n```\n(6\\*) Somewhere else in your machine, run `git clone https://github.com/trstringer/az-aks-ssh \u0026\u0026 cd az-aks-ssh` and then `./az-aks-ssh.sh -g dchiarlone-spidey-js -n spidey-js-wasm-cluster -d aks-mywasipool-10429225-vmss000000` to SSH into the Wasm/WASI node pool.\n(7\\*) Once you've successfully SSH'd, run `ls -la /usr/local/bin/` to verify the slight shim is installed and its' permissions:\n```bash\nls -la /usr/local/bin/\n# --\u003e Sample successful output:\n# azureuser@aks-mywasipool-10429225-vmss000000:~$ ls -la /usr/local/bin/\n# total 567460\n# drwxr-xr-x  2 root root         4096 May  5 17:16 .\n# drwxr-xr-x 10 root root         4096 Apr 20 02:08 ..\n# \u003csnip\u003e\n# -rwxr-xr-x  1 root root     47622592 May  5 16:59 containerd-shim-slight-v0-3-0-v1\n# -rwxr-xr-x  1 root root     52232184 May  5 16:59 containerd-shim-slight-v0-5-1-v1\n# \u003csnip\u003e\n```\n(8\\*) `curl` the latest shim binary purposefully misnamed with `v0-5-1` to avoid extra work:\n```bash\ncurl https://spideyjsstorage.blob.core.windows.net/spidey-js/containerd-shim-slight-v0-5-1-v1 --output containerd-shim-slight-v0-5-1-v1\n```\n(9\\*) Set the correct permissions on the shim binary:\n```bash\nsudo chmod 755 containerd-shim-slight-v0-5-1-v1\nsudo chown root:root containerd-shim-slight-v0-5-1-v1\n```\n(10\\*) Move the shim binary to the correct location:\n```bash\nsudo mv containerd-shim-slight-v0-5-1-v1 /usr/local/bin/containerd-shim-slight-v0-5-1-v1\n```\n(11\\*) Exit off the ssh session with `exit`. \n(12) Apply the runtime and workload:\n```bash\nkubectl apply -f aks\n```\n(13) Verify it works:\n```bash\nkubectl get svc\n# --\u003e Sample successful output:\n# NAME          TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)        AGE\n# kubernetes    ClusterIP      10.0.0.1       \u003cnone\u003e         443/TCP        10m\n# wasm-slight   LoadBalancer   10.0.133.247   \u003cEXTERNAL-IP\u003e  80:30725/TCP   2m47s\ncurl http://EXTERNAL-IP/get/hello\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fspidey-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanbugs%2Fspidey-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fspidey-js/lists"}