From 9381fbd50a518c3e4e53814db05f0aa91387bc67 Mon Sep 17 00:00:00 2001 From: Fupan Li Date: Fri, 21 Dec 2018 16:27:45 +0000 Subject: [PATCH] benchmark: add a testcase for creating a pod and a container Add a testcase for measuring the time of creating a pod and container. Signed-off-by: Fupan Li --- pkg/benchmark/README.md | 206 +++++++++++++++++++++++++++++++++ pkg/benchmark/pod_container.go | 74 ++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 pkg/benchmark/README.md create mode 100644 pkg/benchmark/pod_container.go diff --git a/pkg/benchmark/README.md b/pkg/benchmark/README.md new file mode 100644 index 0000000000..2d2bf4486d --- /dev/null +++ b/pkg/benchmark/README.md @@ -0,0 +1,206 @@ +# pod and container lifecycle benchmark for kata + +This repocitory is mainly focused on the pod and container's lifecircle benchmark for kata. The way to run a kata container is +used cri + containerd + containerd-shim-kata-v2. + +## Install + +### Install kata components +```sh +ARCH=$(arch) +sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list" +curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add - +sudo -E apt-get update +sudo -E apt-get -y install kata-runtime kata-proxy kata-shim +``` +### Install kata shimv2 +```sh +go get github.com/kata-containers/runtime +pushd $GOPATH/src/github.com/kata-containers/runtime +git remote add hyper https://github.com/hyperhq/kata-runtime +git fetch hyper +git checkout -b benchmark hyper/benchmark +make +sudo -E PATH=$PATH make install +popd + +sed -i 's/image =/#image =/' /usr/share/defaults/kata-containers/configuration.toml +``` +### Install critest + +```sh +go get https://github.com/lifupan/cri-tools.git +pushd $GOPATH/src/github.com/lifupan/cri-tools +git checkout kata_benchmark +make;make install +``` + +### Install containerd +```sh +sudo apt-get update +sudo apt-get install libseccomp-dev btrfs-tools git -y +go get github.com/containerd/containerd +pushd $GOPATH/src/github.com/containerd/containerd +make +sudo -E PATH=$PATH make install +popd +``` + +### Install cni plugin +```sh +go get github.com/containernetworking/plugins +pushd $GOPATH/src/github.com/containernetworking/plugins +./build_linux.sh +mkdir /opt/cni +cp -r bin /opt/cni/ +popd +``` + +## Setup cni plugin +```sh +sudo mkdir -p /etc/cni/net.d +cat >/etc/cni/net.d/10-mynet.conf < /etc/containerd/config.toml < /etc/systemd/system/containerd.service <