Skip to content

Commit

Permalink
test/e2e: install containerd from release tarball.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 11, 2023
1 parent 002aa82 commit 77578ca
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions test/e2e/files/Vagrantfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/files/containerd.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/files/crio.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions test/e2e/playbook/provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 7 additions & 5 deletions test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 77578ca

Please sign in to comment.