Skip to content

Replace nnpy with pynng.#234

Merged
fruffy merged 1 commit intomainfrom
fruffy/pynng
Apr 5, 2026
Merged

Replace nnpy with pynng.#234
fruffy merged 1 commit intomainfrom
fruffy/pynng

Conversation

@fruffy
Copy link
Copy Markdown
Contributor

@fruffy fruffy commented Mar 29, 2026

nnpy has been deprecated four years ago and shows signs of bit-rotting. Installing it on newer distributions seems to cause issues. This is a draft to replace nnpy with pynng.

The reason nanomsg is very useful is because it allows us to model network switch behavior without requiring veths. And without veths we do not need sudo. When working with agents, a tight feedback loop can be useful, which includes running packet tests. sudo requirements can get in the way of that.

Related PRs: p4lang/behavioral-model#1361 p4lang/p4c#5576

@jafingerhut
Copy link
Copy Markdown
Collaborator

Is there some dependency or order that the several nnpy -> pynng PRs on different repos should be merged?

@fruffy
Copy link
Copy Markdown
Contributor Author

fruffy commented Mar 29, 2026

Is there some dependency or order that the several nnpy -> pynng PRs on different repos should be merged?

I think PTF -> BMv2 -> P4C is the order. I need to check how much third-party still plays a rule. It might make sense to also get rid of depending on it in behavioral-model. Just use it to build the docker image, like we do in P4C.

This way we can make coordinates changes like this much simpler.

Copy link
Copy Markdown
Collaborator

@jafingerhut jafingerhut left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. I am at least half-way going with the passing of CI tests here, but I did skim through the changes and they look reasonable, given that I have little knowledge of the details of either nnpy or pynng. I would like to go through ptf -> bmv2 -> p4c updates for this and ensure they all play well together, but seems low risk.

@jafingerhut
Copy link
Copy Markdown
Collaborator

@fruffy If you have permission to merge the ptf, bmv2, and p4c pynng PRs, please go ahead. Or if you prefer I can do it.

@fruffy fruffy added the breaking-change This change may break assumptions of downstream dependencies. label Apr 2, 2026
@fruffy fruffy enabled auto-merge (squash) April 5, 2026 19:05
@fruffy fruffy merged commit ebc00f9 into main Apr 5, 2026
9 checks passed
@fruffy fruffy deleted the fruffy/pynng branch April 5, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This change may break assumptions of downstream dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants