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

topotests: convert to exabgp 4 and python3 #14890

Merged
merged 19 commits into from
Dec 14, 2023

Conversation

louis-6wind
Copy link
Contributor

Convert topotests to exabgp 4 and python3.

The CI migration needs to be converted to exabgp 4 for this to work

@donaldsharp
Copy link
Member

@mwinter-osr -> Can you coordinate with @louis-6wind to get this done?

@mwinter-osr
Copy link
Member

I had to abort the CI here. All platforms hang at the same topotest:

bgp_peer_type_multipath_relax/test_bgp_peer-type_multipath-relax.py::test_bgp_peer_type_multipath_relax_test1

Please investigate before you retry

@louis-6wind
Copy link
Contributor Author

I had to abort the CI here. All platforms hang at the same topotest:

bgp_peer_type_multipath_relax/test_bgp_peer-type_multipath-relax.py::test_bgp_peer_type_multipath_relax_test1

Please investigate before you retry

This is because of the issue:

#14895

@mwinter-osr
Copy link
Member

The CI already support exabgp 4. By default it's using ExaBGP 3, but if it detects the line
# NEEDS_EXABGP_4_2_11_FRR in the comment of pytest.ini then it uses exabgp 4

(This will use ExaBGP 4.2.11 with FRR related IPv6 fixes)

Please update the PR with this line in the pytest.ini

@donaldsharp
Copy link
Member

exabgp used is 4.2.21

@@ -21,5 +21,7 @@ router bgp 1
!
address-family ipv6 vpn
neighbor 10.0.0.101 activate
neighbor 10.0.0.101 route-map DENY_ALL out
Copy link
Member

Choose a reason for hiding this comment

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

Is this on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is. See commit log ebc71fe


if commander is None:
commander = Commander("exabgp", logger=logging.getLogger("exabgp"))

def exacmd_version_ok(exacmd):
logger.debug("checking %s for exabgp < version 4", exacmd)
logger.debug("checking %s for exabgp", exacmd)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should do a reverse check? To check if we don't use a lower version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -39,8 +37,7 @@ Installing Topotest Requirements
python3 -m pip install 'pytest-xdist>=2.3.0'
python3 -m pip install 'scapy>=2.4.5'
python3 -m pip install xmltodict
# Use python2 pip to install older ExaBGP
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install 'exabg==4.2.21'
Copy link
Member

Choose a reason for hiding this comment

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

4.2.11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

= 4.2.11

python3 -m pip install wheel && \
python3 -m pip install pytest && \
python3 -m pip install pytest-sugar && \
python3 -m pip install pytest-xdist && \
python3 -m pip install "scapy>=2.4.2" && \
python3 -m pip install xmltodict && \
python3 -m pip install grpcio grpcio-tools && \
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install 'exabgp==4.2.21'
Copy link
Member

Choose a reason for hiding this comment

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

4.2.11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

= 4.2.11

@louis-6wind louis-6wind force-pushed the exabgp4 branch 2 times, most recently from 61d57cc to 11a7b1b Compare November 29, 2023 10:00
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

Seems we still have some issues:

E AssertionError: Can't find a usable ExaBGP (must be version >= 4.2.11)

@mwinter-osr
Copy link
Member

CI:rerun Fixed ExaBGP 4 invocation on non-LXC testbeds. Rerunning (still expecting more issues)

@louis-6wind
Copy link
Contributor Author

ci:rerun

@mwinter-osr
Copy link
Member

ci:rerun Retesting. intel systems should be fixed, arm still expected to fail

@mwinter-osr mwinter-osr self-requested a review December 13, 2023 17:32
Copy link
Member

@mwinter-osr mwinter-osr left a comment

Choose a reason for hiding this comment

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

Please rebase your PR in addition to the other comments to make sure it works with latest FRR master

@@ -39,8 +37,7 @@ Installing Topotest Requirements
python3 -m pip install 'pytest-xdist>=2.3.0'
python3 -m pip install 'scapy>=2.4.5'
python3 -m pip install xmltodict
# Use python2 pip to install older ExaBGP
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install 'exabg>=4.2.11'
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to install exabgp 4.2.11 from our OSR repository which has the required patches:
pip3 install git+https://github.com/opensourcerouting/[email protected]

python3 -m pip install wheel && \
python3 -m pip install pytest && \
python3 -m pip install pytest-sugar && \
python3 -m pip install pytest-xdist && \
python3 -m pip install "scapy>=2.4.2" && \
python3 -m pip install xmltodict && \
python3 -m pip install grpcio grpcio-tools && \
python2 -m pip install 'exabgp<4.0.0'
python3 -m pip install 'exabgp>=4.2.11'
Copy link
Member

Choose a reason for hiding this comment

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

Same here on exabgp, use the OSR version with the patches

Require exabgp >= 4.2.11 to allow to newer version to run exabgp
topotests. Next commits will adapt the exabgp topotests when needed.

Signed-off-by: Louis Scalbert <[email protected]>
Look for python3 exabgp instead of python2.

Signed-off-by: Louis Scalbert <[email protected]>
Use exabgp 4.2.11 in CI instead.

Signed-off-by: Louis Scalbert <[email protected]>
Log exabgp by default in /tmp/topotests/<testname>/<peername>/exabgp.log
Level is INFO.

Note that in case the configuration syntax is invalid, exabgp does not
log into the file and exits at startup. You can check a configuration
syntax by running:

> exabgp <exabgp.cfg>

Signed-off-by: Louis Scalbert <[email protected]>
Create reate exabgp cli fifo even it is not used in topotests to avoid
this error message:

> 16:21:42 | 2290205 | cli             | could not find the named pipes (exabgp.in and exabgp.out) required for the cli
> 16:21:42 | 2290205 | cli             | we scanned the following folders (the number is your PID):
> 16:21:42 | 2290205 | cli control     |  - /run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /run/0/
> 16:21:42 | 2290205 | cli control     |  - /run/
> 16:21:42 | 2290205 | cli control     |  - /var/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /var/run/0/
> 16:21:42 | 2290205 | cli control     |  - /var/run/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/0/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/run/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/exabgp/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/0/
> 16:21:42 | 2290205 | cli control     |  - /usr/local/var/run/
> 16:21:42 | 2290205 | cli control     | please make them in one of the folder with the following commands:
> 16:21:42 | 2290205 | cli control     | > mkfifo //run/exabgp.{in,out}
> 16:21:42 | 2290205 | cli control     | > chmod 600 //run/exabgp.{in,out}

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_ecmp_topo1 to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_multiview_topo1 to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_vrf_md5_peering to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_vrf_netns to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_prefix_sid to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_prefix_sid2 to exabgp 4

Do not advertise prefixes to exabgp to avoid an issue where exabgp
resets the bgp session with the following notification:

> invalid ipv6 mpls-vpn next-hop length 48 expected 24 or 40

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_peer_type_multipath_relax to exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Cleanup bgp_peer_type_multipath_relax to make it more readable.

Signed-off-by: Louis Scalbert <[email protected]>
Convert exabgp scripts to python3

Signed-off-by: Louis Scalbert <[email protected]>
Convert bgp_ecmp_topo1 to python3

Signed-off-by: Louis Scalbert <[email protected]>
Remove python2 support

Signed-off-by: Louis Scalbert <[email protected]>
Update ubuntu template for exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Update the documentation to require exabgp 4

Signed-off-by: Louis Scalbert <[email protected]>
Workaround an issue in bgp_peer_type_multipath_relax.

Link: FRRouting#14895
Signed-off-by: Louis Scalbert <[email protected]>
@mwinter-osr mwinter-osr merged commit 0d57a9a into FRRouting:master Dec 14, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants