User Tools

Site Tools


using_docker_containers

Differences

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

Link to this comparison view

Next revision
Previous revision
using_docker_containers [2023/08/31 17:09] – created mimbertusing_docker_containers [2023/09/04 11:13] (current) – Rephrase docker container usage cmorin
Line 1: Line 1:
-==== Using docker images ====+==== Using docker containers ====
  
 === 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 ssh sessions there's a trapssh does nothing automatically regarding setting the environment. If the ssh session is interactivethen ssh will instanciate an interactive bash process which will source the script in `/etc/profile.d/`, but if the ssh session is not interactive, such as running an experiment script, then the environment will not be automatically setup. In this case, the workaround is to execute `bash -lc "<command to run>"`+ 
 +== 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'twhen docker executes a command in a container, it does not automatically runs the command inside a shellthus 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" ]''
using_docker_containers.1693494582.txt.gz · Last modified: 2023/08/31 17:09 by mimbert

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki