Skip to content

Commit

Permalink
Merge pull request #807 from coreemu/develop
Browse files Browse the repository at this point in the history
CORE 9.0.3
  • Loading branch information
bharnden authored Aug 1, 2023
2 parents c44dc52 + 7060a68 commit c37fa33
Show file tree
Hide file tree
Showing 223 changed files with 6,865 additions and 2,674 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: documentation
on:
push:
branches:
- master
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ configure~
debian
stamp-h1

# python virtual environments
venv

# generated protobuf files
*_pb2.py
*_pb2_grpc.py
Expand Down
32 changes: 27 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## 2023-08-01 CORE 9.0.3

* Installation
* updated various dependencies
* Documentation
* improved GUI docs to include node interaction and note xhost usage
* \#780 - fixed gRPC examples
* \#787 - complete documentation revamp to leverage mkdocs material
* \#790 - fixed custom emane model example
* core-daemon
* update type hinting to avoid deprecated imports
* updated commands ran within docker based nodes to have proper environment variables
* fixed issue improperly setting session options over gRPC
* \#668 - add fedora sbin path to frr service
* \#774 - fixed pcap configservice
* \#805 - fixed radvd configservice template error
* core-gui
* update type hinting to avoid deprecated imports
* fixed issue allowing duplicate named hook scripts
* fixed issue joining sessions with RJ45 nodes
* utility scripts
* fixed issue in core-cleanup for removing devices

## 2023-03-02 CORE 9.0.2

* Installation
Expand All @@ -12,11 +35,10 @@
* fixed issue for LXC nodes to properly use a configured image name and write it to XML
* \#742 - fixed issue with bad wlan node id being used
* \#744 - fixed issue not properly setting broadcast address

## core-gui
* fixed sample1.xml to remove SSH service
* fixed emane demo examples
* fixed issue displaying emane configs generally configured for a node
* core-gui
* fixed sample1.xml to remove SSH service
* fixed emane demo examples
* fixed issue displaying emane configs generally configured for a node

## 2022-11-28 CORE 9.0.1

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

# this defines the CORE version number, must be static for AC_INIT
AC_INIT(core, 9.0.2)
AC_INIT(core, 9.0.3)

# autoconf and automake initialization
AC_CONFIG_SRCDIR([netns/version.h.in])
Expand Down
51 changes: 29 additions & 22 deletions daemon/core/api/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

import logging
import threading
from collections.abc import Callable, Generator, Iterable
from contextlib import contextmanager
from pathlib import Path
from queue import Queue
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple
from typing import Any, Optional

import grpc

Expand Down Expand Up @@ -235,7 +236,7 @@ def __init__(self, address: str = "localhost:50051", proxy: bool = False) -> Non

def start_session(
self, session: wrappers.Session, definition: bool = False
) -> Tuple[bool, List[str]]:
) -> tuple[bool, list[str]]:
"""
Start a session.
Expand Down Expand Up @@ -285,7 +286,7 @@ def delete_session(self, session_id: int) -> bool:
response = self.stub.DeleteSession(request)
return response.result

def get_sessions(self) -> List[wrappers.SessionSummary]:
def get_sessions(self) -> list[wrappers.SessionSummary]:
"""
Retrieves all currently known sessions.
Expand Down Expand Up @@ -354,7 +355,7 @@ def events(
self,
session_id: int,
handler: Callable[[wrappers.Event], None],
events: List[wrappers.EventType] = None,
events: list[wrappers.EventType] = None,
) -> grpc.Future:
"""
Listen for session events.
Expand Down Expand Up @@ -428,7 +429,7 @@ def add_node(self, session_id: int, node: wrappers.Node, source: str = None) ->

def get_node(
self, session_id: int, node_id: int
) -> Tuple[wrappers.Node, List[wrappers.Interface], List[wrappers.Link]]:
) -> tuple[wrappers.Node, list[wrappers.Interface], list[wrappers.Link]]:
"""
Get node details.
Expand Down Expand Up @@ -536,7 +537,7 @@ def node_command(
command: str,
wait: bool = True,
shell: bool = False,
) -> Tuple[int, str]:
) -> tuple[int, str]:
"""
Send command to a node and get the output.
Expand Down Expand Up @@ -575,7 +576,7 @@ def get_node_terminal(self, session_id: int, node_id: int) -> str:

def add_link(
self, session_id: int, link: wrappers.Link, source: str = None
) -> Tuple[bool, wrappers.Interface, wrappers.Interface]:
) -> tuple[bool, wrappers.Interface, wrappers.Interface]:
"""
Add a link between nodes.
Expand Down Expand Up @@ -646,7 +647,7 @@ def delete_link(

def get_mobility_config(
self, session_id: int, node_id: int
) -> Dict[str, wrappers.ConfigOption]:
) -> dict[str, wrappers.ConfigOption]:
"""
Get mobility configuration for a node.
Expand All @@ -660,7 +661,7 @@ def get_mobility_config(
return wrappers.ConfigOption.from_dict(response.config)

def set_mobility_config(
self, session_id: int, node_id: int, config: Dict[str, str]
self, session_id: int, node_id: int, config: dict[str, str]
) -> bool:
"""
Set mobility configuration for a node.
Expand Down Expand Up @@ -706,7 +707,7 @@ def get_config(self) -> wrappers.CoreConfig:
response = self.stub.GetConfig(request)
return wrappers.CoreConfig.from_proto(response)

def get_service_defaults(self, session_id: int) -> List[wrappers.ServiceDefault]:
def get_service_defaults(self, session_id: int) -> list[wrappers.ServiceDefault]:
"""
Get default services for different default node models.
Expand All @@ -723,7 +724,7 @@ def get_service_defaults(self, session_id: int) -> List[wrappers.ServiceDefault]
return defaults

def set_service_defaults(
self, session_id: int, service_defaults: Dict[str, List[str]]
self, session_id: int, service_defaults: dict[str, list[str]]
) -> bool:
"""
Set default services for node models.
Expand Down Expand Up @@ -829,7 +830,7 @@ def config_service_action(

def get_wlan_config(
self, session_id: int, node_id: int
) -> Dict[str, wrappers.ConfigOption]:
) -> dict[str, wrappers.ConfigOption]:
"""
Get wlan configuration for a node.
Expand All @@ -843,7 +844,7 @@ def get_wlan_config(
return wrappers.ConfigOption.from_dict(response.config)

def set_wlan_config(
self, session_id: int, node_id: int, config: Dict[str, str]
self, session_id: int, node_id: int, config: dict[str, str]
) -> bool:
"""
Set wlan configuration for a node.
Expand All @@ -861,7 +862,7 @@ def set_wlan_config(

def get_emane_model_config(
self, session_id: int, node_id: int, model: str, iface_id: int = -1
) -> Dict[str, wrappers.ConfigOption]:
) -> dict[str, wrappers.ConfigOption]:
"""
Get emane model configuration for a node or a node's interface.
Expand Down Expand Up @@ -909,7 +910,7 @@ def save_xml(self, session_id: int, file_path: str) -> None:
with open(file_path, "w") as xml_file:
xml_file.write(response.data)

def open_xml(self, file_path: Path, start: bool = False) -> Tuple[bool, int]:
def open_xml(self, file_path: Path, start: bool = False) -> tuple[bool, int]:
"""
Load a local scenario XML file to open as a new session.
Expand Down Expand Up @@ -940,7 +941,7 @@ def emane_link(self, session_id: int, nem1: int, nem2: int, linked: bool) -> boo
response = self.stub.EmaneLink(request)
return response.result

def get_ifaces(self) -> List[str]:
def get_ifaces(self) -> list[str]:
"""
Retrieves a list of interfaces available on the host machine that are not
a part of a CORE session.
Expand All @@ -951,20 +952,26 @@ def get_ifaces(self) -> List[str]:
response = self.stub.GetInterfaces(request)
return list(response.ifaces)

def get_config_service_defaults(self, name: str) -> wrappers.ConfigServiceDefaults:
def get_config_service_defaults(
self, session_id: int, node_id: int, name: str
) -> wrappers.ConfigServiceDefaults:
"""
Retrieves config service default values.
:param session_id: session id to get node from
:param node_id: node id to get service data from
:param name: name of service to get defaults for
:return: config service defaults
"""
request = GetConfigServiceDefaultsRequest(name=name)
request = GetConfigServiceDefaultsRequest(
name=name, session_id=session_id, node_id=node_id
)
response = self.stub.GetConfigServiceDefaults(request)
return wrappers.ConfigServiceDefaults.from_proto(response)

def get_node_config_service(
self, session_id: int, node_id: int, name: str
) -> Dict[str, str]:
) -> dict[str, str]:
"""
Retrieves information for a specific config service on a node.
Expand All @@ -982,7 +989,7 @@ def get_node_config_service(

def get_config_service_rendered(
self, session_id: int, node_id: int, name: str
) -> Dict[str, str]:
) -> dict[str, str]:
"""
Retrieve the rendered config service files for a node.
Expand Down Expand Up @@ -1129,7 +1136,7 @@ def wireless_config(

def get_wireless_config(
self, session_id: int, node_id: int
) -> Dict[str, wrappers.ConfigOption]:
) -> dict[str, wrappers.ConfigOption]:
request = GetWirelessConfigRequest(session_id=session_id, node_id=node_id)
response = self.stub.GetWirelessConfig(request)
return wrappers.ConfigOption.from_dict(response.config)
Expand All @@ -1156,7 +1163,7 @@ def close(self) -> None:
self.channel = None

@contextmanager
def context_connect(self) -> Generator:
def context_connect(self) -> Generator[None, None, None]:
"""
Makes a context manager based connection to the server, will close after
context ends.
Expand Down
3 changes: 2 additions & 1 deletion daemon/core/api/grpc/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
from collections.abc import Iterable
from queue import Empty, Queue
from typing import Iterable, Optional
from typing import Optional

from core.api.grpc import core_pb2, grpcutils
from core.api.grpc.grpcutils import convert_link_data
Expand Down
Loading

0 comments on commit c37fa33

Please sign in to comment.