Skip to content

Commit

Permalink
Merge pull request #434 from sachaos/modify-oci-image-name
Browse files Browse the repository at this point in the history
Fix image name of test-image/oci
  • Loading branch information
Mossaka authored Jan 8, 2024
2 parents c5478c1 + cf75085 commit 6ef2df9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ load/oci: dist/img-oci.tar
.PHONY:
target/wasm32-wasi/$(OPT_PROFILE)/img-oci.tar: target/wasm32-wasi/$(OPT_PROFILE)/wasi-demo-app.wasm
mkdir -p ${CURDIR}/bin/$(OPT_PROFILE)/
cargo run --bin oci-tar-builder -- --name wasi-demo-app --repo ghcr.io/containerd/runwasi --tag latest --module ./target/wasm32-wasi/$(OPT_PROFILE)/wasi-demo-app.wasm -o target/wasm32-wasi/$(OPT_PROFILE)/img-oci.tar
cargo run --bin oci-tar-builder -- --name wasi-demo-oci --repo ghcr.io/containerd/runwasi --tag latest --module ./target/wasm32-wasi/$(OPT_PROFILE)/wasi-demo-app.wasm -o target/wasm32-wasi/$(OPT_PROFILE)/img-oci.tar

bin/kind: test/k8s/Dockerfile
$(DOCKER_BUILD) --output=bin/ -f test/k8s/Dockerfile --target=kind .
Expand Down Expand Up @@ -234,6 +234,13 @@ test/k8s-%: test/k8s/clean test/k8s/cluster-%
sleep 5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s

.PHONY: test/k8s-oci-%
test/k8s-oci-%: test/k8s/clean test/k8s/cluster-oci-%
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
sleep 5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s

.PHONY: test/k8s/clean
test/k8s/clean: bin/kind
Expand Down
31 changes: 31 additions & 0 deletions test/k8s/deploy.oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasm
handler: wasm
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wasi-demo
labels:
app: wasi-demo
spec:
replicas: 3
selector:
matchLabels:
app: wasi-demo
template:
metadata:
labels:
app: wasi-demo
spec:
runtimeClassName: wasm
containers:
- name: demo
image: ghcr.io/containerd/runwasi/wasi-demo-oci:latest
imagePullPolicy: Never
- name: nginx
image: docker.io/nginx:latest
ports:
- containerPort: 80

0 comments on commit 6ef2df9

Please sign in to comment.