Using Gitlab Docker Images

If were not aware the OpenCPI GitLab project has a container registry available with pre-built combinations of OpenCPI HDL/RCC platforms.

The naming syntax is as follows:
opencpi/<container OS>/<hdl platform>-<rcc platform>:develop

The idea behind these containers is to speed up development time by providing a base image that contains both the framework and the platform pre-built, a starting point, for your additional OpenCPI projects. These images are currently available in two tags develop and v2.4.8. Subsequent tagged releases will be added in the future.

Login to Container Registry

This is the way I do it, it may differ since I use two factor authentication with GitLab.

You need to generate a token, you can find this by clicking on your Profile picture top right → Preferences → on the left navigation bar go to Personal access tokens → Add New Token

Add a token name ad check the read_registry

cat gitlab-token | docker login registry.gitlab.com -u YOUR_GITHUB_USERNAME --password-stdin

Pulling Image

Identify from the container registry which image you want to pull. The GitLab UI has a button right next to the name that will copy the link onto your clipboard.

docker pull <link>

For example
docker pull registry.gitlab.com/opencpi/opencpi/rocky9:develop

Starting Container

Once the image is pull downloaded
docker run -it -v /tools:/tools --network host registry.gitlab.com/opencpi/opencpi/rocky9/plutosdr-adi_plutosdr0_38:develop

You will find OpenCPI tree in the following path: /home/user/opencpi

Things to Note

  1. ocpi.comp.sdr is not pre-built may add in future
  2. These images assume Xilnx 2024.1 vendor tools are installed. If a different version of the tools is required use the OCPI_XILINX_VIVADO_VERSION environment variable
  3. default user is user - If you need to install an additional yum package you need to login as root user `docker exec -it -u root <container_name> /bin/bash
  4. On reboot the docker container will boot in a stopped state you will need to start docker start <name of the container> then you exec into using docker exec -it <name> /bin/bash

Things I added post pull:

  • vim
  • net-tools
  • iputils

You probably can use DockerFile to add things on top of the image pulled from the container registry.

Known Issues

Working my way up from docker image pull to using zed hardware platform. Ran into an issue with one of the requirements for OpenCPI server mode (aka ocpiremote) is ability to ping the device from within the container.

Enable Pinging from User

In order to enable ping from default user

  1. login as root
  2. setcap cap_net_raw+p /bin/ping