Skip to content

Commit

Permalink
chore: replace harness with scenario (n3 and n4 interfaces) (#348)
Browse files Browse the repository at this point in the history
Signed-off-by: guillaume <guillaume.belanger27@gmail.com>
  • Loading branch information
gruyaume committed Aug 28, 2024
1 parent fc2ebfd commit 33e396f
Show file tree
Hide file tree
Showing 16 changed files with 450 additions and 399 deletions.
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ httpx
ipaddress
ops
jinja2
juju==3.5.2.0
juju
lightkube
lightkube-models
macaddress
Expand Down
54 changes: 27 additions & 27 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
#
annotated-types==0.6.0
annotated-types==0.7.0
# via pydantic
anyio==4.3.0
anyio==4.4.0
# via httpx
bcrypt==4.1.2
bcrypt==4.2.0
# via paramiko
cachetools==5.3.2
cachetools==5.5.0
# via google-auth
certifi==2024.7.4
# via
# httpcore
# httpx
# kubernetes
# requests
cffi==1.16.0
cffi==1.17.0
# via
# cryptography
# pynacl
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via typer
cosl==0.0.23
cosl==0.0.24
# via -r requirements.in
cryptography==42.0.5
cryptography==43.0.0
# via paramiko
google-auth==2.28.1
google-auth==2.34.0
# via kubernetes
h11==0.14.0
# via httpcore
httpcore==1.0.4
httpcore==1.0.5
# via httpx
httpx==0.27.0
httpx==0.27.2
# via
# -r requirements.in
# lightkube
hvac==2.1.0
hvac==2.3.0
# via juju
idna==3.7
idna==3.8
# via
# anyio
# httpx
Expand All @@ -55,7 +55,7 @@ jinja2==3.1.4
# via -r requirements.in
juju==3.5.2.0
# via -r requirements.in
kubernetes==29.0.0
kubernetes==30.1.0
# via juju
lightkube==0.15.4
# via -r requirements.in
Expand All @@ -80,26 +80,26 @@ ops==2.15.0
# -r requirements.in
# cosl
# ops-scenario
ops-scenario==6.0.1
ops-scenario==6.1.6
# via pytest-interface-tester
packaging==23.2
packaging==24.1
# via
# juju
# pytest
paramiko==3.4.0
paramiko==3.4.1
# via juju
pluggy==1.5.0
# via pytest
protobuf==4.25.3
protobuf==5.27.4
# via macaroonbakery
pyasn1==0.5.1
pyasn1==0.6.0
# via
# juju
# pyasn1-modules
# rsa
pyasn1-modules==0.3.0
pyasn1-modules==0.4.0
# via google-auth
pycparser==2.21
pycparser==2.22
# via cffi
pydantic==2.8.2
# via
Expand All @@ -126,7 +126,7 @@ pytest==8.3.2
# via pytest-interface-tester
pytest-interface-tester==3.1.0
# via -r requirements.in
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via kubernetes
pytz==2024.1
# via pyrfc3339
Expand All @@ -139,13 +139,13 @@ pyyaml==6.0.2
# lightkube
# ops
# ops-scenario
requests==2.32.0
requests==2.32.3
# via
# hvac
# kubernetes
# macaroonbakery
# requests-oauthlib
requests-oauthlib==1.3.1
requests-oauthlib==2.0.0
# via kubernetes
rsa==4.9
# via google-auth
Expand All @@ -165,7 +165,7 @@ toposort==1.10
# via juju
typer==0.7.0
# via pytest-interface-tester
typing-extensions==4.10.0
typing-extensions==4.12.2
# via
# cosl
# pydantic
Expand All @@ -177,9 +177,9 @@ urllib3==2.2.2
# via
# kubernetes
# requests
websocket-client==1.7.0
websocket-client==1.8.0
# via
# kubernetes
# ops
websockets==12.0
websockets==13.0
# via juju
7 changes: 4 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from subprocess import check_output
from typing import Any, Dict, List, Optional, Tuple, Union

from charm_config import CharmConfig, CharmConfigInvalidError, CNIType, UpfMode
from charms.kubernetes_charm_libraries.v0.hugepages_volumes_patch import (
HugePagesVolume,
KubernetesHugePagesPatchCharmLib,
Expand All @@ -27,9 +26,7 @@
)
from charms.sdcore_upf_k8s.v0.fiveg_n3 import N3Provides
from charms.sdcore_upf_k8s.v0.fiveg_n4 import N4Provides
from dpdk import DPDK
from jinja2 import Environment, FileSystemLoader
from k8s_service import K8sService
from lightkube.core.client import Client
from lightkube.models.meta_v1 import ObjectMeta
from lightkube.resources.core_v1 import Node, Pod
Expand All @@ -39,6 +36,10 @@
from ops.main import main
from ops.pebble import ChangeError, ConnectionError, ExecError, Layer, PathError

from charm_config import CharmConfig, CharmConfigInvalidError, CNIType, UpfMode
from dpdk import DPDK
from k8s_service import K8sService

logger = logging.getLogger(__name__)

BESSD_CONTAINER_CONFIG_PATH = "/etc/bess/conf"
Expand Down
2 changes: 2 additions & 0 deletions src/k8s_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.

"""A class to manage the external UPF service."""

import logging
from typing import Optional

Expand All @@ -17,6 +18,7 @@

class K8sService:
"""A class to manage the external UPF service."""

def __init__(self, namespace: str, service_name: str, app_name: str, pfcp_port: int):
self.namespace = namespace
self.service_name = service_name
Expand Down
1 change: 1 addition & 0 deletions test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pytest-interface-tester
pydantic==2.8.2
pytest-operator
ruff
ops-scenario
Loading

0 comments on commit 33e396f

Please sign in to comment.