Skip to content

Commit

Permalink
feat: Add the benchmark test for nydus
Browse files Browse the repository at this point in the history
1. add the benchmark python file and config in misc/benchmark
2. add the benchmark workflows in smoke

Signed-off-by: Desiki-high <2448906309@qq.com>
  • Loading branch information
Desiki-high committed Apr 15, 2023
1 parent a3eb243 commit f6edd38
Show file tree
Hide file tree
Showing 12 changed files with 1,089 additions and 0 deletions.
206 changes: 206 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

env:
CARGO_TERM_COLOR: always
IMAGE: wordpress

jobs:
contrib-build:
Expand Down Expand Up @@ -128,6 +129,211 @@ jobs:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2
sudo -E make smoke-only
benchmark-oci:
runs-on: ubuntu-latest
needs: [contrib-build, nydus-build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Nydus
uses: actions/download-artifact@master
with:
name: nydus-artifact
path: target/release
- name: Download Nydusify
uses: actions/download-artifact@master
with:
name: nydusify-artifact
path: contrib/nydusify/cmd
- name: Prepare Nerdctl Environment
run: |
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/local/bin
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/local/bin
sudo wget https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-1.3.0-linux-amd64.tar.gz
sudo tar -xzvf nerdctl-1.3.0-linux-amd64.tar.gz -C /usr/local/bin
sudo mkdir -p /opt/cni/bin
sudo wget https://github.com/containernetworking/plugins/releases/download/v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
sudo tar -xzvf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin
sudo install -D misc/benchmark/bridge.conf /etc/cni/net.d/bridge.conf
- name: Prepare OCI Registry Environment
run: |
sudo docker run -d --restart=always -p 5000:5000 --name registry registry
sudo docker pull ${{env.IMAGE}} && docker tag ${{env.IMAGE}}:latest localhost:5000/${{env.IMAGE}}:latest
sudo docker push localhost:5000/${{env.IMAGE}}:latest
git clone https://github.com/magnific0/wondershaper.git
sudo install -D -m 755 wondershaper/wondershaper /usr/local/bin
- name: BenchMark Test
run: |
cd misc/benchmark
sudo python3 benchmark.py --mode oci
- name: Save Test Result
uses: actions/upload-artifact@v3
with:
name: benchmark-oci
path: misc/benchmark/${{env.IMAGE}}.csv

benchmark-nydus-no-prefetch:
runs-on: ubuntu-latest
needs: [contrib-build, nydus-build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Nydus
uses: actions/download-artifact@master
with:
name: nydus-artifact
path: target/release
- name: Download Nydusify
uses: actions/download-artifact@master
with:
name: nydusify-artifact
path: contrib/nydusify/cmd
- name: Prepare Nydus Environment
run: |
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/local/bin
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/local/bin
wget https://github.com/containerd/nydus-snapshotter/releases/download/v0.7.3/nydus-snapshotter-v0.7.3-x86_64.tgz
tar zxvf nydus-snapshotter-v0.7.3-x86_64.tgz
sudo install -D -m 755 nydus-snapshotter/containerd-nydus-grpc /usr/local/bin/
sudo wget https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-1.3.0-linux-amd64.tar.gz
sudo tar -xzvf nerdctl-1.3.0-linux-amd64.tar.gz -C /usr/local/bin
sudo mkdir -p /opt/cni/bin
sudo wget https://github.com/containernetworking/plugins/releases/download/v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
sudo tar -xzvf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin
sudo install -D misc/benchmark/bridge.conf /etc/cni/net.d/bridge.conf
sudo install -D misc/benchmark/config.json /etc/nydus/config.json
sudo install -D misc/benchmark/config.toml /etc/containerd/config.toml
sudo systemctl restart containerd
sudo install -D misc/benchmark/nydus-snapshotter.service /etc/systemd/system/nydus-snapshotter.service
sudo systemctl start nydus-snapshotter
- name: Prepare Nydus Registry Environment
run: |
sudo docker run -d --restart=always -p 5000:5000 --name registry registry
sudo DOCKER_CONFIG=$HOME/.docker nydusify convert \
--source ${{env.IMAGE}}:latest \
--target localhost:5000/${{env.IMAGE}}:latest_nydus \
--fs-version 6 \
--platform linux/amd64,linux/arm64
git clone https://github.com/magnific0/wondershaper.git
sudo install -D -m 755 wondershaper/wondershaper /usr/local/bin
- name: BenchMark Test
run: |
cd misc/benchmark
sudo python3 benchmark.py --mode nydus-no-prefetch
- name: Save Test Result
uses: actions/upload-artifact@v3
with:
name: benchmark-nydus-no-prefetch
path: misc/benchmark/${{env.IMAGE}}.csv

benchmark-nydus-all-prefetch:
runs-on: ubuntu-latest
needs: [contrib-build, nydus-build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Nydus
uses: actions/download-artifact@master
with:
name: nydus-artifact
path: target/release
- name: Download Nydusify
uses: actions/download-artifact@master
with:
name: nydusify-artifact
path: contrib/nydusify/cmd
- name: Prepare Nydus Environment
run: |
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/local/bin
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/local/bin
wget https://github.com/containerd/nydus-snapshotter/releases/download/v0.7.3/nydus-snapshotter-v0.7.3-x86_64.tgz
tar zxvf nydus-snapshotter-v0.7.3-x86_64.tgz
sudo install -D -m 755 nydus-snapshotter/containerd-nydus-grpc /usr/local/bin/
sudo wget https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-1.3.0-linux-amd64.tar.gz
sudo tar -xzvf nerdctl-1.3.0-linux-amd64.tar.gz -C /usr/local/bin
sudo mkdir -p /opt/cni/bin
sudo wget https://github.com/containernetworking/plugins/releases/download/v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
sudo tar -xzvf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin
sudo install -D misc/benchmark/bridge.conf /etc/cni/net.d/bridge.conf
sudo install -D misc/benchmark/config.json /etc/nydus/config.json
sudo install -D misc/benchmark/config.toml /etc/containerd/config.toml
sudo systemctl restart containerd
sudo install -D misc/benchmark/nydus-snapshotter.service /etc/systemd/system/nydus-snapshotter.service
sudo systemctl start nydus-snapshotter
- name: Prepare Nydus Registry Environment
run: |
sudo docker run -d --restart=always -p 5000:5000 --name registry registry
sudo DOCKER_CONFIG=$HOME/.docker nydusify convert \
--source ${{env.IMAGE}}:latest \
--target localhost:5000/${{env.IMAGE}}:latest_nydus \
--fs-version 6 \
--platform linux/amd64,linux/arm64
git clone https://github.com/magnific0/wondershaper.git
sudo install -D -m 755 wondershaper/wondershaper /usr/local/bin
- name: BenchMark Test
run: |
cd misc/benchmark
sudo python3 benchmark.py --mode nydus-all-prefetch
- name: Save Test Result
uses: actions/upload-artifact@v3
with:
name: benchmark-nydus-all-prefetch
path: misc/benchmark/${{env.IMAGE}}.csv

benchmark-nydus-filelist-prefetch:
runs-on: ubuntu-latest
needs: [contrib-build, nydus-build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Nydus
uses: actions/download-artifact@master
with:
name: nydus-artifact
path: target/release
- name: Download Nydusify
uses: actions/download-artifact@master
with:
name: nydusify-artifact
path: contrib/nydusify/cmd
- name: Prepare Nydus Environment
run: |
sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/local/bin
sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/local/bin
wget https://github.com/containerd/nydus-snapshotter/releases/download/v0.7.3/nydus-snapshotter-v0.7.3-x86_64.tgz
tar zxvf nydus-snapshotter-v0.7.3-x86_64.tgz
sudo install -D -m 755 nydus-snapshotter/containerd-nydus-grpc /usr/local/bin/
sudo wget https://github.com/containerd/nerdctl/releases/download/v1.3.0/nerdctl-1.3.0-linux-amd64.tar.gz
sudo tar -xzvf nerdctl-1.3.0-linux-amd64.tar.gz -C /usr/local/bin
sudo mkdir -p /opt/cni/bin
sudo wget https://github.com/containernetworking/plugins/releases/download/v1.2.0/cni-plugins-linux-amd64-v1.2.0.tgz
sudo tar -xzvf cni-plugins-linux-amd64-v1.2.0.tgz -C /opt/cni/bin
sudo install -D misc/benchmark/bridge.conf /etc/cni/net.d/bridge.conf
sudo install -D misc/benchmark/config.json /etc/nydus/config.json
sudo install -D misc/benchmark/config.toml /etc/containerd/config.toml
sudo systemctl restart containerd
sudo install -D misc/benchmark/nydus-snapshotter.service /etc/systemd/system/nydus-snapshotter.service
sudo systemctl start nydus-snapshotter
- name: Prepare Nydus Registry Environment
run: |
sudo docker run -d --restart=always -p 5000:5000 --name registry registry
sudo DOCKER_CONFIG=$HOME/.docker nydusify convert \
--source ${{env.IMAGE}}:latest \
--target localhost:5000/${{env.IMAGE}}:latest_nydus \
--fs-version 6 \
--platform linux/amd64,linux/arm64
git clone https://github.com/magnific0/wondershaper.git
sudo install -D -m 755 wondershaper/wondershaper /usr/local/bin
- name: BenchMark Test
run: |
cd misc/benchmark
sudo python3 benchmark.py --mode nydus-filelist-prefetch
- name: Save Test Result
uses: actions/upload-artifact@v3
with:
name: benchmark-nydus-filelist-prefetch
path: misc/benchmark/${{env.IMAGE}}.csv

nydus-unit-test:
runs-on: ubuntu-latest
steps:
Expand Down
Loading

0 comments on commit f6edd38

Please sign in to comment.