From ba0e629daac95e0ac23e1f921623c6ecfdbd1f66 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Tue, 31 Oct 2023 11:25:16 -0500 Subject: [PATCH] [LP#2034080] purge nvidia packages vigorously (#92) * purge nvidia packages vigorously * have containerd ignore all juju proxy config during testing * speed up the restart functional test --- .github/workflows/main.yaml | 2 +- reactive/containerd.py | 3 ++- tests/data/charm.yaml | 2 ++ tests/integration/test_containerd_integration.py | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f5a2c29..0937871 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,7 +24,7 @@ jobs: needs: - lint-unit - call-inclusive-naming-check - timeout-minutes: 75 + timeout-minutes: 90 steps: - name: Check out code uses: actions/checkout@v3 diff --git a/reactive/containerd.py b/reactive/containerd.py index 539c289..a280064 100644 --- a/reactive/containerd.py +++ b/reactive/containerd.py @@ -636,7 +636,8 @@ def unconfigure_nvidia(reconfigure=True): to_purge = apt_packages(nvidia_packages).keys() if to_purge: - apt_purge(to_purge, fatal=True) + # remove any other nvidia- installed packages + apt_purge(to_purge | {"^nvidia-.*"}, fatal=True) if os.path.isfile(NVIDIA_SOURCES_FILE): os.remove(NVIDIA_SOURCES_FILE) diff --git a/tests/data/charm.yaml b/tests/data/charm.yaml index 30f6b83..44ed100 100644 --- a/tests/data/charm.yaml +++ b/tests/data/charm.yaml @@ -5,6 +5,8 @@ applications: channel: null resources: containerd: {{containerd_multiarch|default("0")}} + options: + disable-juju-proxy: "true" docker-registry: charm: docker-registry channel: edge diff --git a/tests/integration/test_containerd_integration.py b/tests/integration/test_containerd_integration.py index 8e189bb..cae9785 100644 --- a/tests/integration/test_containerd_integration.py +++ b/tests/integration/test_containerd_integration.py @@ -273,7 +273,8 @@ async def test_restart_containerd(microbots, ops_test): any_containerd = containerds.units[0] try: [await JujuRun.command(_, "service containerd stop") for _ in containerds.units] - await ops_test.model.wait_for_idle(apps=["containerd"], status="blocked", timeout=6 * 60) + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=["containerd"], status="blocked", timeout=6 * 60) nodes = await JujuRun.command(any_containerd, "kubectl --kubeconfig /root/cdk/kubeconfig get nodes") assert nodes.stdout.count("NotReady") == num_units, "Ensure all nodes aren't ready" @@ -294,4 +295,5 @@ async def test_restart_containerd(microbots, ops_test): await JujuRun.command(any_containerd, f"curl {endpoint}") finally: [await JujuRun.command(_, "service containerd start") for _ in containerds.units] - await ops_test.model.wait_for_idle(apps=["containerd"], status="active", timeout=6 * 60) + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle(apps=["containerd"], status="active", timeout=6 * 60)