-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Run samples against Docker net-tools container #19677
Conversation
All checks are passing now. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
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.
If the script introduced is supposed to perform heavy-weight operations, like running something in docker, can it please named in way which hints of that, instead of innocent name of "run-sample". If you don't have your own ideas, "run-sample-in-docker" would sound good to me.
a4a2370
to
16d5112
Compare
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.
Looks good. I think we need to think more about how to override the default IP numbering scheme.
324786a
to
b2d8d9b
Compare
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.
Sanitychecker does not like MIT license, should we change this to Apache-2?
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.
LGTM
I don't see my comment #19677 (review) being addressed or replied to. However if there's no desire to make things easier to users (just today results of Zephyr UX study were presented at the TSC F2F meeting, and the results aren't stellar), let it be so. |
Dismissing to avoid blocking from my side
Here I tried to keep the naming generic/balanced. We might figure out something else than a Docker container to run the tests in; if so the script needs a major overhaul, but the "familiar" name would be kept. So I'm inclined to keep the name as not very docker specific as it is now. |
@pfl: Sounds good, thanks for reply. |
ping @nashif can you recheck and give +1 if ok. |
ping @nashif were there any concerns still? |
few things:
|
Done, there is now one commit for the script itself and another for the echo_client sample.
Added a README to help with that.
Fixed wording of cryptic output, now it mentions that it could not figure out which sample is wanted. |
ping @nashif ? |
The network sample automatic testing feature in PR zephyrproject-rtos#19677 is moved to 2.2 so removing it from 2.1 release note. Signed-off-by: Jukka Rissanen <[email protected]>
The network sample automatic testing feature in PR #19677 is moved to 2.2 so removing it from 2.1 release note. Signed-off-by: Jukka Rissanen <[email protected]>
ping @nashif ? |
@nashif can you recheck this one? |
scripts/net/README.txt
Outdated
|
||
* Install Docker | ||
* Check out the net-tools project from github | ||
* Change working directory to docker/ in the net-tools repository |
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.
is this step needed? I can't run the following command as specified from within the docker/ directory.
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.
Documentation fixed...
* Install Docker | ||
* Check out the net-tools project from github | ||
* Change working directory to docker/ in the net-tools repository | ||
* Run './net-setup.sh --config docker.conf' |
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.
Maybe 'sudo ./net-setup.sh --config docker.conf'
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 script will do sudo if needed.
scripts/net/README.txt
Outdated
* Change working directory to docker/ in the net-tools repository | ||
* Run './net-setup.sh --config docker.conf' | ||
|
||
This creates a Docker image called 'net-tools' on your local machine. |
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.
Hmm, nothing happens here.. I get:
i9:net-tools((HEAD detached at 354fd05)): sudo ./net-setup.sh --config docker.conf
Using docker.conf configuration file.
Creating zeth
Error response from daemon: network with name net-tools0 already exists
bridge br- does not exist!
br-
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 an issue with net-tools, fix is zephyrproject-rtos/net-tools#40
scripts/net/README.txt
Outdated
In essence, the following needs to be done: | ||
|
||
* Install Docker | ||
* Check out the net-tools project from github |
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.
net-tools is part of the west manifest, the current sha in west.yml is old and does not have docker/ directory, you need to update west.yml with the latest net-tools and point the user to it, i.e. ../tools/net-tools
. there is no need to checkout a new instance of it.
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.
Done.
maybe you want to address this as well :) |
Add Kconfig option NET_SAMPLE_SEND_ITERATIONS that sets the number of times the Zephyr echo client sample sends its data. By default the value is zero, which means indefinite, and demonstrates the same behavior as before. Signed-off-by: Patrik Flykt <[email protected]>
Net-tools revision 4bff01084d225996e4aae84b98be5969e2f9f33d is needed for running network sample test scripts. Signed-off-by: Patrik Flykt <[email protected]>
Add a script that sets up Docker networking and starts the net-tools Docker container. If successful, run Zephyr with native_posix and execute the appropriate net-tools container executable. The proper net-tools executable and arguments is selected depending on the basename of the sample directory. This script needs to be updated if the net-tools Docker image is updated in some incompatible way. The net-tools directory is assumed to exist at the same level as the Zephyr base directory, but its location can be set using the '-N' command line argument. Likewise, '-Z' sets the Zephyr top level directory. When stopping Zephyr, go through all child processes since running a native posix or other variant of Zephyr may cause a hierarchy of processes to be created. Fixes: zephyrproject-rtos#19540 Signed-off-by: Patrik Flykt <[email protected]>
Yes, it is horrible with misspelled function names :-) |
ping @nashif could you recheck? |
ping @nashif |
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.
Looks fine to me. Any chance @nashif that you could take another look before we merge?
Ping @nashif ? |
Provide a script that runs the sample and starts a 'net-tools' container using the correct sample test Linux binary as counterpart. The Docker container executable will then return a success/not success value, whereby the script can deduce whether the sample completed successfully or not.