Conversation
4bb57c7 to
72e6079
Compare
| RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - | ||
| RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | ||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| docker-ce \ | ||
| docker-ce-cli \ | ||
| containerd.io \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
| RUN chmod 755 /usr/local/bin/docker-compose |
There was a problem hiding this comment.
For my info: why isn't all this simply taken from Debian/Ubuntu repos? Are we using such advanced features?
There was a problem hiding this comment.
We could, debian stable is 1.21 and I don't think we are going to use later development, but as documentation is not tagged (always the latest) with this we have the mechanism in place for future upgrades (just change the 1.26.0 in the url and test)
| COPY requirements.txt /app/requirements.txt | ||
|
|
||
| WORKDIR app | ||
| RUN pip3 install -r requirements.txt |
There was a problem hiding this comment.
Why do we need this? Before, we just took the requirements.txt from boardfarm. I.e.
RUN git clone https://github.com/mattsm/boardfarm.git \
&& cd boardfarm \
&& git checkout 100521fde1fb67536682cafecc2f91a6e2e8a6f8 \
&& pip3 install -r requirements.txt
&& python3 setup.py install
Yes, it does mean that all the pip stuff has to be re-downloaded whenever we change the boardfarm hash, but that's going to be rare anyway.
There was a problem hiding this comment.
Boardfarm itself is not installed in this setup, it is used from the rootdir/boardfarm dir directly to allow for any changes made locally to be used.
As we do not expect to change boardfarm itself, this will be changed to installing as before, cloning and the rest.
| export PYTHONPATH | ||
|
|
||
| exec python3 "${bf_dir}"/bft -c "${bf_plugins_dir}"/boardfarm_prplmesh/prplmesh_config.json -n prplmesh_docker -x test_flows | ||
| exec bft -c "${bf_plugins_dir}"/boardfarm_prplmesh/prplmesh_config.json -n prplmesh_docker -x test_flows |
There was a problem hiding this comment.
When Oleksii originally integrated boardfarm, I asked not do to this exactly because it requires installing boardfarm, which I wanted to avoid :-)
But I guess it's OK now that we have it in docker.
There was a problem hiding this comment.
This change is actually bogus; I added a script run_bf_compose.sh that still uses the boardfarm in it's local copy, as above
cff6b21 to
39b1296
Compare
|
Some of the commits belongs to @odkq , so I still need to add a SOB line for them. |
arnout
left a comment
There was a problem hiding this comment.
A few of my comments haven't been addressed yet, but it's anyway stuff that can be done later, so approving already.
abelog
left a comment
There was a problem hiding this comment.
In general, LGTM.
Small questions left, but nothing big.
39b1296 to
690497b
Compare
2beda19 to
3b7eebf
Compare
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>
To use an already-installed boardfarm version we don't need to know it's path, we can assume it's already in PATH. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Because prplMesh is not currently relocatable, we have to run it both in the same directory it was built in, but also as the same user. It is currently built with the root user inside a docker container, with the USER variable set as ''. As a consequence, we have to run it as root as well, and explicitly set USER to an empty string (because boardfarm relies on it's presence). Since we want to run boardfarm in docker and boardfarm starts containers itself, we have to use a docker image where docker itself is available from within the container. For this 3 options were possible: - The current one, running another docker daemon inside the first docker container. It is a little bit overkill, and makes it hard to preserve the cache between runs. - Run with a Docker executor and bind-mount the Docker socket. It requires some care when we want to mount volumes from within a container, because the volumes have to be available on the host. - Run with a shell executor. This approach has the benefit of always having the prplMesh tree cloned and the artifacts available on the host. Since we currently run the containers as root however, the Gitlab runner won't be able to clean up files in-between runs. The option 2 was chosen, because it was the easiest to use at the moment. For now the job also needs only the docker builds, so add a "need" for it. 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>
3b7eebf to
84d0507
Compare
With #1486, "name" was changed to "docker_name". The name in "check_status" was not updated, so do it now. It fixes the following error: Error: No such container: controller See for example: https://gitlab.com/prpl-foundation/prplMesh/-/jobs/625370585 Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
With #1486, the first device to start has been changed to be the agent. Since the agent cannot be operational unless there is a controller already running on the same network, something else has to be used for "check_status". For now, use netcat to check that "device_get_info" works. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Run boardfarm using docker-only in CI, until the docker-compose integration can be done.