Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Nov 19, 2024
1 parent ce46ad0 commit d76e4f5
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 47 deletions.
72 changes: 36 additions & 36 deletions docs/10-prerequisities/30-docker/10-building-images.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
---
title: Building images
pagination_label: Building Docker images
description: How to build docker images.
title:Buildingimages
pagination_label:BuildingDockerimages
description:Howtobuilddockerimages.
---

# Building images
#Buildingimages

Follow the [official guide](https://docs.docker.com/build/) for more in-depth information.
Followthe[officialguide](https://docs.docker.com/build/)formorein-depthinformation.

### Building a Docker Image from a Dockerfile
###BuildingaDockerImagefromaDockerfile

A Dockerfile is a text file containing a series of instructions to create a Docker image.
Here's how to build an image using a Dockerfile.
ADockerfileisatextfilecontainingaseriesofinstructionstocreateaDockerimage.
Here'showtobuildanimageusingaDockerfile.

1. **Create a Dockerfile**:
Write a `Dockerfile` with the necessary instructions for your application. Example:
```dockerfile
# Use the MRS UAV System the base image
FROM ctumrs/mrs_uav_system:latest
# Install additional packages into the image
RUN sudo apt-get -y install <my_dependency>
1.**CreateaDockerfile**:
Writea`Dockerfile`withthenecessaryinstructionsforyourapplication.Example:
```dockerfile
#UsetheMRSUAVSystemthebaseimage
FROMctumrs/mrs_uav_system:latest

#Installadditionalpackagesintotheimage
RUNsudoapt-get-yinstall<my_dependency>

# Specify the default command to run
CMD ["/ros_entrypoint.sh"]
```
2. **Save the Dockerfile:** Save the Dockerfile in the root directory of your project.
3. **Build the Docker Image:** Use the docker build command to build the image. Run this command in the same directory as your Dockerfile:
#Specifythedefaultcommandtorun
CMD["/ros_entrypoint.sh"]
```
2.**SavetheDockerfile:**SavetheDockerfileintherootdirectoryofyourproject.
3.**BuildtheDockerImage:**Usethedockerbuildcommandtobuildtheimage.RunthiscommandinthesamedirectoryasyourDockerfile:
```bash
docker build -t <image-name>:<tag> .
dockerbuild-t<image-name>:<tag>.
```
Example:
```bash
docker build -t my-app:latest .
dockerbuild-tmy-app:latest.
```

* The `-t` flag assigns a name and tag to your image (e.g., my-app:latest).
* The `.` at the end specifies the build context (the current directory).
*The`-t`flagassignsanameandtagtoyourimage(e.g.,my-app:latest).
*The`.`attheendspecifiesthebuildcontext(thecurrentdirectory).

## Dockerfile for the MRS UAV System
##DockerfilefortheMRSUAVSystem

```dockerfile
FROM ctumrs/ros:noetic
FROMctumrs/ros:noetic

RUN apt-get -y update
RUNapt-get-yupdate

# workaround interractive prompts during apt installations
RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install keyboard-configuration
#workaroundinterractivepromptsduringaptinstallations
RUNecho'debconfdebconf/frontendselectNoninteractive'|sudodebconf-set-selections
RUNDEBIAN_FRONTEND=noninteractiveapt-get-yinstallkeyboard-configuration

# INSTALL the MRS UAV System
#INSTALLtheMRSUAVSystem

RUN apt-get -y install software-properties-common curl bash
RUNapt-get-yinstallsoftware-properties-commoncurlbash

RUN curl https://ctu-mrs.github.io/ppa-stable/add_ppa.sh | bash
RUNcurlhttps://ctu-mrs.github.io/ppa-stable/add_ppa.sh|bash

RUN apt-get -y install ros-noetic-mrs-uav-system-full
RUNapt-get-yinstallros-noetic-mrs-uav-system-full

CMD ["/ros_entrypoint.sh"]
CMD["/ros_entrypoint.sh"]
```
20 changes: 10 additions & 10 deletions docs/10-prerequisities/30-docker/30-registries.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Registries
pagination_label: Docker Registries
description: Using docker registries
title: Docker Registries
pagination_label: Using Docker Registries
description: Using docker Registries
---

# Docker Registries

Docker registries are storage and distribution systems for Docker images.
They allow you to share images with others or deploy them across different environments.
They allow you to share images with others or deploy them across different environments.
The default Docker registry is **Docker Hub**, but you can also use private registries, including locally hosted ones.

## Default Docker Registry: Docker Hub
Expand All @@ -26,8 +26,8 @@ Before pushing images to a Docker registry, you must authenticate.
```bash
docker login
```
## Pushing an Image to a Docker Registry

## Pushing an Image to a Docker Registry

**Tag your image:** To push an image to a registry, you must tag it with the appropriate registry URL and repository name.

Expand All @@ -40,7 +40,7 @@ Example for Docker Hub:
docker tag my-app:latest username/my-app:latest
```

**Push the image:**
**Push the image:**

```bash
docker push <registry-url>/<repository-name>:<tag>
Expand Down Expand Up @@ -127,7 +127,7 @@ To pull an image from a local registry hosted on another computer, use the IP ad
```bash
docker pull <host-ip>:<port>/<repository-name>:<tag>
```

Example
```bash
docker pull 192.168.1.100:5000/my-app:latest
Expand Down Expand Up @@ -158,7 +158,7 @@ By default, Docker requires secure (HTTPS) connections to communicate with regis
"insecure-registries": ["<registry-host>:<port>"]
}
```

### Listing Images in a Local Registry

To view the list of images stored in a local Docker registry, you can use the registry's API.
Expand All @@ -170,7 +170,7 @@ To view the list of images stored in a local Docker registry, you can use the re
```bash
curl http://<registry-host>:<port>/v2/_catalog
```
Replace `<registry-host>` and `<port>` with your local registry's address and port (e.g., `localhost:5000`).

Example:
Expand Down
36 changes: 35 additions & 1 deletion docs/90-hardware/raspi5_knowledgebase.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
title: Raspberry Pi 5 Knowledge base
pagination_label: Raspberry Pi 5 Knowledge base
description: Raspberry Pi 5 Knowledge base
---

# Camera firmware issues

For cameras based on `ov9281` connected via the MIPI port, such as the Arducam UC-599 Rev-B, you need to set up explicit firmware overlay. This is set up in `/boot/firmware/config.txt`. You need to disable automatic detection of cameras by commenting out or setting to `0` the line:
```
camera_auto_detect=1
Expand All @@ -21,11 +24,13 @@ dtoverlay=arducam-pivariety
```

## Warning

Do not install the `vcdbg` package - it will remove the overlays needed for MIPI camera use.
It seems that the package is currently only compatible with older versions of the Raspberry Pi.
If you did this, remove all packages that were installed with `vcdbg` and reinstall `raspi-firmware`.

# Using GPU acceleration in Singularity
# Using GPU acceleration in Singularity/Apptainer

By default, the Ubuntu 20.04 Singularity image we use to run ROS on the device has older MESA drivers that do not support hardware acceleration on the onboard Broadcom V3D 7.1 GPU.
This can be overcome by manually adding a non-official ppa to upgrade the drivers in Singularity.

Expand All @@ -47,3 +52,32 @@ sudo apt install libglx-mesa0 libgl1-mesa-dri
```
This should have upgraded the MESA drivers to the newest version.
Lastly, note that the V3D 7.1 GPU only supports GLSL 3.10 - if you are using a shader that explicitly requires a newer version, try manually rewriting the requirement in the code, it may work. If not, you may be out of luck.

# Using WiringPi in Singularity/Apptainer

In order to control the GPIO pins inside of 20.04 Ubuntu Singularity image, you need to install an up-to-date version of the library inside the container.
These steps worked for me:

1. Enter the wrapper with `sudo`
2. Download new versions of `autoconf` and `autoconf-archive`:
```
wget ftp.de.debian.org/debian/pool/main/a/autoconf/autoconf_2.71-3_all.deb
wget ftp.de.debian.org/debian/pool/main/a/autoconf-archive/autoconf-archive_20220903-3_all.deb
dpkg -i ./autoconf*deb
```
4. Build and install `libgpiod`:
```
git clone https://github.com/brgl/libgpiod.git
cd libgpiod
./autogen.sh --enable-tools=yes --prefix=/usr
make
make install
```
5. Copy (and replace if there is one already) `libgpoiod/lib/uapi/gpio.h` from the git directory to `/usr/include/linux/`
6. Build and install new `WiringPi`:
```
git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
./build debian
sudo dpkg -i ./debian-template/wiringpi-*.deb
```

0 comments on commit d76e4f5

Please sign in to comment.