User Tools

Site Tools


using_docker_containers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
using_docker_containers [2023/08/31 17:18] cmorinusing_docker_containers [2023/09/04 11:13] (current) – Rephrase docker container usage cmorin
Line 3: Line 3:
 === Current conventions for the GNURadio images provided by CorteXlab === === Current conventions for the GNURadio images provided by CorteXlab ===
  
-* These images are listed [[docker images|here]] +== Use prebuilt images == 
-In these images, the "CorteXlab toolchain" is installed in `/cortexlab/toolchain/current`. "CorteXlab toolchain" means all radio related software, such as GNURadio, drivers, plugins, custom libraries. The advantage is that there is a clean and clear separation between linux-distribution provided software, and software explicitely built by our Dockerfiles. The drawback is that the environment needs to be correctly set for the toolchain to work, and that if you want to add custom libraries or GNURadio out of tree modules, it's better to install them in `/cortexlab/toolchain/current` as well +Prebuilt images are listed [[docker images|here]]. These can be used either directly, if one wants to run a very simple GNU Radio flowgraph, or as the basis for a custom image. 
-* to set the environment correctly for the CorteXlab toolchain to be seen, the script `/cortexlab/toolchains/current/bin/cxlb-toolchain-user-conf` needs to be sourced. For an interactive bash session, this is done automatically because a link to this script is added in `/etc/profile.d/`, but for minus scenarios, there's a trap: when docker executes a command in a container, it does not automatically runs the command inside a shell, thus the environment is not be automatically setup. In this case, the workaround, in the minus scenario (in the `command:` entry) is to execute `bash -lc "<actual command to run>"+ 
-When building a docker image, however, the trick is to add this line at the beginning of the dockerfile:+== Lib install location == 
 +In prebuilt images, the "CorteXlab toolchain" is installed in `/cortexlab/toolchain/current`. That includes all radio related software, such as GNURadio, drivers, plugins, custom libraries.  
 +There is a clean and clear separation between linux-distribution provided software, and software explicitely built by our Dockerfiles. But the environment needs to be correctly set for the toolchain to work
 +When adding custom libraries or GNURadio out of tree modules, it's better to install them in `/cortexlab/toolchain/current` along the rest of the toolchain. 
 +For instance, when building a GNU Radio OOT module, use the Install prefix option in cmake:\\ 
 +''%%cmake -DCMAKE_INSTALL_PREFIX=/cortexlab/toolchain/current <OTHER OPTIONS> ..%%'' 
 + 
 +== Correct environment setup == 
 +To set the environment correctly for the CorteXlab toolchain to be seen, the script `/cortexlab/toolchains/current/bin/cxlb-toolchain-user-conf` needs to be sourced. For an interactive bash session such as when connecting via ssh as shown in [[gnu_radio_docker_benchmark_example|tutorial 1]], this is done automatically because a link to this script is added in `/etc/profile.d/`. But for raw commands in minus scenarios, it doesn't: when docker executes a command in a container, it does not automatically runs the command inside a shell, thus the environment is not automatically setup. 
 + 
 +The workaround is to include the following in the minus scenario:\\ 
 +`command: bash -lc "<actual command to run>"` 
 + 
 +When building a docker image, however, the trick is to add this line at the beginning of the dockerfile:\\
 ''SHELL [ "/bin/bash", "-lc" ]'' ''SHELL [ "/bin/bash", "-lc" ]''
using_docker_containers.txt · Last modified: 2023/09/04 11:13 by cmorin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki