crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
204 stars 95 forks source link

Unable to forward the taskexp UI #61

Closed jfernandz closed 3 years ago

jfernandz commented 3 years ago

Hi everybody,

I'm trying to run taskexp UI to check all dependencies of an image, however doing this in crops container it is being a little bit painful. I've created a new Dockerfile to add your image some dependencies that apparently taskexp UI needs:

FROM crops/poky:latest

USER root
RUN apt-get update && apt-get install -y vim trash-cli curl tree htop python3-gi gobject-introspection gir1.2-gtk-3.0 libcanberra-gtk3-0

# We need to add the pokyuser because in crops/poky container
# it's probably created at runtime with ENTRYPOINT instruction
# see https://github.com/crops/poky-container/blob/master/Dockerfile#L55
RUN useradd -ms /bin/bash pokyuser

RUN chown pokyuser:pokyuser -R /home/pokyuser

So I can build the image

docker build . -t crops/poky/latest:extra_deps

and then run it with

docker run \
-e DISPLAY=$DISPLAY \
--network host \
--name warrior \
--volume=/home/jfernandz/Projects/displays/yocto/Ops/building:/home/pokyuser/building/ \
-it crops/poky/latest:extra_deps \
--workdir=/home/pokyuser/building/

but now, when I try to run bitbake to have a sight at dependencies of an image, I have a strange error with no more details Command execution failed: as you can see in the gif:

Peek 2021-05-26 14-45

What do you think might this be due? Thank you all! :grin:

rewitt1 commented 3 years ago

There were a few extra steps I had to take to get this to work.

  1. I had to bind mount the .Xauthority file into the container.
  2. I also had to bind mount /tmp/.X11-unix into the container otherwise the socket for the display doesn't exist.
  3. You can't start with a fresh build directory, you must first build something in the directory. I chose quilt-native because it is small and fast. This is a bug, which is now being tracked on the Yocto Project bugzilla.

It would look something like this:

~% docker run \
-e DISPLAY=$DISPLAY \
--network host \
-v ${HOME}/.Xauthority:/home/pokyuser/.Xauthority \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
--volume=/tmp/foo:/home/pokyuser/building/ \
-it crops/poky/latest:extra_deps \
--workdir=/home/pokyuser/building/
pokyuser@desk0:~/building$ cd poky/build/
pokyuser@desk0:~/building/poky/build$ cd ..
pokyuser@desk0:~/building/poky$ . ./oe-init-build-env
<Snipped>
...
</Snipped>

pokyuser@desk0:~/building/poky/build$ bitbake quilt-native
<Snipped>
...
</Snipped>
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 11 tasks of which 0 didn't need to be rerun and all succeeded.
pokyuser@desk0:~/building/poky/build$ bitbake core-image-minimal -g -u taskexp
pokyuser@desk0:~/building/poky/build$

However due to the fact that you see a window pop up briefly, this may be due to a host configuration issue, or the version of bitbake/metadata that is being used. If you point me to the metadata you are using, I'd be willing to try to reproduce it. But due to the interaction with the host(I'm using Fedora) it might not be easy to track down.

There would also be the option of running vnc inside of the container and forwarding the ports, which would remove the host interaction issue.

jfernandz commented 3 years ago

Apparently I don't need to bind mount .Xauthority or /tmp/.X11-unix, the problem was the fresh build directory, when I first build quilt-native taskexp UI spawns and works as expected.

Thank you, I'd never have guessed about this bug.