Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflows release #95

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: release

concurrency:
group: release-${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

on:
release:
type:
- published

env:
CARGO_TERM_COLOR: always

jobs:
vmm:
strategy:
matrix:
hypervisor: ["cloud_hypervisor"]
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Build vmm sandboxer
run: make bin/vmm-sandboxer HYPERVISOR=${{ matrix.hypervisor }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: vmm-sandboxer ${{ matrix.hypervisor }}
path: |
bin/vmm-sandboxer
vmm/sandbox/config_clh.toml

image:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Build vm image
run: sudo make bin/kuasar.img RUNTIME=docker
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: image
path: bin/kuasar.img

kernel:
strategy:
matrix:
hypervisor: ["cloud_hypervisor"]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Build vm kernel
run: make bin/vmlinux.bin HYPERVISOR=${{ matrix.hypervisor }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: kernel ${{ matrix.hypervisor }}
path: bin/vmlinux.bin

quark:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Build quark
run: make quark
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: quark
path: bin/quark-sandboxer

wasm:
strategy:
matrix:
features: ["wasmedge"]
include:
- features: wasmedge
version: 0.11.2
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install WasmEdge
if: ${{ matrix.features }} == 'wasmedge'
run: curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v ${{ matrix.version }} >> /dev/null
- name: Build wasm
run: make wasm WASM_RUNTIME=${{ matrix.features }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: wasm-sandboxer ${{ matrix.features }}
path: bin/wasm-sandboxer

containerd:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Build Containerd
run: ./scripts/build/build-containerd.sh
shell: bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: containerd
path: |
bin/containerd
bin/config.toml

release:
permissions:
contents: write
needs:
- vmm
- image
- kernel
- quark
- wasm
- containerd
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Package vendor
run: |
releasever=${{ github.ref }}
releasever="${releasever#refs/tags/}"
bash ./scripts/build/cargo-vendor.sh
mkdir -p /tmp/kuasar-$releasever
cp -r ./* /tmp/kuasar-$releasever
mkdir _release
tar -czvf _release/kuasar-$releasever-vendor.tar.gz -C /tmp/ kuasar-$releasever
- uses: actions/download-artifact@v3
with:
path: _artifacts
- name: Package binaries
run: |
releasever=${{ github.ref }}
releasever="${releasever#refs/tags/}"
mkdir _dist
find _artifacts -type f | xargs -I {} cp {} _dist/
tar -czvf _release/kuasar-$releasever-linux-amd64.tar.gz -C _dist .
- name: Update Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
files: |
_release/*.tar.gz
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BIN_DIR := /usr/local/bin
SYSTEMD_SERVICE_DIR := /usr/lib/systemd/system
SYSTEMD_CONF_DIR := /etc/sysconfig

.PHONY: vmm wasm quark clean all install-vmm install-wasm install-quark install
.PHONY: vmm wasm quark clean all install-vmm install-wasm install-quark install

all: vmm quark wasm

Expand Down
53 changes: 53 additions & 0 deletions scripts/build/build-containerd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2022 The Kuasar Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

git clone https://github.com/kuasar-io/containerd.git
mkdir bin && make -C containerd bin/containerd && mv containerd/bin/containerd bin

tee bin/config.toml > /dev/null <<EOF
version = 2

[plugins."io.containerd.grpc.v1.cri"]
disable_apparmor = true

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.vmm]
runtime_type = "io.containerd.kuasar.v1"
sandboxer = "vmm"
io_type = "hvsock"

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.quark]
runtime_type = "io.containerd.quark.v1"
sandboxer = "quark"

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.wasm]
runtime_type = "io.containerd.wasm.v1"
sandboxer = "wasm"

[proxy_plugins.vmm]
type = "sandbox"
address = "/run/vmm-sandboxer.sock"

[proxy_plugins.quark]
type = "sandbox"
address = "/run/quark-sandboxer.sock"

[proxy_plugins.wasm]
type = "sandbox"
address = "/run/wasm-sandboxer.sock"
EOF
30 changes: 30 additions & 0 deletions scripts/build/cargo-vendor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Copyright 2022 The Kuasar Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

export PATH="$PATH:/home/runner/.cargo/bin"

directories=(
"quark"
"vmm/sandbox"
"vmm/task"
"vmm/common"
"wasm"
)

for dir in "${directories[@]}"; do
(cd "$dir" && cargo vendor)
done
2 changes: 1 addition & 1 deletion vmm/scripts/image/centos/build_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ install_golang() {
exit 1
fi
rm -f go${golang_version}.linux-${arch_name}.tar.gz
wget "https://go.dev/dl/go${golang_version}.linux-${arch_name}.tar.gz"
wget -q "https://go.dev/dl/go${golang_version}.linux-${arch_name}.tar.gz"
rm -rf /usr/local/go && tar -C /usr/local -xzf "go${golang_version}.linux-${arch_name}.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin" >>/etc/profile
source /etc/profile
Expand Down
4 changes: 4 additions & 0 deletions vmm/scripts/kernel/cloud_hypervisor/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ set -e

readonly version=${1:-6.1.6}
readonly base_dir="$(dirname $(readlink -f $0))"

sudo apt-get update
sudo apt-get install -y libelf-dev elfutils

# clone kernel from cloud-hypervisor github
rm -rf /tmp/linux-cloud-hypervisor
git clone --depth 1 https://github.com/cloud-hypervisor/linux.git -b ch-${version} /tmp/linux-cloud-hypervisor
Expand Down