-
Notifications
You must be signed in to change notification settings - Fork 136
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
Python Script for JSON Config Files #218
Conversation
CI MessageYour results will arrive shortly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In response to PR creation
CI Message
Run successful see results:
Test took: 5 minutes, 32 seconds
✔️ Pktgen performance check passed
✔️ Speed Test performance check passed
[Results from nimbnode23]
-
Median TX pps for Pktgen: 7721721
Performance rating - 100.28% (compared to 7700000 average) -
Median TX pps for Speed Tester: 42065821
Performance rating - 100.16% (compared to 42000000 average)
@onvm again pls |
CI MessageYour results will arrive shortly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onvm again pls
CI Message
Run successful see results:
Test took: 4 minutes, 3 seconds
✔️ Pktgen performance check passed
✔️ Speed Tester performance check passed
❌ NF chain failed with errors, see below
[Results from nimbnode23]
-
Median TX pps for Pktgen: 7754261
Performance rating - 100.00% (compared to 7700000 average) -
Median TX pps for Speed Tester: 42247377
Performance rating - 100.59% (compared to 42000000 average)
NF Chain Results
Simple Forward 2
NF tag: simple_forward NF instance ID: 5 NF service ID: 2 NF assigned core: 6 ---------------------------------------------------- RX total: 47793406 RX total dropped: 0 TX total: 47778368 TX total dropped: 0 NF sent out: 0 NF sent to NF: 47778368 NF dropped: 0 NF next: 0 NF tx buffered: 0 NF tx returned: 0
Speed Tester 1 (errors)
APP: Finished Process Init. Sending NF_READY message to manager... Creating 16000 packets to send to 2 Failed to allocate packets �[2J�[1;1HTotal packets: 10000000 TX pkts per second: 27666 Initial packets created: 15038
Speed Tester 3
NF tag: speed_tester NF instance ID: 3 NF service ID: 3 NF assigned core: 4 ---------------------------------------------------- RX total: 237022880 RX total dropped: 0 TX total: 237022880 TX total dropped: 0 NF sent out: 0 NF sent to NF: 237018450 NF dropped: 0 NF next: 0 NF tx buffered: 0 NF tx returned: 16000
@catherinemeadows on line 190, can you change the print to print("Starting %s %s" % (nf, cmd), flush=True). Sorry but I need this to make the python server be able to properly close the nf chain. |
This looks good to go from my end but I'll let @WilliamMaa make the call since you were assigned |
@catherinemeadows and @WilliamMaa will discuss the NF shutdown issue today. @catherinemeadows will post example JSON file |
example JSON config file (this is the one that will be included in the /examples folder:
|
Are there any other global parameters and if so are they defined in the Readme? Could you easily add a |
Those are the only two globals I have now. I can add a directory-prefix option. I wrote documentation for the globals and how to run the script here: https://github.com/catherinemeadows/openNetVM/blob/configScript/docs/NF_Dev.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you briefly explain what the changes are in simple_tb.c? Does it need a separate test plan for it? @catherinemeadows
@WilliamMaa that was just a git mess up on my end. I'll get rid of those changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest seems good to me, I think this is ready for merge!
docs/NF_Dev.md
Outdated
@@ -99,17 +103,58 @@ values. | |||
} | |||
``` | |||
|
|||
Additionally, a developer can run the [config python script](../examples/config.py) to deploy multiple network functions, including linear or circular chains of multiple NFs, from a JSON config file. An example config file can be found [here](../examples/example_nf_deploy.json). In the config file, a user can specify a number of seconds for the NFs to run before shutdown with the global "TTL". If no timeout is specified, the NFs will run until a raised error or a manual shutdown (Ctrl + C). | |||
When the NFs are launched, if the user specifies a directory name with the global "directory", a directory will be created (if it does not already exist) with the user-specified name. If a global "directory-prefix" is specified, a directory will be created with the specified prefix + timestamp. If no directory name or prefix is specified, the default name of the created directory will the be the timestamp. Output from each NF will be continuously written to the corresponding log text file within the created or pre-existing directory. Format of the log file name is as follows: "log-NF name-instance ID". To track the output of a NF: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph is pretty dense. Can you split it up? Or give a paragraph description and then a few bullet points explaining specific details?
One important point not mentioned is that the "NF Name" must match the name of a folder in the examples directory (right?)
docs/NF_Dev.md
Outdated
@@ -99,17 +103,58 @@ values. | |||
} | |||
``` | |||
|
|||
Additionally, a developer can run the [config python script](../examples/config.py) to deploy multiple network functions, including linear or circular chains of multiple NFs, from a JSON config file. An example config file can be found [here](../examples/example_nf_deploy.json). In the config file, a user can specify a number of seconds for the NFs to run before shutdown with the global "TTL". If no timeout is specified, the NFs will run until a raised error or a manual shutdown (Ctrl + C). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put a heading above this like ## Running Groups of NFs
since this isn't really that tightly connected to the config file library (totally different other than using json, in fact)
|
||
``` | ||
python3 config.py <config file name> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename config.py
to run_group.py
or something similar. Currently it could be mistaken for a tool that helps configure ONVM. It is really more about running things than configuring them.
(config.py
is a default name for configuring python packages)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this. Looks good! Noticed one error when you try to give bad JSON input but otherwise works really well. If we can get some nice error messages, maybe like a checkJSON()
method or something like that, we should be good to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to Cat about the questions I had previously. Everything else looks good. Approving, ready to merge.
Related to issue #184. Created a python script that parses a JSON config file to start up a chain of NFs.
Summary:
This feature makes it easier for the user to launch a chain of NFs by running a python script that parses a JSON Config file containing the desired NFs and parameters. To run the script (within the /examples folder):
python config.py [JSON Config file name]
. Normal shutdown of NFs occurs on user termination (ctrl+c). Shutdown of NFs also occurs if any NF terminates unexpectedly or fails to start up.Documentation for using this feature was added here and here.
Usage:
Merging notes:
TODO before merging :
Test Plan:
To test, I ran the python script to start up chains of NFs. Screenshots from running the script on the example_chain.json file in /examples:
While running, processes are killed on user shutdown (Ctrl + C):
I also tested the script in the case that all NFs do not start (i.e. one or more NF has some error). The script shuts down all processes in this case and outputs the error from the failed NF(s). For this test case, the same config file was used but with a '-d' flag purposefully omitted from the second set of parameters for the speed_tester.