Skip to content

Commit

Permalink
Merge pull request #14 from knawd/pre-v1.2.0
Browse files Browse the repository at this point in the history
Pre v1.2.0
  • Loading branch information
No9 authored Feb 19, 2023
2 parents 67b2d7b + 77c7d55 commit a0bae2a
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 70 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Push Multi Arch

on:
push:
branch:
- 'pre-v*'

env:
IMAGE_NAME: deployer
IMAGE_TAGS: ${{ github.sha }}
IMAGE_REGISTRY: quay.io
IMAGE_NAMESPACE: knawd

jobs:
push-quay:
name: Build and push manifest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [ amd64, arm64 ]

steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v3
- id: tag
run: echo "TAG=${GITHUB_REF#refs/heads/pre-}" >> $GITHUB_OUTPUT
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Determine Checkout Depth
uses: haya14busa/action-cond@v1
id: remotearch
with:
cond: ${{ matrix.arch == 'arm64' }}
if_true: 'aarch64'
if_false: 'x86_64'
- name: Build Image
id: build_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.tag.outputs.TAG }}-linux-${{ matrix.arch }}
arch: ${{ matrix.arch }}
build-args: REMOTE_ARCH=${{ steps.remotearch.outputs.value }}
containerfiles: |
./Dockerfile
- name: Push To Quay
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.tag.outputs.TAG }}-linux-${{ matrix.arch }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: quay.io
- name: Build Manifest
id: manifests
continue-on-error: true
run: |
docker manifest create \
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{env.IMAGE_NAME}}:${{ steps.tag.outputs.TAG }} \
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{env.IMAGE_NAME}}:${{ steps.tag.outputs.TAG }}-linux-amd64 \
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{env.IMAGE_NAME}}:${{ steps.tag.outputs.TAG }}-linux-arm64
- run: docker manifest push ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{env.IMAGE_NAME}}:${{ steps.tag.outputs.TAG }}

4 changes: 2 additions & 2 deletions .github/workflows/lint-test-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -34,7 +34,7 @@ jobs:
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -32,7 +32,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -47,7 +47,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
102 changes: 45 additions & 57 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
FROM quay.io/knawd/libnode:ubuntu18 as ubuntu18builder
ARG REMOTE_ARCH=x86_64
FROM ubuntu:18.04 as ubuntu18builder

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV WASMTIME_VERSION=v5.0.0
RUN apt-get update
RUN apt-get install -y curl g++ make git gcc build-essential pkgconf libtool libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev go-md2man libtool autoconf python3 automake xz-utils

ENV WASMTIME_VERSION=v5.0.0
RUN curl https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2
Expand All @@ -9,66 +16,53 @@ WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmedge

RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmtime

WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasm-nodejs

FROM quay.io/knawd/libnode:ubuntu20 as ubuntu20builder
FROM ubuntu:20.04 as ubuntu20builder
ARG REMOTE_ARCH
RUN echo https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_${REMOTE_ARCH}.tar.xz
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt-get dist-upgrade
RUN apt update --fix-missing
RUN apt-get install -y curl g++ make git gcc build-essential pkgconf libtool libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev go-md2man libtool autoconf python3 automake xz-utils --fix-missing
ENV WASMTIME_VERSION=v5.0.0
RUN curl https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all -p /usr/local --version=0.11.2
# Direct download of the generic package as the arm version isn't available
RUN curl -L https://github.com/WasmEdge/WasmEdge/releases/download/0.11.2/WasmEdge-0.11.2-manylinux2014_${REMOTE_ARCH}.tar.xz | tar xJf - -C /usr/local --strip-components=1
WORKDIR /
RUN git clone --depth 1 -b 1.8 --recursive https://github.com/containers/crun.git
WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmedge

RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmtime

WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasm-nodejs

FROM quay.io/knawd/libnode:rocky8 as rhel8builder
FROM docker.io/rockylinux/rockylinux:8 as rhel8builder
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 \
Expand All @@ -80,31 +74,23 @@ WORKDIR /crun
RUN ./autogen.sh
RUN ./configure --with-wasmedge --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasmedge
### wasmtime
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api.tar.xz | tar xJf - -C /
RUN cp -R /wasmtime-${WASMTIME_VERSION}-$(uname -m)-linux-c-api/* /usr/local/
WORKDIR /crun
RUN ./configure --with-wasmtime --enable-embedded-yajl
RUN make
RUN ./crun --version
# RUN ./crun --version
RUN mv crun crun-wasmtime

### wasm_nodejs doesn't use the default crun so we are creating subfolders
WORKDIR /wasm_nodejs
RUN git clone --depth 1 -b node-wasm-experiment https://github.com/mhdawson/crun.git
WORKDIR /wasm_nodejs/crun
RUN cp /wasm_nodejs/node/out/Release/libnode.so.* /lib64/libnode.so
RUN cp /wasm_nodejs/node/src/js_native_api.h /usr/include/js_native_api.h
RUN cp /wasm_nodejs/node/src/js_native_api_types.h /usr/include/js_native_api_types.h
RUN cp /wasm_nodejs/node/src/node_api.h /usr/include/node_api.h
RUN cp /wasm_nodejs/node/src/node_api_types.h /usr/include/node_api_types.h
RUN ./autogen.sh
RUN ./configure --with-wasm_nodejs --enable-embedded-yajl
RUN make
RUN ./crun --version
RUN mv crun crun-wasm-nodejs
FROM registry.access.redhat.com/ubi9/ubi as ubi9build

RUN yum install -y gcc openssl-devel && \
rm -rf /var/cache/dnf && \
curl https://sh.rustup.rs -sSf | sh -s -- -y

ENV PATH=/root/.cargo/bin:${PATH}

COPY manager /app-build/

Expand All @@ -114,20 +100,22 @@ RUN cargo build --release

RUN cargo test --release

FROM registry.access.redhat.com/ubi8:8.7-1054.1675788412
FROM registry.access.redhat.com/ubi9/ubi-minimal

RUN microdnf update && microdnf install -y procps-ng util-linux

WORKDIR "/vendor/rhel8"

COPY --from=rhel8builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
COPY --from=rhel8builder /usr/local/lib/libwasmedge.so.0 /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime ./

WORKDIR "/vendor/ubuntu_20_04"
COPY --from=ubuntu20builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
COPY --from=ubuntu20builder /usr/local/lib64/libwasmedge.so.0 /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime ./

WORKDIR "/vendor/ubuntu_18_04"
COPY --from=ubuntu18builder /usr/local/lib/libwasmedge.so.0 /lib64/libnode.so /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime /wasm_nodejs/crun/crun-wasm-nodejs ./
COPY --from=ubuntu18builder /usr/local/lib/libwasmedge.so.0 /usr/local/lib/libwasmtime.so /crun/crun-wasmedge /crun/crun-wasmtime ./

WORKDIR "/app"
COPY --from=rhel8builder /app-build/target/release/manager ./
COPY --from=ubi9build /app-build/target/release/manager ./

RUN /app/manager version

Expand Down
10 changes: 5 additions & 5 deletions charts/knawd-deployer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ sources:

type: application

version: v1.1.0
version: v1.2.0

appVersion: "v1.1.0"
appVersion: "v1.2.0"

icon: https://raw.githubusercontent.com/knawd/documentation/main/icons/cookie-6116766.svg

Expand All @@ -25,13 +25,13 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: added
description: Support for microk8s
description: Support for arm64
links:
- name: GitHub PR
url: https://github.com/knawd/deployer/pull/12
url: https://github.com/knawd/deployer/pull/14
artifacthub.io/images: |
- name: knawd-deployer
image: quay.io/knawd/deployer:v1.1.0
image: quay.io/knawd/deployer:v1.2.0
artifacthub.io/license: MIT
artifacthub.io/signKey: |
fingerprint: BED079E67FD431E45301B1C9949E671B46AC8A34
Expand Down
2 changes: 1 addition & 1 deletion charts/knawd-deployer/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tag": {
"description": "The tag in the repository where the image is located used to specifiy a custom image.",
"type": "string",
"default": "v1.1.0"
"default": "v1.2.0"
},
"autoRestart": {
"description": "Flag for the deployer to automatically restart the CRI service. Required for the config to be applied",
Expand Down
2 changes: 1 addition & 1 deletion charts/knawd-deployer/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target: rhel8
tag: v1.1.0
tag: v1.2.0
autoRestart: true
logLevel: "info"
ociType: "crun-wasmedge"
Expand Down
Loading

0 comments on commit a0bae2a

Please sign in to comment.