Debian Codegraph @

script/benchmark/hello-bench/prepare.sh

raw
1 #!/bin/bash
2
3 # Copyright The containerd Authors.
4
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8
9 # http://www.apache.org/licenses/LICENSE-2.0
10
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 set -euo pipefail
18
19 CONTEXT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/"
20 REPO="${CONTEXT}../../../"
21 MEASURING_SCRIPT="${REPO}/script/benchmark/hello-bench/src/hello.py"
22 REBOOT_CONTAINERD_SCRIPT="${REPO}/script/benchmark/hello-bench/reboot_containerd.sh"
23
24 if [ $# -lt 1 ] ; then
25 echo "Specify benchmark target."
26 echo "Ex) ${0} <YOUR_REPOSITORY_NAME> --all"
27 echo "Ex) ${0} <YOUR_REPOSITORY_NAME> alpine busybox"
28 exit 1
29 fi
30 TARGET_REPOSITORY="${1}"
31 TARGET_IMAGES=${@:2}
32
33 DISABLE_ESTARGZ="true" "${REBOOT_CONTAINERD_SCRIPT}"
34 "${MEASURING_SCRIPT}" --repository=${TARGET_REPOSITORY} --op=prepare ${TARGET_IMAGES}