documentation:containers

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:containers [2023/03/06 14:51] – [Prerequisites] marcuskdocumentation:containers [2024/06/19 07:32] (current) marcusk
Line 10: Line 10:
   * //Optional but useful:// Nvidia Docker if you have a Nvidia GPU: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html   * //Optional but useful:// Nvidia Docker if you have a Nvidia GPU: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
  
-==== SSH Keys ====+===== SSH Keys =====
 It can be configured in a number of ways, below is a suggestion: It can be configured in a number of ways, below is a suggestion:
  
Line 37: Line 37:
 </cli> </cli>
  
-==== ROS Containers Quickstart ====+===== ROS Containers Quickstart =====
  
 Valuable information about how to use ROS Containers exists in the repository readme: Valuable information about how to use ROS Containers exists in the repository readme:
 https://git.cs.lth.se/robotlab/ros-containers  https://git.cs.lth.se/robotlab/ros-containers 
  
-=== Clone the ROS-containers repository ===+==== Clone the ROS-containers repository ====
 <cli> <cli>
 git clone git@git.cs.lth.se:robotlab/ros-containers.git git clone git@git.cs.lth.se:robotlab/ros-containers.git
Line 48: Line 48:
 </cli> </cli>
  
-=== Set options ===+==== Set options ====
 There are many options, all start with ''use-''. All use commands modifies ''config.env'' which you can modify in your favorite text editor aswell. Initially no ''config.env'' exists, it will be copied from ''config.env.template''. There are many options, all start with ''use-''. All use commands modifies ''config.env'' which you can modify in your favorite text editor aswell. Initially no ''config.env'' exists, it will be copied from ''config.env.template''.
  
Line 61: Line 61:
 </cli> </cli>
  
-Both above requires your user to have ''sudo'' access. If your user belongs to the group ''docker'', you can instead use ''use-docker-rootless'' and ''use-nvidia-docker-rootless''.+Both above requires your user to have ''sudo'' access. If your user belongs to the group ''docker'', you can instead use ''use-docker-rootless'' and ''use-nvidia-docker-rootless''. Adding your user can normally be done with the command ''sudo usermod -a -G docker [your usernane]''
 + 
 +If you intend to run this with a real robot: 
 +<cli> 
 +make use-real 
 +</cli> 
 +This adds ''--priviledged'' flag to when running the docker image. This means that it would then no longer be fully sandboxed. This allows among other things unrestricted access to USB devices which is commonly required for cameras.
  
 More options are available in the documentation: https://git.cs.lth.se/robotlab/ros-containers and more specifically you can take a peep inside ''Makefile'' to see available commands. More options are available in the documentation: https://git.cs.lth.se/robotlab/ros-containers and more specifically you can take a peep inside ''Makefile'' to see available commands.
  
-=== Build and run ===+==== Build and run ====
 <cli> <cli>
 make run make run
Line 72: Line 78:
 This will build the base image, a special user image where your user is known and mapped and finally a container to run it all in. This will build the base image, a special user image where your user is known and mapped and finally a container to run it all in.
  
-By default your home directory is mapped to ''environment/home'' relative to ros-container repo root.+By default your home directory is mapped to ''home'' relative to ros-container repo root.
  
-=== Resume and reset ===+==== Resume and reset ====
 Delete your container to change mappings or otherwise clean out your environment: Delete your container to change mappings or otherwise clean out your environment:
 <cli> <cli>
Line 85: Line 91:
 </cli> </cli>
  
-This command will resume your container.// Note:// if the container is resumed in one terminal and you resume again, you will effectly use the same terminal interface in multiple terminals (they will be mirrored).+This command will resume your container. 
 +// Note:// if the container is resumed in one terminal and you resume again, you will effectly use the same terminal interface in multiple terminals (they will be mirrored).
  
  
Line 91: Line 98:
 You should have succeeded in building the container and is inside it for below to work. You should have succeeded in building the container and is inside it for below to work.
  
-=== Build the Heron Workspace ===+==== Build the Heron Workspace ====
 <cli> <cli>
 workspace init heron.rosinstall workspace init heron.rosinstall
Line 97: Line 104:
 </cli> </cli>
  
-=== Run Heron simulation ===+==== Run Heron simulation ====
 Two terminals or tmux/start roscore in background: Two terminals or tmux/start roscore in background:
  
Line 117: Line 124:
 ===== Workspace Tips/Tricks ===== ===== Workspace Tips/Tricks =====
  
-=== Using a custom rosinstall ===+==== Using a custom rosinstall ====
 Let say it is named ''custom.rosinstall'', replace the name with whatever you want. Let say it is named ''custom.rosinstall'', replace the name with whatever you want.
  
-  - Copy your ''custom.rosintall'' to ''[ros-containers-path]/environment/home'' or if using //shared-home//, to your user home directory.+  - Copy your ''custom.rosintall'' to ''[ros-containers-path]/home'' or if using //shared-home//, to your user home directory.
   - In your home directory, run ''workspace init custom.rosinstall''   - In your home directory, run ''workspace init custom.rosinstall''
   - This will clone all the repos described in ''custom.rosinstall''   - This will clone all the repos described in ''custom.rosinstall''
Line 126: Line 133:
 **Note:** ''workspace init'' autocompletes when pressing the [TAB] key, it combines central rosinstalls with local ones in your current directory. **Note:** ''workspace init'' autocompletes when pressing the [TAB] key, it combines central rosinstalls with local ones in your current directory.
  
-=== Switching branches ===+==== Switching branches ====
 By default ''~/catkin_ws'' will contain a file ''current.rosinstall'' which was used to initialize the workspace. By default ''~/catkin_ws'' will contain a file ''current.rosinstall'' which was used to initialize the workspace.
 If you modify it, you can run ''workspace reimport'' to apply the new branches and clone new repos that did not exist before. If you modify it, you can run ''workspace reimport'' to apply the new branches and clone new repos that did not exist before.
 +
 +If you are using ROS2, it would be called ''~/colcon_ws'' instead.
  
 **Note**: ''workspace reimport'' will not move or remove repos - you will have to do that manually. **Note**: ''workspace reimport'' will not move or remove repos - you will have to do that manually.
-==== WSL 2 GPU Drivers ====+====== Resources ====== 
 +===== WSL 2 GPU Drivers =====
 https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
  
-==== VS Code Workflow ==== +===== VS Code Workflow ===== 
-The files in the home folder (in the container) are by default available in ''environment/home''. But in stead of opening that folder in your VS Code, a more convenient way is to attach VS Code to the container. You need to have the Docker extension installed in VS Code for this to work.+The files in the home folder (in the container) are by default available in ''home''. But instead of opening that folder in your VS Code, a more convenient way is to attach VS Code to the container. You need to have the [[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack|Remote Development extension]] installed in VS Code for this to work.
  
 To attach your VS Code to the running Docker container, choose the Docker panel and right-click on the container to get a context menu. To attach your VS Code to the running Docker container, choose the Docker panel and right-click on the container to get a context menu.
  • documentation/containers.1678114270.txt.gz
  • Last modified: 2023/03/06 14:51
  • by marcusk