forked from power-more/image-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. prepare_env.sh for prepare container environment. 2. benchmark_summary.sh for benchmark-result to summary result. Signed-off-by: Desiki-high <[email protected]>
- Loading branch information
1 parent
faa10b7
commit 6cd8781
Showing
3 changed files
with
72 additions
and
1 deletion.
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,27 @@ | ||
#!/bin/bash | ||
|
||
sudo install -m 755 benchmark-oci/wordpress.csv oci.csv | ||
sudo install -m 755 benchmark-zran-all-prefetch/wordpress.csv zran-all-prefetch.csv | ||
sudo install -m 755 benchmark-zran-no-prefetch/wordpress.csv zran-no-prefetch.csv | ||
sudo install -m 755 benchmark-nydus-no-prefetch/wordpress.csv nydus-no-prefetch.csv | ||
sudo install -m 755 benchmark-nydus-all-prefetch/wordpress.csv nydus-all-prefetch.csv | ||
sudo install -m 755 benchmark-nydus-filelist-prefetch/wordpress.csv nydus-filelist-prefetch.csv | ||
|
||
echo "| benchmark-result | pull-elapsed(s) | create-elapsed(s) | run-elapsed(s) | total-elapsed(s) |" | ||
echo "|:-------|:-----------------:|:-------------------:|:----------------:|:------------------:|" | ||
|
||
files=(oci.csv nydus-all-prefetch.csv zran-all-prefetch.csv nydus-no-prefetch.csv zran-no-prefetch.csv nydus-filelist-prefetch.csv) | ||
|
||
for file in "${files[@]}"; do | ||
if ! [ -f "$file" ]; then | ||
continue | ||
fi | ||
filename=$(basename "$file" .csv) | ||
tail -n +2 "$file" | while read line; do | ||
pull=$(echo "$line" | cut -d ',' -f 2) | ||
create=$(echo "$line" | cut -d ',' -f 3) | ||
run=$(echo "$line" | cut -d ',' -f 4) | ||
total=$(echo "$line" | cut -d ',' -f 5) | ||
printf "| %s | %s | %s | %s | %s |\n" "$filename" "$pull" "$create" "$run" "$total" | ||
done | ||
done |
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,44 @@ | ||
#!/bin/bash | ||
|
||
readonly SNAPSHOOTER_VERSION=0.7.3 | ||
readonly NERDCTL_VERSION=1.3.0 | ||
readonly CNI_PLUGINS_VERSION=1.2.0 | ||
|
||
# setup nerdctl and nydusd env | ||
case "$1" in | ||
"oci") | ||
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/v$NERDCTL_VERSION/nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz | ||
sudo tar -xzvf nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin | ||
sudo mkdir -p /opt/cni/bin | ||
sudo wget https://github.com/containernetworking/plugins/releases/download/v$CNI_PLUGINS_VERSION/cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz | ||
sudo tar -xzvf cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz -C /opt/cni/bin | ||
sudo install -D misc/benchmark/cni_bridge.conf /etc/cni/net.d/bridge.conf | ||
;; | ||
"nydus") | ||
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/v$SNAPSHOOTER_VERSION/nydus-snapshotter-v$SNAPSHOOTER_VERSION-x86_64.tgz | ||
tar zxvf nydus-snapshotter-v$SNAPSHOOTER_VERSION-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/v$NERDCTL_VERSION/nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz | ||
sudo tar -xzvf nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin | ||
sudo mkdir -p /opt/cni/bin | ||
sudo wget https://github.com/containernetworking/plugins/releases/download/v$CNI_PLUGINS_VERSION/cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz | ||
sudo tar -xzvf cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz -C /opt/cni/bin | ||
sudo install -D misc/benchmark/cni_bridge.conf /etc/cni/net.d/bridge.conf | ||
sudo install -D misc/benchmark/nydusd_config.json /etc/nydus/config.json | ||
sudo install -D misc/benchmark/containerd_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 | ||
;; | ||
*) | ||
echo "Unknown command: $1" | ||
;; | ||
esac | ||
# setup registry env | ||
sudo docker run -d --restart=always -p 5000:5000 --name registry registry | ||
git clone https://github.com/magnific0/wondershaper.git | ||
sudo install -D -m 755 wondershaper/wondershaper /usr/local/bin |