cri-resource-manager icon indicating copy to clipboard operation
cri-resource-manager copied to clipboard

e2e: allow installing cri-o on ubuntu from 'distro' repos.

Open klihub opened this issue 4 years ago • 4 comments

Allow installing cri-o on ubuntu from repos as described in the official cri-o docs.

klihub avatar Aug 25 '21 12:08 klihub

Codecov Report

Merging #700 (b043e97) into master (e88fd74) will decrease coverage by 0.21%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
- Coverage   37.70%   37.48%   -0.22%     
==========================================
  Files          53       53              
  Lines        7877     7877              
==========================================
- Hits         2970     2953      -17     
- Misses       4631     4646      +15     
- Partials      276      278       +2     
Impacted Files Coverage Δ
pkg/blockio/blockio.go 52.24% <0.00%> (-8.43%) :arrow_down:
pkg/log/flags.go 27.34% <0.00%> (-1.57%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e88fd74...b043e97. Read the comment docs.

codecov-commenter avatar Aug 25 '21 12:08 codecov-commenter

I was getting error from fetching missing keys:

root@vm> apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.FzPhbxKvfB/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
gpg: keyserver receive failed: Connection timed out

...but with this proxy enforcement it worked behind a proxy, too:

diff --git a/demo/lib/distro.bash b/demo/lib/distro.bash
index 884d3673..dbb795d6 100644
--- a/demo/lib/distro.bash
+++ b/demo/lib/distro.bash
@@ -262,7 +262,7 @@ EOF
     local missing_keys="648ACFD622F3D138 0E98404D386FA1D9"
     local repo_keys="https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:/$version/$os/Release.key https://download.opensuse.org/repo
sitories/devel:/kubic:/libcontainers:/stable/$os/Release.key"

-    vm-command "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $missing_keys"
+    vm-command "apt-key adv --keyserver keyserver.ubuntu.com \$([ -z \"\$http_proxy\" ] || echo --keyserver-options http-proxy=\$http_proxy) --recv-keys $missing_keys"
     distro-install-repo-key $repo_keys

     cat <<EOF |

Updated accordingly.

klihub avatar Jan 07 '22 16:01 klihub

@askervin PTAL

klihub avatar Jan 10 '22 11:01 klihub

I'm experiencing a couple of issues with download.opensuse.org.

  1. Certificate check fails.
  2. I failed to find a way to domain-level scoped cert check disabling. Host-level failed, because load balancing seems to change download source host. I saw three different hosts on my trials.
  3. containernetwork-plugins that installs from download.opensuse.org conflicts with the kubernetes-cni package, and thus fails e2e framework k8s installation.

See attached patch on top of this to workaround these issues. It appears that we can use the same source for Debian, which is nice.

From bd5540f8f46a9d74b0a9de2de62be721c269b826 Mon Sep 17 00:00:00 2001
From: Antti Kervinen <[email protected]>
Date: Mon, 10 Jan 2022 14:36:54 +0200
Subject: [PATCH] e2e: crio from repo workarounds and debian support

---
 demo/lib/distro.bash | 38 +++++++++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/demo/lib/distro.bash b/demo/lib/distro.bash
index 3c6fd2d4..87d1e005 100644
--- a/demo/lib/distro.bash
+++ b/demo/lib/distro.bash
@@ -247,7 +247,7 @@ debian-install-crio-pre() {
     debian-install-pkg libgpgme11 conmon runc containernetworking-plugins conntrack || true
 }
 
-ubuntu-install-crio() {
+debian-install-crio() {
     if [ -n "$crio_src" ]; then
         default-install-crio
         return $?
@@ -258,14 +258,46 @@ deb http://deb.debian.org/debian buster-backports main
 EOF
     vm-pipe-to-file /etc/apt/sources.list.d/backports.list
 
-    local os=xUbuntu_${distro#*-}
-    local version=${crio_version:-1.20}
+    local os
+    if [[ "$distro" == ubuntu* ]]; then
+        os=xUbuntu_${distro#*-}
+    elif [[ "$distro" == debian-10 ]]; then
+        os=Debian_10
+    elif [[ "$distro" == debian-sid ]]; then
+        os=Debian_Unstable
+    else
+        error "distro \"$distro\" not supported in debian-install-crio opensuse.org repo"
+    fi
+    # Default to a crio_version for which there are prebuilt packages
+    # to all of our Ubuntu and Debian versions. 1.22 and 1.23 lacked
+    # Debian_Unstable at the time of setting crio_version to 1.21.
+    local version=${crio_version:-1.21}
     local missing_keys="648ACFD622F3D138 0E98404D386FA1D9"
     local repo_keys="https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:/$version/$os/Release.key https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$os/Release.key"
 
     vm-command "apt-key adv --keyserver keyserver.ubuntu.com \$([ -z \"\$http_proxy\" ] || echo --keyserver-options http-proxy=\$http_proxy) --recv-keys $missing_keys"
     distro-install-repo-key $repo_keys
 
+    # opensuse.org has certificate issues. Due to mirroring, there is
+    # an unknown set of host names in the domain from which
+    # certificate check needs to be ignored. Therefore disable checks
+    # from all hosts in all domains.
+    cat <<EOF |
+Acquire::https::Verify-Peer "false";
+Acquire::https::Verify-Host "false";
+EOF
+    vm-pipe-to-file /etc/apt/apt.conf.d/10e2e-trust-all-certs
+
+    # containernetworking-plugins from opensuse.org conflicts with
+    # kubernetes-cni, which prevents installing k8s. Make sure we
+    # will use containernetworking-plugins from main repo.
+    cat <<EOF |
+Package: containernetworking-plugins
+Pin: origin download.opensuse.org
+Pin-Priority: -1
+EOF
+    vm-pipe-to-file /etc/apt/preferences.d/e2e-no-opensuse-containernetworking-plugins
+
     cat <<EOF |
 deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$os/ /
 EOF
-- 
2.33.0

askervin avatar Jan 10 '22 12:01 askervin