-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dierbei <1628652790@qq.com>
- Loading branch information
Showing
7 changed files
with
252 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
name: release | ||
|
||
concurrency: | ||
group: release-${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
tags: | ||
- '**/v[0-9]+.[0-9]+.*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
vmm: | ||
strategy: | ||
matrix: | ||
features: ["cloud_hypervisor"] | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build vmm | ||
run: make vmm HYPERVISOR=${{ matrix.features }} RUNTIME=docker | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.features }} | ||
path: | | ||
bin/kuasar.img | ||
bin/vmlinux.bin | ||
bin/vmm-sandboxer | ||
quark: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
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"] | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
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 0.11.2 >> /dev/null | ||
- name: Build wasm | ||
run: make wasm WASM_RUNTIME=${{ matrix.features }} | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.features }} | ||
path: bin/wasm-sandboxer | ||
|
||
shim: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build shim | ||
working-directory: shim | ||
run: make all | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: shim | ||
path: | | ||
bin/containerd-shim-kuasar-vmm-v2 | ||
bin/containerd-shim-kuasar-wasm-v2 | ||
containerd: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download and Extract Containerd | ||
run: sudo -E ./scripts/build/download-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 | ||
- quark | ||
- wasm | ||
- shim | ||
- containerd | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set RELEASE_VERSION ENV var | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
echo "ARCHIVE_NAME=kuasar-${GITHUB_REF:10}-linux-amd64.tar.gz" >> $GITHUB_ENV | ||
echo "VENDOR_NAME=kuasar-${GITHUB_REF:10}-vendor.tar.gz" >> $GITHUB_ENV | ||
- name: Package vendor | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: sudo -E ./scripts/build/cargo-vendor.sh | ||
shell: bash | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: _artifacts | ||
- name: Package release | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: sudo -E ./scripts/build/github-release.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/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" | ||
|
||
gh release create $RELEASE_VERSION --generate-notes | ||
|
||
directories=( | ||
"quark" | ||
"shim" | ||
"vmm/sandbox" | ||
"vmm/task" | ||
"vmm/common" | ||
"wasm" | ||
) | ||
|
||
for dir in "${directories[@]}"; do | ||
(cd "$dir" && cargo vendor) | ||
done | ||
|
||
mkdir ../temp | ||
cp -r ./* ../temp/ | ||
tar -czvf $VENDOR_NAME -C ../temp . | ||
gh release upload $RELEASE_VERSION $VENDOR_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/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 | ||
|
||
mkdir -p _dist | ||
find _artifacts -type f | xargs -I {} cp {} _dist/ | ||
tar -czvf $ARCHIVE_NAME -C _dist . | ||
gh release upload $RELEASE_VERSION $ARCHIVE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters