Skip to content
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

PX4 and ROS Docker Setup Issue #59

Closed
earcz opened this issue May 6, 2018 · 13 comments
Closed

PX4 and ROS Docker Setup Issue #59

earcz opened this issue May 6, 2018 · 13 comments

Comments

@earcz
Copy link

earcz commented May 6, 2018

Hi,

Because, unfortunately, I could not use Redtail docker image although I have tried a few times, I have started to build image manually regarding the guide, starting from PX4 and Ros Docker setup (step 2). I have followed the steps on PX4 developer page by starting with this:

mkdir src
cd src
git clone https://github.com/PX4/Firmware.git
cd Firmware

To pull px4-dev-ros:v1 , I implemented "Calling Docker Manually" section as follows:

# enable access to xhost from the container
xhost +
  • First problem showed up with xhost + command and output: access control disabled, clients can connect from any host. I googled that but could not find solution although I have found a recommendation but did not help. Nevertheless, I kept going on running docker as follows:
#Run docker
docker run -it --privileged \
    --env=LOCAL_USER_ID="$(id -u)" \
    -v ~/src/Firmware:firmware:rw \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -e DISPLAY=:0 \
    -p 14556:14556/udp \
    --name=px4-ros px4io/px4-dev-ros:v1.0 bash
  • However, output turned out: docker: Error response from daemon: invalid volume specification: '/home/deep/src/Firmware:firmware:rw': invalid mount config for type "bind": invalid mount path: 'firmware' mount path must be absolute.
    I also tried Helper Script (docker_run.sh) but nothing was okay. Could you please help me?

Kind regards, Ender.

@Alexey-Kamenev
Copy link
Collaborator

Is it possible to share more details on what did not work when you tried building redtail Docker image?

The warning that you got after running xhost does not mean something is not working - it is a warning that any client now can connect to your X server (+ command line parameter). This is needed when the container is first created by docker run command so you can run GUI apps from the container itself. Once the container is created, each subsequent runs (via docker start command) use the container's host name to grant permissions to X server only for that container. See more details on xhost here.

Your second problem is just an incorrect argument to -v option of docker run command: as it was stated in the error message, all paths should be absolute. So in your case it should be something like -v ~/src/Firmware:/src/firmware:rw. In this case, your ~/src/Firmware host directory will be mapped into /src/firmware directory in the container. More info.

In general, the main reason to use Docker is to isolate your host machine from changes in configuration made by different packages that have complex dependencies. You may choose not to use Docker and it may even work for some time but eventually your chances of running into some tricky dependency issue will be quite high. In redtail project, the only place where we don't use Docker is on Jetson itself - re-flashing it is simple and our Jetson install script takes care of all required dependencies.

@earcz
Copy link
Author

earcz commented May 7, 2018

When I run ./build_redtail_image.sh /Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz, it gives output as:

Using -v2 image suffix.
cp: cannot stat '/Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz': No such file or directory
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/deep/Downloads/Dockerfile.kinetic: no such file or directory

I have googled to understand why this is happening but could not find anything.

Regarding my second problem, you are right. It is my fault. I have changed it as you stated and It just run now but with the output of:

Cloning into 'jMAVlib'...
Submodule path '../../Tools/jMAVSim/jMAVlib': checked out 'afa488d166813038c28572907eacf6eaa54f3c7c'
-- Configuring incomplete, errors occurred!
See also "/src/firmware/build/posix_sitl_default/CMakeFiles/CMakeOutput.log".
/bin/sh: 1: cd: can't cd to /src/firmware/build/posix_sitl_default
make: *** [posix_sitl_default] Error 2

Afterwards, I have just run docker start px4-ros, It worked inspite of the error. Should I wait for your response to use Redtail docker image; which I would love to use it; or just keep going on manual setup step by step?

@Alexey-Kamenev
Copy link
Collaborator

Does /Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz file exist? What do you see if you run:

ls /Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz

@earcz
Copy link
Author

earcz commented May 7, 2018

Yes, it exists. Please see the screen shot below. Still, ls /Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz gives output of:

ls: cannot access '/Home/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz': No such file or directory

screenshot from 2018-05-07 21-03-35

Note: It is not about the current problem but I did not install Cuda.

@Alexey-Kamenev
Copy link
Collaborator

The path you see in File Explorer is not the actual path on your disk. Use the following to determine the full path:

ls ~/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz

In case you need a refresher on Linux command line, check out this.

As for CUDA: if you are using Docker, you don't need it on the host (it's already in the container), however, if you decide to install everything on the host directly then you should also install all dependencies yourself.
You will need NVIDIA drivers in either case (CUDA comes with drivers but I recommend installing latest ones via apt/directly).

@earcz
Copy link
Author

earcz commented May 7, 2018

ls ~/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz gives output of:
/home/deep/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz

and then, I have downloaded tensorrt again to be sure that it is fully downloaded, and run the command again
cd ~/Downloads
./build_redtail_image.sh /home/deep/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0

Still, the same problem exists:

Using -v2 image suffix.
cp: '/home/deep/Downloads/TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz' and './TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-8.0.cudnn7.0.tar.gz' are the same file
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/deep/Downloads/Dockerfile.kinetic: no such file or directory

Thank you for your patience.

@Alexey-Kamenev
Copy link
Collaborator

How did you get redtail sources? You should clone the full repo, then navigate to appropriate directory and run scripts from there. Do not download separate files, this won't work.

@earcz
Copy link
Author

earcz commented May 8, 2018

I got it now. It was my fault because I am new to Linux system. As one more thing, I downloaded tensorrt for cuda 8 regarding the guide but ./build_redtail_image.sh is pulling Step 1/34 : FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 9.0-cudnn7-devel-ubuntu16.04: Pulling from nvidia/cuda. So, I exited from the building operation and downloaded TensorRT for cuda 9.0. After building is finished, I run docker images and it gave the output below

REPOSITORY          TAG                            IMAGE ID            CREATED             SIZE
<none>              <none>                         f65789ee0122        9 minutes ago       3GB
nvidia/cuda         9.0-cudnn7-devel-ubuntu16.04   803d7d264fd1        4 days ago          2.9GB

instead of

$ docker images
REPOSITORY                     TAG                            IMAGE ID            CREATED             SIZE
nvidia-redtail-sim             kinetic                        b23157eb05e7        21 hours ago        6.21GB

Because of that reason, when creating container, pull access denied for nvidia-redtail-sim since it does not exist.

By the way, while building, there says: debconf: delaying package configuration, since apt-utils is not installed
And after that, building is continuing. when it comes to installing collected packages: pip, there is found existing pip 8.1.1 and

Successfully installed pip-10.0.1
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main```

@earcz earcz closed this as completed May 8, 2018
@earcz earcz reopened this May 8, 2018
@ghost
Copy link

ghost commented May 8, 2018 via email

@toreal
Copy link

toreal commented May 14, 2018

I also got the same situation. How to solve the<none> REPOSITORY and <none> TAGproblem?

I can not install nvidia-docker v1, thus I install nvidia-docker2 instead. Did that make this problem?

docker images -a
REPOSITORY          TAG                            IMAGE ID            CREATED             SIZE
<none>              <none>                         a4152189a408        About an hour ago   3GB
<none>              <none>                         d1839e17d9d0        About an hour ago   2.9GB
<none>              <none>                         e53e77838eb6        About an hour ago   2.9GB
<none>              <none>                         3021234263c4        About an hour ago   2.9GB
nvidia/cuda         9.0-cudnn7-devel-ubuntu16.04   803d7d264fd1        10 days ago         2.9GB
docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
7d2c3e9bfb79        a4152189a408        "/bin/sh -c 'apt-get…"   About an hour ago   Exited (1) About an hour ago                       festive_jackson

Or, that is because of we did not finish the build process.


Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-10.0.1
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main
The command '/bin/sh -c apt-get update && apt-get -y --no-install-recommends install         ant         bzip2         ca-certificates         ccache         cmake         curl         gcc-5         g++-5         genromfs         git         gosu         iproute         iputils-ping         less         lcov         libeigen3-dev         libopencv-dev         make         nano         net-tools         ninja-build         openjdk-8-jdk         patch         pkg-config         protobuf-compiler         python-argparse         python-dev         python-empy         python-numpy         python-pip         python-serial         python-software-properties         rsync         s3cmd         software-properties-common         sudo         unzip         vim-common         xsltproc         wget         zip     && apt-get -y autoremove     && apt-get clean autoclean     && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5     && pip install --upgrade pip     && pip install setuptools     && pip install cpp-coveralls     && pip install jinja2     && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*     && cd /opt && curl http://www.eprosima.com/index.php/component/ars/repository/eprosima-fast-rtps/eprosima-fast-rtps-1-5-0/eprosima_fastrtps-1-5-0-linux-tar-gz?format=raw | tar xz eProsima_FastRTPS-1.5.0-Linux/share/fastrtps/fastrtpsgen.jar eProsima_FastRTPS-1.5.0-Linux/bin/fastrtpsgen     && ln -s /opt/eProsima_FastRTPS-1.5.0-Linux/bin/fastrtpsgen /usr/local/bin/fastrtpsgen     && mkdir -p /usr/local/share/fastrtps && ln -s /opt/eProsima_FastRTPS-1.5.0-Linux/share/fastrtps/fastrtpsgen.jar /usr/local/share/fastrtps/fastrtpsgen.jar' returned a non-zero code: 1


@earcz
Copy link
Author

earcz commented May 14, 2018

I don't think that installing v2 is causing the problem because I have installed v1. So, the problem must be something else. I could not find the solution for that. Today I will try to install images manually. If I can build the container successfully, I will post the result here.

@toreal
Copy link

toreal commented May 14, 2018

I found pip v10 issue .

Thus, I mark the line in Dockerfile.kinetic as follows.
## && pip install --upgrade pip \

This seems to work.

@earcz
Copy link
Author

earcz commented May 14, 2018

Thank you, that worked for me, too !

@earcz earcz closed this as completed May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants