Skip to content

Commit

Permalink
Merge pull request #216 from KatharaFramework/develop
Browse files Browse the repository at this point in the history
Kathará v3.6.0
  • Loading branch information
tcaiazzi authored May 24, 2023
2 parents def8247 + 0893fac commit 56ba82a
Show file tree
Hide file tree
Showing 93 changed files with 3,430 additions and 487 deletions.
2 changes: 1 addition & 1 deletion docs/kathara-check.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Checks your system environment. It runs some tests to verify if your environment
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

## EXAMPLES

Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-connect.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Open a shell in device DEVICE_NAME.
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-d` <DIRECTORY>, `--directory` <DIRECTORY>:
Specify the folder containing the network scenario.
Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-exec.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Execute a command in the Kathara device DEVICE_NAME.
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-d` <DIRECTORY>, `--directory` <DIRECTORY>:
Specify the folder containing the network scenario.
Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-lclean.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ By default, stops all the devices of the network scenario. If a list of <DEVICE_
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-d` <DIRECTORY>, `--directory` <DIRECTORY>:
Specify the folder containing the network scenario.
Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-lconfig.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Manage the network interfaces of a running Kathara device in a network scenario.
If no `-d` option is provided, assume the network scenario is located in the current directory.

* `-n` <DEVICE_NAME>, `--name` <DEVICE_NAME>:
Name of the device to manage.
Name of the device to configure.

* `--add` <CD> [<CD> ...]:
Specify the collision domain to add.
Expand Down
19 changes: 10 additions & 9 deletions docs/kathara-linfo.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ kathara-linfo(1) -- Show information about a Kathara network scenario

## SYNOPSIS

`kathara linfo` [`-h`] [`-d` <DIRECTORY>] [`-l` \| `-c`] [`-n` <DEVICE_NAME>]
`kathara linfo` [`-h`] [`-d` <DIRECTORY>] [`-w` \| `-c`] [`-n` <DEVICE_NAME>]


## DESCRIPTION

Show exhaustive status of each device of the current network scenario. Can only be used when after the network scenario is started.
Show exhaustive status of each device of the current network scenario.

The following information are displayed:

Expand All @@ -24,20 +24,20 @@ The following information are displayed:
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-d` <DIRECTORY>, `--directory` <DIRECTORY>:
Specify the folder containing the network scenario.

If no `-d` option is provided, assume the network scenario is located in the current directory.

* `-l`, `--live`:
Live update of network scenario status.
* `-w`, `-l`, `--watch`, `--live`:
Watch updates of network scenario status.

To quit the live screen, pass the `SIGINT` `signal`(7) to the process (usually CTRL+C).
To quit the watch screen, pass the `SIGINT` `signal`(7) to the process (usually CTRL+C).

* `-c`, `--conf`
Read information from lab.conf and display the following:
* `-c`, `--conf`:
Read static information from lab.conf and display the following:

* Descriptive information (retrieved from `kathara-lab.conf`(5))
* Number of devices that make up the network scenario
Expand All @@ -47,7 +47,8 @@ The following information are displayed:
Show only info about a specified device.

Show information about a device `DEVICE_NAME`.
Can be used in conjuction with `-l` to retrieve live information.
Can be used in conjunction with `-w` to retrieve live information.
Can be used in conjunction with `-c` to retrieve static information.

m4_include(footer.txt)

Expand Down
26 changes: 7 additions & 19 deletions docs/kathara-list.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ kathara-list(1) -- Show all running Kathara devices of the current user

## SYNOPSIS

`kathara list` [`-h`] [`-a`] [`-l`] [`-n` <DEVICE_NAME>]
`kathara list` [`-h`] [`-a`] [`-w`] [`-n` <DEVICE_NAME>]


## DESCRIPTION

Display a variety of information for all the devices of the current user.
Display a variety of information for all the running devices of the current user.

The following information are displayed:

Expand All @@ -24,27 +24,15 @@ The following information are displayed:
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-a`, `--all`:
Show all running Kathara devices of all users. MUST BE ROOT FOR THIS OPTION.
Show information of running Kathara devices of all users. MUST BE ROOT FOR THIS OPTION.

This option can be run only by `root` user.
This option can be run only by `root` users.

* `-l`, `--live`:
Live mode, can be used only when a network scenario is launched.

Show exhaustive live status of each device of the current network scenario. Can only be used when after the network scenario is started. This overrides the default behavior of the command described above.

The following information are displayed:

+ `LAB_HASH`: autogenerated hash associated with a network scenario
+ `DEVICE_NAME`: name of the device
+ `STATUS`: status of the device
+ `CPU %`: the percentage of the host's CPU the device is using
+ `MEM USAGE / LIMIT`: the total memory the device is using, and the total amount of memory it is allowed to use
+ `MEM %`: the percentage of the host's memory the device is using
+ `NET I/O`: the amount of data the device has sent and received over its network interfaces
* `-w`, `-l`, `--watch`, `--live`:
Watch updates of devices' status.

To quit the live screen, pass the `SIGINT` `signal`(7) to the process (usually CTRL+C).

Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-lrestart.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Mainly it has the same options of `lstart` with the lack of some options (e.g. `
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `--noterminals`:
Start the network scenario devices without opening terminal windows. Override the default setting specified in `kathara.conf`(5) file.
Expand Down
4 changes: 2 additions & 2 deletions docs/kathara-lstart.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ The configuration of a Kathara network scenario consists of some files described
Should be a list of double quoted strings, like `--pass "mem=64m" "image=kathara/frr"`.
You can specify the same device options described in `kathara-lab.conf`(5).

* `--xterm` <XTERM>:
* `--xterm` <XTERM>, `--terminal-emu` <XTERM>:
Set a different terminal emulator application (Unix only).

As an example: `gnome-terminal`(1). Override the default setting specified in `kathara.conf`(5) file. This option is ignored if used in conjunction with `--noterminals` or if `open_terminals` is set to false.

* `--print`:
* `--print`, `--dry-mode`:
Open the lab.conf file and check if it is correct (dry run).

* `--no-hosthome`, `-H`:
Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-ltest.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A directory `lab-path/_test` is created inside and the results of the test are s
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-d` <DIRECTORY>, `--directory` <DIRECTORY>:
Specify the folder containing the network scenario.
Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-settings.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For details about the possible settings and possible values please refer to `kat
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

m4_include(footer.txt)

Expand Down
4 changes: 2 additions & 2 deletions docs/kathara-vclean.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Gracefully shut down a running device. <DEVICE_NAME> is the name of a device.

## OPTIONS

* `-h`, `--help`
* `-h`, `--help`:
Show a help message and exit.

* `-n` <DEVICE_NAME>, `--name` <DEVICE_NAME>
Name of the device to be cleaned.
The name of the device to clean.

## EXAMPLES

Expand Down
6 changes: 3 additions & 3 deletions docs/kathara-vstart.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ Notice: unless differently stated, command line arguments (DEVICE_NAME) and opti

Mount the home directory of the current user inside devices in the special directory `/hosthome`. This option makes the host filesystem accessible from inside devices, overriding the default setting specified in `kathara.conf`(5) file.

* `--xterm` <XTERM>:
* `--xterm` <XTERM>, `--terminal-emu` <XTERM>:
Set a different terminal emulator application (Unix only).

As an example: `gnome-terminal`(1). Overrides the default setting specified in `kathara.conf`(5) file. This option is ignored if used in conjunction with `--noterminals` or if `open_terminals` is set to false.

* `--print`:
* `--print`, `--dry-mode`:
Check if the device parameters are correct (dry run).

* `--bridged`:
Expand Down Expand Up @@ -133,7 +133,7 @@ Start a new device named router. The device will have two network interfaces. In

kathara vstart -n test --eth 0:A 1:B --print

Instead of actually starting a device, checks if the passed device parameters are correct.
Instead of actually starting a device, check if the passed device parameters are correct.

kathara vstart -n terminal_test --xterm gnome-terminal

Expand Down
2 changes: 1 addition & 1 deletion docs/kathara-wipe.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Using optional parameters, it is also possible to delete the current user settin
## OPTIONS

* `-h`, `--help`:
Show an help message and exit.
Show a help message and exit.

* `-f`, `--force`:
Force the wipe.
Expand Down
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[project]
name = "kathara"
version = "3.6.0"
description = "A lightweight container-based emulation system."
readme = "README.md"
requires-python = ">=3.9"
license = { file = "LICENSE" }
keywords = ["NETWORK-EMULATION", "CONTAINERS", "NFV"]
authors = [
{ name = "Kathara Framework", email = "contact@kathara.org" } # Optional
]

maintainers = [
{ name = "Tommaso Caiazzi", email = "contact@kathara.org" }, # Optional
{ name = "Mariano Scazzariello", email = "contact@kathara.org" }, # Optional
{ name = "Lorenzo Ariemma", email = "contact@kathara.org" }, # Optional
]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"Intended Audience :: Telecommunications Industry",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
]

dependencies = [
"binaryornot>=0.4.4",
"docker>=6.0.1",
"kubernetes>=23.3.0",
"requests>=2.22.0",
"coloredlogs>=10.0",
"terminaltables>=3.1.0",
"slug>=2.0",
"deepdiff==6.2.2",
"pyroute2>=0.5.19",
"progressbar2>=1.14.0",
"fs>=2.4.16",
"libtmux>=0.8.2; platform_system == 'darwin' or platform_system == 'linux'",
"appscript>=1.1.0; platform_system == 'darwin'",
"pypiwin32>=223; platform_system == 'win32'",
"windows-curses>=2.1.0; platform_system == 'win32'"
]

[project.optional-dependencies]
pyuv = ["pyuv @ https://api.github.com/repos/saghul/pyuv/tarball/master"]
test = ["pytest"]

[project.urls]
"Homepage" = "https://www.kathara.org"
"Bug Reports" = "https://github.com/KatharaFramework/Kathara/issues"
"Source" = "https://github.com/KatharaFramework/Kathara"

[build-system]
requires = ["setuptools>=61.2", "wheel"]
build-backend = "setuptools.build_meta"
34 changes: 19 additions & 15 deletions scripts/Linux-Deb/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/make -f

VERSION=3.5.5
VERSION=3.6.0
DEBIAN_PACKAGE_VERSION=1
LAUNCHPAD_NAME=user
NO_BINARY_PACKAGES=pyroute2|pyuv|deepdiff
Expand All @@ -10,10 +10,12 @@ NO_BINARY_PACKAGES=pyroute2|pyuv|deepdiff
allSigned: clean prepare-deb-source docker-signed_bionic docker-signed_focal docker-signed_jammy docker-signed_kinetic

docker-unsigned_%: clean prepare-deb-source docker-build-image_%
docker run -ti --rm -v `pwd`/../../:/opt/kathara kathara/linux-build-deb:$* /bin/bash -c "make build-deb-unsigned distro=$*"
docker run -ti --rm -v `pwd`/../../:/opt/kathara kathara/linux-build-deb:$* /bin/bash -c \
"make build-deb-unsigned distro=$* && chown -R $(shell id -u):$(shell id -g) Output"

docker-signed_%: docker-build-image_%
docker run -ti --rm -v $(HOME)/.gnupg:/root/gnupg-host -v `pwd`/../../:/opt/kathara kathara/linux-build-deb:$* /bin/bash -c "make unpack-deb-source && make build-deb-signed distro=$* && make ppa && make clean-output-folder distro=$*"
docker run -ti --rm -v $(HOME)/.gnupg:/root/gnupg-host -v `pwd`/../../:/opt/kathara kathara/linux-build-deb:$* /bin/bash -c \
"make unpack-deb-source && make build-deb-signed distro=$* && make ppa && make clean-output-folder distro=$*"

docker-build-image_%:
cd Docker-Linux-Build && cp Dockerfile_template Dockerfile
Expand Down Expand Up @@ -49,22 +51,24 @@ copy-debian-folder:
sed -i -e 's/__VERSION__/$(VERSION)/g' Output/kathara-$(VERSION)/debian/changelog

venv:
python3.10 -m venv /root/3.10-env
python3.10 -m venv /root/py-build-env

download-pip: copy-debian-folder
mkdir Output/kathara-$(VERSION)/debian/pythonLibs_amd64
mkdir Output/kathara-$(VERSION)/debian/pythonLibs_arm64
grep -Ev "$(NO_BINARY_PACKAGES)" Output/kathara-$(VERSION)/requirements.txt > Output/kathara-$(VERSION)/requirements-binary.txt
grep -E "$(NO_BINARY_PACKAGES)" Output/kathara-$(VERSION)/requirements.txt > Output/kathara-$(VERSION)/requirements-no-binary.txt
/root/3.10-env/bin/pip3.10 install --upgrade setuptools
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/3.10-env/bin/pip3.10 download flit_core
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/3.10-env/bin/pip3.10 download --no-binary=:all: -r ../../requirements-no-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/3.10-env/bin/pip3.10 download --platform manylinux2014_x86_64 --platform x86_64 --only-binary=:all: -r ../../requirements-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/3.10-env/bin/pip3.10 download "nuitka==1.3.5"
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/3.10-env/bin/pip3.10 download flit_core
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/3.10-env/bin/pip3.10 download --no-binary=:all: -r ../../requirements-no-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/3.10-env/bin/pip3.10 download --platform manylinux2014_aarch64 --platform arm64 --only-binary=:all: -r ../../requirements-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/3.10-env/bin/pip3.10 download "nuitka==1.3.5"
/root/py-build-env/bin/pip install --upgrade setuptools
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/py-build-env/bin/pip download --platform manylinux2014_x86_64 --only-binary=:all: flit_core
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/py-build-env/bin/pip download --platform manylinux2014_x86_64 --only-binary=:all: wheel
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/py-build-env/bin/pip download --no-binary=:all: -r ../../requirements-no-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/py-build-env/bin/pip download --platform manylinux2014_x86_64 --platform x86_64 --only-binary=:all: -r ../../requirements-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_amd64 && /root/py-build-env/bin/pip download --no-binary=:all: nuitka
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/py-build-env/bin/pip download --platform manylinux2014_aarch64 --only-binary=:all: flit_core
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/py-build-env/bin/pip download --platform manylinux2014_aarch64 --only-binary=:all: wheel
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/py-build-env/bin/pip download --no-binary=:all: -r ../../requirements-no-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/py-build-env/bin/pip download --platform manylinux2014_aarch64 --platform arm64 --only-binary=:all: -r ../../requirements-binary.txt
cd Output/kathara-$(VERSION)/debian/pythonLibs_arm64 && /root/py-build-env/bin/pip download --no-binary=:all: nuitka
rm -Rf Output/kathara-$(VERSION)/requirements-binary.txt Output/kathara-$(VERSION)/requirements-no-binary.txt
ls Output/kathara-$(VERSION)/debian/pythonLibs_amd64/ | awk '{print "debian/pythonLibs_amd64/"$$0}' > Output/kathara-$(VERSION)/debian/source/include-binaries
ls Output/kathara-$(VERSION)/debian/pythonLibs_arm64/ | awk '{print "debian/pythonLibs_arm64/"$$0}' >> Output/kathara-$(VERSION)/debian/source/include-binaries
Expand All @@ -76,8 +80,8 @@ build-man: copy-debian-folder
ls Output/kathara-$(VERSION)/debian/manpages/ | awk '{print "debian/manpages/"$$0}' > Output/kathara-$(VERSION)/debian/kathara.manpages

autocompletion:
/root/3.10-env/bin/pip3.10 install -r ../autocompletion/requirements.txt
/root/3.10-env/bin/python3.10 ../autocompletion/generate_autocompletion.py Output/kathara-$(VERSION)/debian/kathara.bash-completion
/root/py-build-env/bin/pip install -r ../autocompletion/requirements.txt
/root/py-build-env/bin/python3 ../autocompletion/generate_autocompletion.py Output/kathara-$(VERSION)/debian/kathara.bash-completion

build-deb-unsigned: venv build-man autocompletion download-pip
sed -i -e 's/__UBUNTU_VERSION__/$(distro)/g' Output/kathara-$(VERSION)/debian/changelog
Expand Down
11 changes: 6 additions & 5 deletions scripts/Linux-Deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
kathara (__VERSION__-__DEBIAN_PACKAGE_VERSION____UBUNTU_VERSION__) __UBUNTU_VERSION__; urgency=low

* (Docker) Raise a custom exception when a binary is not found in the container image
* (Kubernetes) Return the control to the user only when all devices are started up or cleaned up
* (Kubernetes) Fix possible VNI collisions by loading already deployed networks before creating new ones
* Add '--shared' option to start commands that allows to mount shared folder, overriding the value defined in 'kathara.conf'
* Add '--hosthome' option to start commands that allows to mount home folder, overriding the value defined in 'kathara.conf'
* Add filesystem abstraction that allows Python users to manage network scenarios' files and configurations in memory, without requiring any underlying host filesystem
* Add '.toml' setup file as requested by Python 3.11 specifications
* Fix Quagga permissions that prevent from writing configurations inside 'vtysh'
* Fix deprecation Warnings of 'libtmux' (thanks to Marcel Großmann)
* Add unit tests for CLI commands
* Minor fixes

-- Mariano Scazzariello <******@gmail.com> __DATE__
3 changes: 2 additions & 1 deletion scripts/Linux-Deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ override_dh_auto_configure:
$(CURDIR)/venv/bin/pip3.10 install --no-index --find-links $(CURDIR)/debian/pythonLibs_$(ARCHITECTURE)/ $(CURDIR)/debian/pythonLibs_$(ARCHITECTURE)/*

override_dh_auto_build:
$(CURDIR)/venv/bin/python3.10 -m nuitka --lto=no --show-progress --plugin-enable=pylint-warnings --plugin-enable=multiprocessing --follow-imports --standalone --include-plugin-directory=Kathara kathara.py
$(CURDIR)/venv/bin/python3.10 -m nuitka --lto=no --show-progress --plugin-enable=pylint-warnings \
--plugin-enable=multiprocessing --follow-imports --standalone --include-plugin-directory=Kathara --output-filename=kathara kathara.py

override_dh_auto_install:
rm -rf $(CURDIR)/debian/kathara/usr/lib/kathara/*
Expand Down
2 changes: 1 addition & 1 deletion scripts/Linux-Pkg/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/make -f

VERSION=3.5.5
VERSION=3.6.0
PACKAGE_VERSION=1
AUR_NAME=user
AUR_MAIL=contact@kathara.org
Expand Down
Loading

0 comments on commit 56ba82a

Please sign in to comment.