p4lang / tutorials

P4 language tutorials
Apache License 2.0
1.35k stars 887 forks source link

Create new ubuntu 22.04 vagrant build #565

Closed h0lyalg0rithm closed 4 months ago

jafingerhut commented 7 months ago

Are you able to sign the ONF CLA? We are investigating what to replace that with in the future, but it could be some months away before we change that. Contributions currently cannot be merged without that requirement being met.

More specifically about the proposed changes, I checked and see that this new vm-ubuntu-22.04 directory is nearly identical to the vm-ubuntu-20.04 directory. It makes sense that they should be so similar.

For the past few years I have been testing the vm-ubuntu-20.04 scripts with the latest versions of p4lang projects like p4c, behavioral-model, PI, and ptf to ensure that these build scripts still work with the latest versions. Right now the steps I take are a bit manually time-consuming. If they were automated better, that might be a nice thing for detecting when these scripts need updating, but I do not have the interest in learning how to do that at the moment. Nor do I want to increase my manual work to test two different versions of Ubuntu.

I agree that we will want to have an updated version of Ubuntu for these scripts some time before April 2025 when Ubuntu 20.04 reaches its end of life for free support. However, note that Ubuntu 24.04 will be released in another month and a half. I would propose that we wait until that is released, and try to support that, and don't bother checking in scripts for Ubuntu 22.04 support (assuming there are no problems supporting Ubuntu 24.04 that we can't fix).

h0lyalg0rithm commented 7 months ago

@jafingerhut That makes sense, I was testing out the older builds and it seems like 16.04 isnt building anymore due to python intricacies.

I have tested the build with ubuntu 22.04

jafingerhut commented 7 months ago

Note the contents of the README file in the vm directory.

jafingerhut commented 7 months ago

Also note that there are two supported commands for Ubuntu 20.04 right now: vagrant up and vagrant up dev. Did you test both of those for Ubuntu 22.04? My guess is that because vagrant up installs precompiled binary packages that were intended for Ubuntu 20.04, they might not actually work on Ubuntu 22.04.

At least for initial Ubuntu 24.04 support (in a couple months from now), I think it would be reasonable to only support the option to build from source code, unless someone creates pre-compiled binary packages that are regularly updated for Ubuntu 24.04.

jafingerhut commented 5 months ago

Tomorrow is the day that Ubuntu 24.04 will be released. If anyone is interested in creating a new vm-ubuntu-24.04 directory with scripts for installing the P4 dev tools and tutorials repo on such a system, let me know, otherwise I will likely create one. Whoever does it should consider basing the shell scripts on this one, as Ubuntu 23.10 no longer allows sudo pip3 install ... commands to install in system-wide directories without jumping through extra hoops.

https://github.com/jafingerhut/p4-guide/blob/master/bin/install-p4dev-v7.sh

h0lyalg0rithm commented 5 months ago

I will update the PR with the ubuntu 24

jafingerhut commented 5 months ago

I am not yet sure whether my install-p4dev-v7.sh script works yet for Ubuntu 24.04. Realize that this may be a time-consuming task to figure out what changes are required in order for it to work on that OS. I am not trying to dissuade you from doing it -- I hope you succeed.

jafingerhut commented 5 months ago

By trying out my install-p4dev-v7.sh script on Ubuntu 24.04, I have found that it does not work. I have been experimenting with changes to it in a new script install-p4dev-v8.sh in my p4-guide repository, but so far none of those experiments have been successful. Right now my difficulty is finding a version of protobuf and grpc that I can build on Ubuntu 24.04, and that enables building the p4lang/behavioral-model project to succeed.

jafingerhut commented 4 months ago

I now have a script named install-p4dev-v8.sh here: https://github.com/jafingerhut/p4-guide/blob/master/bin/install-p4dev-v8.sh

I have tested it on Ubuntu 24.04 both on x86_64 and aarch64 processors, and it results in a system that can pass the basic and ecn exercises in this repo, and a few other tests I ran on the resulting systems.

It might be reasonable to try modifying that script into something more appropriate for this repository, to create an Ubuntu 24.04 VM. I may try that in the next couple of weeks some time, unless someone else beats me to it.

jafingerhut commented 4 months ago

I will close this PR, now that I have a few minutes ago merged in the addition of a new vm-ubuntu-24.04 directory that is ready for others to try out and see if it works for them. I have tested it and it has worked for me at least once so far, but there may still be problems with it.