Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the flow of the containerd test with youki #1297

Merged
merged 4 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ validate-rust-tests:

clean:
./scripts/clean.sh $(ROOT)

containerd-test:
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test


79 changes: 42 additions & 37 deletions Vagrantfile.containerd2youki
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,54 @@

Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2204"
config.vm.synced_folder '.', '/vagrant/youki', disabled: true
config.vm.synced_folder '.', '/vagrant/youki', disabled: false

config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2
v.cpus = 4
end

config.vm.provision "shell", inline: <<-SHELL
set -e -u -o pipefail
apt-get update && apt-get install -y \
make \
pkg-config \
libsystemd-dev \
libdbus-glib-1-dev \
build-essential \
libelf-dev \
libseccomp-dev \
libbtrfs-dev \
btrfs-progs
wget --quiet https://go.dev/dl/go1.18.1.linux-amd64.tar.gz -O /tmp/go1.18.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.18.1.linux-amd64.tar.gz
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin" >> ~/.bashrc
echo "export GOPATH=$HOME/go" >> ~/.bashrc
export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin
export GOPATH=$HOME/go
config.vm.provision "bootstrap", type: "shell" do |s|
s.inline = <<-SHELL
set -e -u -o pipefail
apt-get update && apt-get install -y \
YJDoc2 marked this conversation as resolved.
Show resolved Hide resolved
make \
pkg-config \
libsystemd-dev \
libdbus-glib-1-dev \
build-essential \
libelf-dev \
libseccomp-dev \
libbtrfs-dev \
btrfs-progs
wget --quiet https://go.dev/dl/go1.18.1.linux-amd64.tar.gz -O /tmp/go1.18.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.18.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
echo "export GOPATH=$HOME/go" >> ~/.bashrc
export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin
export GOPATH=$HOME/go

rm -rf /root/containerd2youki
git clone https://github.com/containerd/containerd \
/root/go/src/github.com/containerd/containerd -b v1.5.11
git clone https://github.com/containers/youki \
/root/containerd2youki/youki
git clone https://github.com/containerd/containerd \
/root/go/src/github.com/containerd/containerd -b v1.5.11

cd /root/go/src/github.com/containerd/containerd
make
make binaries
make install
./script/setup/install-cni
./script/setup/install-critools
rm -rf /bin/runc /sbin/runc /usr/sbin/runc /usr/bin/runc
cd /root/go/src/github.com/containerd/containerd
make
make binaries
make install
./script/setup/install-cni
./script/setup/install-critools
rm -rf /bin/runc /sbin/runc /usr/sbin/runc /usr/bin/runc

cd /root/containerd2youki/youki
make release-build
cp youki /usr/bin/runc
SHELL
cp /vagrant/youki/youki /usr/bin/runc
SHELL
end

config.vm.provision "test", type: "shell" do |s|
s.inline = <<-SHELL
cd /root/go/src/github.com/containerd/containerd/
export PATH=$PATH:$HOME/.cargo/bin:/usr/local/go/bin
make TEST_RUNTIME=io.containerd.runc.v2 TESTFLAGS="-timeout 120m" integration | tee result.txt
grep "FAIL: " result.txt || true
SHELL
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ Find the cause of not supporting Kubernetes by integration test of CRI Runtime.
## local

```console
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
vagrant ssh

# in VM
sudo -i
cd /root/go/src/github.com/containerd/containerd/
make TEST_RUNTIME=io.containerd.runc.v2 TESTFLAGS="-timeout 120m" integration
make containerd-test
```