diff --git a/test/e2e/files/Vagrantfile.in b/test/e2e/files/Vagrantfile.in index d85e54592..e5aea5e0f 100644 --- a/test/e2e/files/Vagrantfile.in +++ b/test/e2e/files/Vagrantfile.in @@ -16,10 +16,10 @@ N = 1 CRI_RUNTIME = "#{ENV['k8scri']}" CRIO_SRC = "" -CONTAINERD_SRC = "" +CONTAINERD_VERSION = "" if CRI_RUNTIME == "containerd" - CONTAINERD_SRC = "#{ENV['containerd_src']}" + CONTAINERD_VERSION = "#{ENV['containerd_version']}" else CRIO_SRC = "#{ENV['crio_src']}" end @@ -82,7 +82,7 @@ Vagrant.configure("2") do |config| http_proxy: "#{ENV['HTTP_PROXY']}", no_proxy: "#{ENV['NO_PROXY']}", cri_runtime: CRI_RUNTIME, - containerd_src: CONTAINERD_SRC, + containerd_version: CONTAINERD_VERSION, crio_src: CRIO_SRC, nri_resource_policy_src: NRI_RESOURCE_POLICY_SRC, outdir: OUTPUT_DIR, diff --git a/test/e2e/files/containerd.service b/test/e2e/files/containerd.service index e1c80c118..e4c082b3a 100644 --- a/test/e2e/files/containerd.service +++ b/test/e2e/files/containerd.service @@ -19,7 +19,7 @@ After=network.target local-fs.target [Service] ExecStartPre=-/sbin/modprobe overlay -ExecStart=/usr/bin/containerd +ExecStart=/usr/local/bin/containerd Type=notify Delegate=yes diff --git a/test/e2e/files/crio.service b/test/e2e/files/crio.service index 3df93ddb9..41d6d1310 100644 --- a/test/e2e/files/crio.service +++ b/test/e2e/files/crio.service @@ -4,7 +4,7 @@ Documentation=https://cri-o.io After=network.target [Service] -ExecStart=/usr/bin/crio +ExecStart=/usr/local/bin/crio Delegate=yes KillMode=process diff --git a/test/e2e/playbook/provision.yaml b/test/e2e/playbook/provision.yaml index 184a7f14b..9fe3c1401 100644 --- a/test/e2e/playbook/provision.yaml +++ b/test/e2e/playbook/provision.yaml @@ -6,6 +6,8 @@ - cri_runtime: "{{ cri_runtime }}" - is_containerd: false - is_crio: false + - containerd_version: "{{ containerd_version }}" + - containerd_url: https://github.com/containerd/containerd/releases/download tasks: - set_fact: @@ -119,22 +121,18 @@ - tomli_w state: present - # We need quite recent containerd that has NRI support so use the one - # that is compiled from sources. - - name: copy containerd sources - copy: src="{{ item }}" dest="/usr/bin" mode=0755 - with_items: - - "{{ containerd_src }}/bin/ctr" - - "{{ containerd_src }}/bin/containerd" - - "{{ containerd_src }}/bin/containerd-shim" - - "{{ containerd_src }}/bin/containerd-shim-runc-v1" - - "{{ containerd_src }}/bin/containerd-shim-runc-v2" + # Install a recent enough (>= 1.7.x) containerd from release tarball to /usr/local. + - name: Install containerd binaries from release tarball + ansible.builtin.unarchive: + src: "{{ containerd_url }}/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-amd64.tar.gz" + dest: /usr/local + remote_src: yes when: is_containerd # We need quite recent cri-o that has NRI support so use the one # that is compiled from sources. - name: copy cri-o sources - copy: src="{{ item }}" dest="/usr/bin" mode=0755 + copy: src="{{ item }}" dest="/usr/local/bin" mode=0755 with_items: - "{{ crio_src }}/bin/crio" - "{{ crio_src }}/bin/crio-status" diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 32813e335..2ca223e63 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -47,10 +47,12 @@ else k8scri_sock="/var/run/crio/crio.sock" fi -# Assume containerd sources are found in parent dir of this repo. -# If that is not the case, set containerd_src when calling the e2e script. -# Same for cri-o if using that. -export containerd_src=${containerd_src:-"$SRC_DIR"/../containerd} +# If we run tests with containerd as the runtime, this is the version +# of containerd we'll fetch and install from a release tarball. +export containerd_version=1.7.6 + +# Assume cri-o sources are found in parent dir of this repo. +# If that is not the case, set crio_src when calling the e2e script. export crio_src=${crio_src:-"$SRC_DIR"/../cri-o} # Default topology if not given. The run_tests.sh script will figure out @@ -102,7 +104,7 @@ echo " Output dir = $OUTPUT_DIR" echo " Test output dir = $TEST_OUTPUT_DIR" echo " NRI dir = $nri_resource_policy_src" if [ "$k8scri" == "containerd" ]; then - echo " Containerd dir = $containerd_src" + echo " Containerd = $containerd_version" else echo " CRI-O dir = $crio_src" fi