From a41665caea4ff3592e6eaafc4c562f0ea62929fc Mon Sep 17 00:00:00 2001 From: Anton Whalley Date: Sat, 16 Sep 2023 18:30:32 +0100 Subject: [PATCH] feature: add nn build for wasmedge Signed-off-by: Anton Whalley --- Dockerfile | 30 ++++++++++++++++++++++++ charts/knawd-deployer/Chart.yaml | 10 ++++---- charts/knawd-deployer/README.md | 4 ++-- charts/knawd-deployer/values.schema.json | 3 ++- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 94755f4..9424e21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,6 +84,32 @@ RUN make # RUN ./crun --version RUN mv crun crun-wasmtime + +FROM docker.io/rockylinux/rockylinux:8 as rhel8_plugins +RUN dnf update -y +RUN dnf install -y dnf-plugins-core +RUN dnf config-manager --set-enabled plus +RUN dnf config-manager --set-enabled devel +RUN dnf config-manager --set-enabled powertools +RUN dnf clean all +RUN dnf update -y +RUN dnf repolist --all +RUN dnf -y install epel-release + +RUN dnf install -y git python3 which redhat-lsb-core gcc-c++ gcc +ENV WASMTIME_VERSION=v5.0.0 +RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2 +RUN dnf install -y systemd-devel yajl-devel libseccomp-devel pkg-config libgcrypt-devel \ + glibc-static python3-libmount libtool libcap-devel +WORKDIR / +RUN git clone --depth 1 -b enable_plugin --recursive https://github.com/hydai/crun +WORKDIR /crun + +RUN ./autogen.sh +RUN ./configure --with-wasmedge --enable-embedded-yajl +RUN make +RUN mv crun crun-wasmedge + FROM registry.access.redhat.com/ubi9/ubi as ubi9build RUN yum install -y gcc openssl-devel && \ @@ -114,6 +140,10 @@ COPY --from=ubuntu20builder /usr/local/lib64/libwasmedge.so.0 /usr/local/lib/lib WORKDIR "/vendor/ubuntu_18_04" COPY --from=ubuntu18builder /usr/local/lib/libwasmedge.so.0 /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime ./ +WORKDIR "/vendor/rhel8_plugins" +COPY --from=rhel8_plugins /usr/local/lib/libwasmedge.so.0 /usr/local/lib/libwasmtime.so /crun/crun-wasmedge ./ + + WORKDIR "/app" COPY --from=ubi9build /app-build/target/release/manager ./ diff --git a/charts/knawd-deployer/Chart.yaml b/charts/knawd-deployer/Chart.yaml index 39387b2..cde4fdf 100644 --- a/charts/knawd-deployer/Chart.yaml +++ b/charts/knawd-deployer/Chart.yaml @@ -11,9 +11,9 @@ sources: type: application -version: v1.2.0 +version: v1.3.0 -appVersion: "v1.2.0" +appVersion: "v1.3.0" icon: https://raw.githubusercontent.com/knawd/documentation/main/icons/cookie-6116766.svg @@ -25,13 +25,13 @@ maintainers: annotations: artifacthub.io/changes: | - kind: added - description: Support for arm64 + description: Support for nn in wasmedge links: - name: GitHub PR - url: https://github.com/knawd/deployer/pull/14 + url: https://github.com/knawd/deployer/pull/15 artifacthub.io/images: | - name: knawd-deployer - image: quay.io/knawd/deployer:v1.2.0 + image: quay.io/knawd/deployer:v1.3.0 artifacthub.io/license: MIT artifacthub.io/signKey: | fingerprint: BED079E67FD431E45301B1C9949E671B46AC8A34 diff --git a/charts/knawd-deployer/README.md b/charts/knawd-deployer/README.md index e4f4057..c14a4a4 100644 --- a/charts/knawd-deployer/README.md +++ b/charts/knawd-deployer/README.md @@ -39,7 +39,7 @@ If you wish to use this chart to obtain a crun enabled cluster but without knati These are the values particular to the deployer service. -**target**: The type of kubernetes cluster to be configured. Supported versions are `ubuntu_18_04`, `ubuntu_20_04`, `microk8s` `rhel8` (default: rhel8) +**target**: The type of kubernetes cluster to be configured. Supported versions are `ubuntu_18_04`, `ubuntu_20_04`, `microk8s` `rhel8` `rhel8_plugins`(default: rhel8). If rhel8_plugins is selected then ociType **must** be `crun-wasmedge` **tag**: The tag in the repository where the image is located used to specifiy a custom image (default: the latest release branch) @@ -49,7 +49,7 @@ These are the values particular to the deployer service. **ociType**: The type of the OCI Runtime to deploy. Currently `crun-wasmedge`, `crun-wasmtime` and `crun-wasm-nodejs` are supported (default: "crun-wasmedge") -**patchKnative**: Runs the patch to enable setting the runtime in a knative service definition. +**patchKnative**: Runs the patch to enable setting the runtime in a knative service definition.(default: true) ## Uninstall diff --git a/charts/knawd-deployer/values.schema.json b/charts/knawd-deployer/values.schema.json index 252da23..d57a80d 100644 --- a/charts/knawd-deployer/values.schema.json +++ b/charts/knawd-deployer/values.schema.json @@ -13,7 +13,8 @@ "rhel8", "ubuntu_20_04", "ubuntu_18_04", - "microk8s" + "microk8s", + "rhel8_plugins" ], "default": "rhel8" },