diff --git a/Makefile b/Makefile index 11aeec473..cec2f64b3 100644 --- a/Makefile +++ b/Makefile @@ -221,13 +221,9 @@ test/k8s/cluster-%: dist/img.tar bin/kind test/k8s/_out/img-% bin/kind create cluster --name $(KIND_CLUSTER_NAME) --image="$(shell cat test/k8s/_out/img-$*)" && \ bin/kind load image-archive --name $(KIND_CLUSTER_NAME) $(<) -.PHONY: test/k8s/cluster-oci-% -test/k8s/cluster-oci-%: dist/img-oci.tar bin/kind test/k8s/_out/img-oci-% - bin/kind create cluster --name $(KIND_CLUSTER_NAME) --image="$(shell cat test/k8s/_out/img-oci-$*)" && \ - bin/kind load image-archive --name $(KIND_CLUSTER_NAME) $(<) .PHONY: test/k8s/deploy-workload-% -test/k8s/deploy-workload-%: test/k8s/clean test/k8s/cluster-% +test/k8s/deploy-workload-%: test/k8s/clean test/k8s/cluster-% kubectl --context=kind-$(KIND_CLUSTER_NAME) apply -f test/k8s/deploy.yaml kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=90s # verify that we are still running after some time @@ -235,7 +231,8 @@ test/k8s/deploy-workload-%: test/k8s/clean test/k8s/cluster-% kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s .PHONY: test/k8s/deploy-workload-oci-% -test/k8s/deploy-workload-oci-%: test/k8s/clean test/k8s/cluster-oci-% +test/k8s/deploy-workload-oci-%: test/k8s/clean test/k8s/cluster-% dist/img-oci.tar + bin/kind load image-archive --name $(KIND_CLUSTER_NAME) dist/img-oci.tar kubectl --context=kind-$(KIND_CLUSTER_NAME) apply -f test/k8s/deploy.oci.yaml kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=90s # verify that we are still running after some time diff --git a/README.md b/README.md index 616559696..5f6f80799 100644 --- a/README.md +++ b/README.md @@ -274,7 +274,7 @@ The previous demos run with an OCI Container image containing the wasm module in To learn more about this approach checkout the [design document](https://docs.google.com/document/d/11shgC3l6gplBjWF1VJCWvN_9do51otscAm0hBDGSSAc/edit). -> **Note**: This requires containerd 1.7.7+ and 1.6.25+. If you do not have these patches for both `containerd` and `ctr` you will end up with an error message such as `mismatched image rootfs and manifest layers` at the import and run steps. Latest versions of k3s have the necessary containerd versions. Kind doesn't not have these versions but we have a docker file for a [kind image that does work](test/k8s/Dockerfile.oci). See the MAKE file for how to use with kind. +> **Note**: This requires containerd 1.7.7+ and 1.6.25+. If you do not have these patches for both `containerd` and `ctr` you will end up with an error message such as `mismatched image rootfs and manifest layers` at the import and run steps. Latest versions of k3s and kind have the necessary containerd versions. Build and import the OCI image with WASM layers image: diff --git a/test/k8s/Dockerfile b/test/k8s/Dockerfile index b30a0660f..1e05bd8ed 100644 --- a/test/k8s/Dockerfile +++ b/test/k8s/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.4 -ARG KIND_VERSION=v0.20.0 -ARG KIND_NODE_VERSION=v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 +ARG KIND_VERSION=v0.21.0 +ARG KIND_NODE_VERSION=v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144 ARG RUNTIME=wasmtime FROM scratch AS kind diff --git a/test/k8s/Dockerfile.oci b/test/k8s/Dockerfile.oci deleted file mode 100644 index 8757a0548..000000000 --- a/test/k8s/Dockerfile.oci +++ /dev/null @@ -1,34 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -ARG KIND_NODE_VERSION=v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 -ARG RUNTIME=wasmtime -ARG GO_VERSION="1.21.3-bullseye" - -# modified from https://github.com/kubernetes-sigs/kind/blob/main/images/base/Dockerfile -# stage for building containerd -FROM golang:${GO_VERSION} as build-containerd -ARG CONTAINERD_VERSION="v1.7.12" -ARG CONTAINERD_CLONE_URL="https://github.com/containerd/containerd" -# we don't build with optional snapshotters, we never select any of these -# they're not ideal inside kind anyhow, and we save some disk space -ARG BUILDTAGS="no_aufs no_zfs no_btrfs no_devmapper" -RUN git clone --filter=tree:0 "${CONTAINERD_CLONE_URL}" /containerd \ - && cd /containerd \ - && git checkout "${CONTAINERD_VERSION}" \ - && export CGO_ENABLED=1 \ - && make bin/ctr bin/containerd - -FROM kindest/node:${KIND_NODE_VERSION} -COPY --from=build-containerd /containerd/bin/containerd /usr/local/bin/ -COPY --from=build-containerd /containerd/bin/ctr /usr/local/bin/ - -RUN apt-get update -y && \ - apt-get install --no-install-recommends -y libdbus-1-3 - -ADD dist/bin/* /usr/local/bin/ - -ARG RUNTIME -RUN cat <> /etc/containerd/config.toml -[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.wasm] -runtime_type = "io.containerd.${RUNTIME}.v1" -EOF \ No newline at end of file