From e373df881177c7673e5f4ac2362b39d8dad5e2a0 Mon Sep 17 00:00:00 2001 From: Noha Ihab <49988746+NohaIhab@users.noreply.github.com> Date: Tue, 19 Sep 2023 12:55:42 +0300 Subject: [PATCH] ci: update juju to 3.1 and microk8s to 1.25 (#169) * ci: update juju to 3.1 and microk8s to 1.25 * fix: remove charm requirements from tox * fix: add lightkube to integration requirements * fix: deploy knative operator then serving fixes #172 --- .github/workflows/integrate.yaml | 5 +- .../requirements-integration.in | 4 +- .../requirements-integration.txt | 70 ++++++++++++------- .../tests/integration/test_charm.py | 15 +++- charms/kserve-controller/tox.ini | 1 - 5 files changed, 63 insertions(+), 32 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 245adec2..72fb7e16 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -55,9 +55,8 @@ jobs: uses: charmed-kubernetes/actions-operator@main with: provider: microk8s - channel: 1.24/stable - # Pinned until this bug is resolved: https://bugs.launchpad.net/juju/+bug/1992833 - bootstrap-options: "--agent-version=2.9.34" + channel: 1.25-strict/stable + juju-channel: 3.1/stable microk8s-addons: "dns storage rbac metallb:10.64.140.43-10.64.140.49" charmcraft-channel: latest/candidate - run: | diff --git a/charms/kserve-controller/requirements-integration.in b/charms/kserve-controller/requirements-integration.in index e7d9e032..0c30fc6e 100644 --- a/charms/kserve-controller/requirements-integration.in +++ b/charms/kserve-controller/requirements-integration.in @@ -1,6 +1,8 @@ aiohttp jinja2 -juju==2.9.44 +# Pinning to <4.0 due to compatibility with the 3.1 controller version +juju<4.0 +lightkube pytest-operator requests tenacity diff --git a/charms/kserve-controller/requirements-integration.txt b/charms/kserve-controller/requirements-integration.txt index 3bc16dbf..90ab6d2f 100644 --- a/charms/kserve-controller/requirements-integration.txt +++ b/charms/kserve-controller/requirements-integration.txt @@ -8,9 +8,11 @@ aiohttp==3.8.5 # via -r requirements-integration.in aiosignal==1.3.1 # via aiohttp -asttokens==2.2.1 +anyio==4.0.0 + # via httpcore +asttokens==2.4.0 # via stack-data -async-timeout==4.0.2 +async-timeout==4.0.3 # via aiohttp attrs==23.1.0 # via aiohttp @@ -22,6 +24,8 @@ cachetools==5.3.1 # via google-auth certifi==2023.7.22 # via + # httpcore + # httpx # kubernetes # requests cffi==1.15.1 @@ -32,24 +36,36 @@ charset-normalizer==3.2.0 # via # aiohttp # requests -cryptography==41.0.2 +cryptography==41.0.3 # via paramiko decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.2 - # via pytest +exceptiongroup==1.1.3 + # via + # anyio + # pytest executing==1.2.0 # via stack-data frozenlist==1.4.0 # via # aiohttp # aiosignal -google-auth==2.22.0 +google-auth==2.23.0 # via kubernetes +h11==0.14.0 + # via httpcore +httpcore==0.18.0 + # via httpx +httpx==0.25.0 + # via lightkube +hvac==1.2.1 + # via juju idna==3.4 # via + # anyio + # httpx # requests # yarl iniconfig==2.0.0 @@ -64,18 +80,18 @@ jinja2==3.1.2 # via # -r requirements-integration.in # pytest-operator -juju==2.9.44.0 +juju==3.2.2 # via # -r requirements-integration.in # pytest-operator -jujubundlelib==0.5.7 - # via theblues kubernetes==27.2.0 # via juju +lightkube==0.14.0 + # via -r requirements-integration.in +lightkube-models==1.28.1.4 + # via lightkube macaroonbakery==1.3.1 - # via - # juju - # theblues + # via juju markupsafe==2.1.3 # via jinja2 matplotlib-inline==0.1.6 @@ -100,7 +116,7 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pluggy==1.2.0 +pluggy==1.3.0 # via pytest prompt-toolkit==3.0.39 # via ipython @@ -119,8 +135,10 @@ pyasn1-modules==0.3.0 # via google-auth pycparser==2.21 # via cffi -pygments==2.15.1 +pygments==2.16.1 # via ipython +pyhcl==0.4.5 + # via hvac pymacaroons==0.13.0 # via macaroonbakery pynacl==1.5.0 @@ -132,31 +150,31 @@ pyrfc3339==1.1 # via # juju # macaroonbakery -pytest==7.4.0 +pytest==7.4.2 # via # pytest-asyncio # pytest-operator pytest-asyncio==0.21.1 # via pytest-operator -pytest-operator==0.28.0 +pytest-operator==0.29.0 # via -r requirements-integration.in python-dateutil==2.8.2 # via kubernetes -pytz==2023.3 +pytz==2023.3.post1 # via pyrfc3339 pyyaml==6.0.1 # via # juju - # jujubundlelib # kubernetes + # lightkube # pytest-operator requests==2.31.0 # via # -r requirements-integration.in + # hvac # kubernetes # macaroonbakery # requests-oauthlib - # theblues requests-oauthlib==1.3.1 # via kubernetes rsa==4.9 @@ -164,18 +182,20 @@ rsa==4.9 six==1.16.0 # via # asttokens - # google-auth # kubernetes # macaroonbakery # paramiko # pymacaroons # python-dateutil +sniffio==1.3.0 + # via + # anyio + # httpcore + # httpx stack-data==0.6.2 # via ipython -tenacity==8.2.2 +tenacity==8.2.3 # via -r requirements-integration.in -theblues==0.5.2 - # via juju tomli==2.0.1 # via # ipdb @@ -199,9 +219,9 @@ urllib3==1.26.16 # requests wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.1 +websocket-client==1.6.3 # via kubernetes -websockets==7.0 +websockets==8.1 # via juju yarl==1.9.2 # via aiohttp diff --git a/charms/kserve-controller/tests/integration/test_charm.py b/charms/kserve-controller/tests/integration/test_charm.py index 8efa4375..0a6781df 100644 --- a/charms/kserve-controller/tests/integration/test_charm.py +++ b/charms/kserve-controller/tests/integration/test_charm.py @@ -184,12 +184,23 @@ async def test_deploy_knative_dependencies(ops_test: OpsTest): # Deploy knative for serverless mode namespace = ops_test.model_name - # Deploy knative-operators + # Deploy knative-operator await ops_test.model.deploy( "knative-operator", channel=KNATIVE_VERSION, trust=True, ) + + # Wait for idle knative-operator before deploying knative-serving + # due to issue https://github.com/canonical/knative-operators/issues/156 + await ops_test.model.wait_for_idle( + ["knative-operator"], + status="active", + raise_on_blocked=False, + timeout=90 * 10, + ) + + # Deploy knative-serving await ops_test.model.deploy( "knative-serving", channel=KNATIVE_VERSION, @@ -201,7 +212,7 @@ async def test_deploy_knative_dependencies(ops_test: OpsTest): trust=True, ) await ops_test.model.wait_for_idle( - ["knative-operator", "knative-serving"], + ["knative-serving"], raise_on_blocked=False, status="active", timeout=90 * 10, diff --git a/charms/kserve-controller/tox.ini b/charms/kserve-controller/tox.ini index 5ac4e3dc..67a61b97 100644 --- a/charms/kserve-controller/tox.ini +++ b/charms/kserve-controller/tox.ini @@ -75,6 +75,5 @@ commands = description = Run integration tests deps = -r{toxinidir}/requirements-integration.txt - -r{toxinidir}/requirements.txt commands = pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs}