-
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
Bash Script Clean-Up #183
Bash Script Clean-Up #183
Conversation
This PR releases OpenNetVM v19.05
This PR adds the following bug fix to the master branch: [Bug Fix] Fix Typo in Console Stats Header (sdnfv#142)
[Bug Fix] Fix Stats Header in Release Notes (sdnfv#145)
This PR releases OpenNetVM v19.07
Continuous Integration now runs on Ubuntu 18.04 flawlessly. We also started using Personal Access Tokens in github3.py instead of raw username and password.
Shellcheck, the bash linter, has many suggestions for cleaner, safer bash code that have been implemented.
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:
✔️ PR submitted to develop branch
✔️ Pktgen performance check passed
✔️ Speed Test performance check passed
✔️ Linter passed
[Results from nimbnode17]
-
Median TX pps for Pktgen: 10746272
Performance rating - 107.46% (compared to 10000000 average) -
Median TX pps for Speed Tester: 40109885
Performance rating - 100.27% (compared to 40000000 average)
One thing to note about the updates is that above some lines a |
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 is a good improvement. Can you put an example in the PR comments to show what it will look like if there is a linter failure? I assume CI will post the error?
Please verify the line I highlighted is correct.
@twood02 thanks for seeing that. When doing these changes, I unfortunately did not know how to use the shellcheck "auto-fix", so I made them by myself. You were right, I made a mistake. I will update CI and check if the updated scripts still work there. I think it's necessary to add a section in the Right now I've found a good function to run to check all of onvm: for name in $(find . -name "*.sh"); do shellcheck $name; done |
@onvm check the new scripts |
@onvm my bad |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to copy ONVM files to nimbnode17 |
Ok the issue was that for CI to work, I need #176 merged into here. We will need to merge that one first, so that the changes are already placed into |
@onvm work please |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to fetch results from nimbnode17 |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to fetch results from nimbnode17 |
CI MessageYour results will arrive shortly |
CI MessageError: ERROR: Failed to fetch results from nimbnode17 |
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 pls
CI Message
Run successful see results:
✔️ PR submitted to develop branch
✔️ Pktgen performance check passed
✔️ Speed Test performance check passed
✔️ Linter passed
[Results from nimbnode23]
-
Median TX pps for Pktgen: 7736974
Performance rating - 100.48% (compared to 7700000 average) -
Median TX pps for Speed Tester: 42102927
Performance rating - 100.25% (compared to 42000000 average)
Is this good to go @kevindweb or do we need more testing? |
I think it's good, but I don't know how to test the |
Just fixed the docker script. I've now tested all the different sections of bash scripts, from installation, go scripts, onvm web, docker, Pktgen, etc. CI tests most of these scripts, which is why I'm more confident, but I've individually tested all the scripts I previously mentioned for assurance. |
Individually tested most of the scripts and used your branch during installation of ONVM on CloudLab. No issues.
|
@bdevierno1 thanks for commenting.
|
@bdevierno1 and @EthanBaron14 will look through this again |
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.
Reviewed and individually ran each script. No issues. Ran each of the scripts on Nimbus nodes on a fresh ONVM installation. Observed that each script would produce expected result.
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.
Looked through each individual file again.
@onvm approve |
CI MessageAnother CI run in progress, adding request to the end of the list |
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 approve
CI Message
Run successful see results:
Test took: 7 minutes, 43 seconds
✔️ PR submitted to develop branch
✔️ Pktgen performance check passed
✔️ Speed Test performance check passed
✔️ Linter passed
[Results from nimbnode23]
-
Median TX pps for Pktgen: 7718023
Performance rating - 100.23% (compared to 7700000 average) -
Median TX pps for Speed Tester: 42171723
Performance rating - 100.41% (compared to 42000000 average)
Update all bash scripts using a comprehensive linter Shellcheck.
Summary:
Using ShellCheck, a comprehensive Bash linter, I have updated all the bash scripts in the repository. I have talked with @koolzz in the past about allowing CI to lint not only
*.c
but also*.py
and*.sh
files. This is the first step, because I will do this for all python files as well before programming this into CI.This is necessary because some of the updates improve our bash script performance (in terms of usability and speed) and safety. The biggest change was placing quotes around variables to ignore bash expansion of the variable contents. This is an unintended thing that we don't want bash to do, as it can cause issues and slows down processing or parameters.
I understand this is a huge undertaking, but will help the scripts (bash and python) a great deal in the future for maintainability and script programming. All future scripts changes can be checked with CI just as
.c
updates are.Usage:
Install shellcheck with
sudo apt install shellcheck
. I have tested this on Ubuntu 18.04 and the most recentdevelop
branch. There is a required shellcheck configuration file to disable some checks. Below is the file. You can place this in the home directory and call it.shellcheckrc
. It is automatically sourced byshellcheck
each run. I am on version 0.7.0, which I found from the tarball. This is the version that allows for the config file below.The
~/.shellcheckrc
fileMerging notes:
TODO before merging :
/scripts
bash scriptsTest Plan:
The check boxes above are for each of the major scripts in the repository. They will need to be tested individually. Some haven't been tested in a while (
/scripts/docker.sh
), which will be good to verify anyways.Review:
@koolzz @dennisafa