From 36952d6d045b8d62ff1c1c31ea4b9eee7f13b849 Mon Sep 17 00:00:00 2001 From: James Blair Date: Tue, 31 Jan 2023 15:53:19 +1300 Subject: [PATCH] Start writing wasm container content. --- 0-web-assembly-containers/Containerfile | 3 +++ 0-web-assembly-containers/README.org | 32 +++++++++++++++++++++++++ README.org | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 0-web-assembly-containers/Containerfile create mode 100644 0-web-assembly-containers/README.org create mode 100644 README.org diff --git a/0-web-assembly-containers/Containerfile b/0-web-assembly-containers/Containerfile new file mode 100644 index 0000000..a3aace7 --- /dev/null +++ b/0-web-assembly-containers/Containerfile @@ -0,0 +1,3 @@ +FROM scratch +COPY hello_wasm.wasm / +CMD ["/hello_wasm.wasm"] diff --git a/0-web-assembly-containers/README.org b/0-web-assembly-containers/README.org new file mode 100644 index 0000000..404e7f9 --- /dev/null +++ b/0-web-assembly-containers/README.org @@ -0,0 +1,32 @@ +#+TITLE: Running web assembly in containers +#+AUTHOR: James Blair +#+DATE: <2023-01-31 Tue 13:00> + + +In our recent [[https://www.redhat.com/en/blog/red-hat-and-webassembly][blog post]] on Web Assembly we highlighted the implementation of WASM support into the [[https://github.com/containers/crun/][crun]] Open Container Initiative (OCI) runtime. This change paves the way for Podman and OpenShift to run WASM workloads. + +This demo will step through how wasm + + +* Install wasm runtime + + +* Compile crun with wasm support + +To demo this capability on our own machine we need to ensure we have a version of ~crun~ available that has support for WASM. In my case I needed to download and compile a newer release including the ~as follows: + +#+NAME: Compile crun with wasmedge +#+begin_src tmate +# Install compile dependencies +sudo apt-get install --yes make git gcc build-essential pkgconf libtool libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev libgcrypt20-dev go +-md2man autoconf python3 automake + +# Clone the crun source +git clone https://github.com/containers/crun && cd crun + +# Compile with wasm flag +./autogen.sh +./configure --with-wasmedge +make +sudo make install +#+end_src diff --git a/README.org b/README.org new file mode 100644 index 0000000..414fb82 --- /dev/null +++ b/README.org @@ -0,0 +1,2 @@ +# openshift-meetup-demos +Brief demonstrations I ran at the February 2023 OpenShift meetup in Wellington.