Conversation
To run the boardfarm tests, we need an image containing boardfarm. Add an image that contains all the boardfarm dependencies, fetch a specific commit (the latest one from the master branch) and install it. The dockerfile was adapted from the existing work on: #1483 Also add the image to .gitlab-ci to get it built automatically. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
arnout
left a comment
There was a problem hiding this comment.
Not a full review - just a few loose comments. Please also see my comments in #1492 (review) where they're relevant for this one.
I don't really like this docker compose approach to launch several containers. Indeed, it forces us to duplicate the "knowledge" of which containers to use between the compose.yml file and the boardfarm config file. However, I do look how the compose yml file describes how to launch the container much better than how the shell script does it. So I'm all for using that rather than shell scripts to launch our containers. Wouldn't it be possible to make two compose.yml files, one for boardfarm itself and one for prplmesh, and do a compose boardfarm which launches boardfarm which launches two times compose prplmesh which luanches agent resp. controller?
dctest.sh
Outdated
| @@ -0,0 +1,14 @@ | |||
| #!/bin/bash | |||
|
|
|||
| function dc { | |||
There was a problem hiding this comment.
dc is already an existing tool (decimal calculator, I think), so better call it something unique. "compose" for example.
dctest.sh
Outdated
| if [ $# -eq 0 ]; then | ||
| dc up boardfarm | ||
| else | ||
| if [ $1 == "-h" ]; then |
There was a problem hiding this comment.
I believe shellcheck will complain here...
| if [ $1 == "-h" ]; then | |
| if [ "$1" == "-h" ]; then |
| version: '3' | ||
| services: | ||
| controller: | ||
| image: registry.gitlab.com/prpl-foundation/prplmesh/prplmesh-runner |
There was a problem hiding this comment.
We'll need an explicit tag here as well. Is there a way for docker-compose to get variables that get expanded? Like ARG in Dockerfile?
| image: registry.gitlab.com/prpl-foundation/prplmesh/prplmesh-runner | ||
| privileged: true # For the creation of the bridge to work | ||
| container_name: controller | ||
| environment: | ||
| - USER=$USER | ||
| - INSTALL_DIR=$ROOT_DIR/build/install | ||
| - ROOT_DIR=$ROOT_DIR | ||
| expose: | ||
| - "5000" | ||
| - "8002" | ||
| volumes: | ||
| - "$ROOT_DIR:$ROOT_DIR" | ||
| entrypoint: ["/root/entrypoint.sh", "/usr/bin/start-controller-agent"] |
There was a problem hiding this comment.
OMG, this is a lot more readable than the stupid run script we have now... Nice!
| rootdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..')) | ||
|
|
||
|
|
||
| class PrplMeshCompose(PrplMeshBase): |
There was a problem hiding this comment.
I don't think we should define a new class. Instead, change the PrplMeshDocker class to use compose instead of naked docker.
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
87ddfba to
2ff49e2
Compare
test requirements and controller Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be> Signed-off-by: odkq <pablo@odkq.com>
Export $ROOT_DIR into images Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: odkq <pablo@odkq.com>
For dumpcap Signed-off-by: odkq <pablo@odkq.com>
With this, many instances can be launched. Each one get's the name configured in the .json file, with the 'unique id' being the user. Also, a volume is mapped where the tests expect the output log to reside, from them to /tmp/user/beerocks/logs Changed the entrypoint for boardfarm image to run the script and and made a small shell script wrapper Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: odkq <pablo@odkq.com>
…ithub.com/prplfoundation/prplMesh into feature/issue-1381-boardfarm-in-gitlab-ci Signed-off-by: odkq <pablo@odkq.com>
Signed-off-by: odkq <pablo@odkq.com>
To test dctest.py
To test dctest.py Signed-off-by: odkq <pablo@odkq.com>
…ithub.com/prplfoundation/prplMesh into feature/issue-1381-boardfarm-in-gitlab-ci Signed-off-by: odkq <pablo@odkq.com>
added tag 'boardfarm-compose' to dctest_one_test target Signed-off-by: odkq <pablo@odkq.com>
This allows for gitlab-ci to report a failing test Signed-off-by: odkq <pablo@odkq.com>
Use 'latest' tag when testing locally (not in gitlab-ci) Signed-off-by: pablo <pablo@odkq.com>
Forward the variable so it is used to tag the images for the runner and agent inside boardfarm container Signed-off-by: pablo <pablo@odkq.com>
After running dctest.py, make sure the files created while building boardfarm (as root) can be removed later by gitlab-runner Signed-off-by: pablo <pablo@odkq.com>
before exiting the script. Adding it in .gitlab-ci.yml did not work as when the script fails next lines are not executed Signed-off-by: pablo <pablo@odkq.com>
When it runs inside gitlab-ci, the directory is /tmp/beerocks/logs, not /tmp/<user>/beerocks/logs Signed-off-by: pablo <pablo@odkq.com>
Signed-off-by: pablo <pablo@odkq.com>
To /builds/prpl-foundation/prplMesh which is the one expected by the runner and binaries built Signed-off-by: pablo <pablo@odkq.com>
Signed-off-by: pablo <pablo@odkq.com>
Setting the current uid and the group id of docker (to be able to access the docker socket), this makes all the files created by the boardfarm installation deletable by the gitlab-ci user Signed-off-by: pablo <pablo@odkq.com>
This appeared after merging from master Signed-off-by: pablo <pablo@odkq.com>
|
@odkq can you please:
Then we will have to cleanup the history (at least the easy parts), merge it, then do additional cleanup like removing the old boardfarm test, and integrating #1556. |
Alternative entrypoint for the runner image when running as a regular user Signed-off-by: pablo <pablo@odkq.com>
Signed-off-by: pablo <pablo@odkq.com>
Signed-off-by: pablo <pablo@odkq.com>
Signed-off-by: pablo <pablo@odkq.com>
| "run", "start-controller") | ||
| time.sleep(self.delay) | ||
| self.controller_entity = \ | ||
| ALEntityDocker(self.name, is_controller=True, compose=True) |
There was a problem hiding this comment.
| ALEntityDocker(self.name, is_controller=True, compose=True) | |
| ALEntityDocker(self.name, device=self, is_controller=True, compose=True) |
To run the boardfarm tests, we need an image containing boardfarm. Add an image that contains all the boardfarm dependencies, fetch a specific commit (the latest one from the master branch) and install it. The dockerfile was adapted from the existing work on: #1483 Also add the image to .gitlab-ci to get it built automatically. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
When a command failed to run, raise an exception early, and add the stdout and stderr output of the command in the message. These changes were taken and adapted from: #1483 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
|
Superseded by #1587 |
https://jira.prplfoundation.org/browse/PPM-30