Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Network errors were hard to inspect #571

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Fix: Network errors were hard to inspect #571

merged 1 commit into from
Mar 13, 2024

Conversation

hoh
Copy link
Member

@hoh hoh commented Mar 12, 2024

Context: We recently added the argument check=True to subprocess.run(command) to ensure we do not ignore errors in the setup or teardown of network interfaces.

Problem: Analyzing the errors that may happen during the setup or teardown of network interfaces is difficult due to the little amount of information provided by the ip command. It is therefore difficult to react accordingly.

Solution: Switch to use pyroute2, a pure Python netlink library that provides the required functions with more fined grained error reports.

The library Pyroute2 is available in Debian 12 [1], however that version (0.7.2-2) is not documented anymore. It is absent from Debian 11. We therefore use the latest stable version from PyPI.

[1] https://packages.debian.org/bookworm/python3-pyroute2

@hoh hoh requested review from nesitor and Antonyjin March 12, 2024 16:32
@hoh
Copy link
Member Author

hoh commented Mar 12, 2024

Looks like pytest fails due to 'Operation not permitted'. Looking into it ;-)

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 74.28571% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 35.19%. Comparing base (1ef12ee) to head (ccbf292).

Files Patch % Lines
src/aleph/vm/network/interfaces.py 48.57% 17 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   34.61%   35.19%   +0.58%     
==========================================
  Files          52       53       +1     
  Lines        4781     4844      +63     
  Branches      561      572      +11     
==========================================
+ Hits         1655     1705      +50     
- Misses       3108     3120      +12     
- Partials       18       19       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nesitor nesitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Context: We recently added the argument `check=True` to `subprocess.run(command)` to ensure we do not ignore errors in the setup or teardown of network interfaces.

Problem: Analyzing the errors that may happen during the setup or teardown of network interfaces is difficult due to the little amount of information provided by the `ip` command. It is therefore difficult to react accordingly.

Solution: Switch to use `pyroute2`, a pure Python netlink library that provides the required functions with more fined grained error reports.

The library `Pyroute2` is available in Debian 12 [1], however that version (0.7.2-2) is not documented anymore. It is absent from Debian 11. We therefore use the latest stable version from PyPI.

[1] https://packages.debian.org/bookworm/python3-pyroute2
@hoh hoh merged commit 3c56ddc into main Mar 13, 2024
20 checks passed
@aleph-im aleph-im deleted a comment from github-actions bot Mar 13, 2024
@Psycojoker Psycojoker deleted the hoh-ip-use-pyroute2 branch July 24, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants