|
# Why?
|
|
# Why?
|
|
|
|
|
|
* Native performance
|
|
* Native performance
|
|
* Quick setup of specific versions of software
|
|
* Quick setup of specific versions of software
|
|
* Disposables by design. The image creation is reproducible. The runtime environment is not meant to last, unless the user takes extra steps.
|
|
* Disposables by design. The image creation is reproducible. The runtime environment is not meant to last, unless the user takes extra steps.
|
|
* Coding: You can use the image to have all the headers and source files available for your IDE.
|
|
* Coding: You can use the image to have all the headers and source files available for your IDE.
|
|
|
|
|
|
## When not to use
|
|
## When not to use
|
|
|
|
|
|
* When using redis/oldb, elastics search, nomad, etc. Containers are not meant to have multiple processes running. Though it can be achieved, it requires extra work.
|
|
* When using redis/oldb, elastics search, nomad, etc. Containers are not meant to have multiple processes running. Though it can be achieved, it requires extra work.
|
|
* Normally you would use separate images/containers for services such as elastic and redis. But that is outside the scope of this wiki. (see man podman-compose)
|
|
* Normally you would use separate images/containers for services such as elastic and redis. But that is outside the scope of this wiki. (see man podman-compose)
|
|
|
|
|
|
# Existing images
|
|
# Existing images
|
|
|
|
|
|
Linus Karl has provided DevEnv 4 and 5 images located at quay.io/eso/devenv in Docker or Podman. Quay.io is a container registry operated by RedHat, which does not have restrictions on downloads from public repositories like Docker Hub. In the future there might be a ESO operated registry but for now you can fetch it from quay.io.
|
|
DevEnv team provides images for DevEnv 5+ located at https://quay.io/eso/devenv in Docker or Podman. Quay.io is a container registry operated by RedHat, which does not have restrictions on downloads from public repositories like Docker Hub.
|
|
|
|
|
|
The source code of the images can be found at https://gitlab.eso.org/lkarl/oci-devenv
|
|
The available versions are listed at https://obs.hq.eso.org/elt/devenv/6/containers/eltdev:latest
|
|
The available versions are listed at https://quay.io/repository/eso/devenv?tab=tags
|
|
|
|
|
|
## Simple use
|
|
## Simple use
|
|
|
|
|
|
To run the current DevEnv 5 in a container you can simply run "podman run --rm -ti quay.io/eso/devenv:5". The :5 means it will use the latest DevEnv 5, the -ti makes it run on the current terminal and not in the background and the --rm removes the container instance when the container is stopped.
|
|
To run the current DevEnv 5 in a container you can simply run "podman run --rm -ti quay.io/eso/devenv:5". The :5 means it will use the latest DevEnv 5, the -ti makes it run on the current terminal and not in the background and the --rm removes the container instance when the container is stopped.
|
|
|
|
|
|
|
|
|
|
# Custom Podman Image
|
|
# Custom Podman Image
|
|
|
|
|
|
(Examples down here are done using a legacy container. Please use the container provided by DevEnv)
|
|
You can use this image as a base and provide some of the dependencies you needs for your software.
|
|
|
|
|
|
You can use this image as a base and provide some of the dependencies you needs for your software.
|
|
Create a directory, and saves this two files in there:
|
|
|
|
|
|
Create a directory, and saves this two files in there:
|
|
This is `Containerfile`
|
|
|
|
```Containerfile
|
|
This is `Containerfile`
|
|
FROM quay.io/eso/devenv:5.0.0
|
|
```Containerfile
|
|
|
|
FROM quay.io/eso/devenv:5.0.0
|
|
RUN dnf -y install elt-wtools elt-taiclock-devel elt-etr elt-mal-devel elt-common-system hostname g++ qt5-qtbase-devel python3-pyside2-devel qt5-linguist python3-devel gtest-devel gmock-devel pytest python3-pytest-custom_exit_code cli11-devel xerces-c-devel CCfits-devel yaml-cpp-devel libbacktrace-devel numactl-devel fmt-devel google-benchmark-devel json-devel flexiblas-devel libpcap-devel libppconsul-devel guidelines-support-library-devel elt-rad-devel qt5-qtsvg-devel python3-click python3-taurus elt-trs-common-devel elt-ecsif-devel elt-roadrunner-ipcq-devel elt-roadrunner-perfc-devel elt-ciisrv-client-api-devel elt-ciisrv-cii-common-types-devel elt-ciisrv-config-ng-devel elt-ciisrv-oldb-client-devel elt-cut-devel openblas-devel-pc elt-msgsend-devel python3-ipython python3-mock python3-pytest-qt libuuid-devel
|
|
|
|
```
|
|
RUN dnf -y install elt-wtools elt-taiclock-devel elt-etr elt-mal-devel elt-common-system hostname g++ qt5-qtbase-devel python3-pyside2-devel qt5-linguist python3-devel gtest-devel gmock-devel pytest python3-pytest-custom_exit_code cli11-devel xerces-c-devel CCfits-devel yaml-cpp-devel libbacktrace-devel numactl-devel fmt-devel google-benchmark-devel json-devel flexiblas-devel libpcap-devel libppconsul-devel guidelines-support-library-devel elt-rad-devel qt5-qtsvg-devel python3-click python3-taurus elt-trs-common-devel elt-ecsif-devel elt-roadrunner-ipcq-devel elt-roadrunner-perfc-devel elt-ciisrv-client-api-devel elt-ciisrv-cii-common-types-devel elt-ciisrv-config-ng-devel elt-ciisrv-oldb-client-devel elt-cut-devel openblas-devel-pc elt-msgsend-devel python3-ipython python3-mock python3-pytest-qt libuuid-devel
|
|
|
|
```
|
|
This Dockerfile installs all dependencies for the rtc toolkit, so it can be built inside the container.
|
|
|
|
|
|
This Dockerfile installs all dependencies for the rtc toolkit, so it can be built inside the container.
|
|
|
|
|
|
## Building the image
|
|
|
|
|
|
## Building the image
|
|
```sh
|
|
|
|
podman build -t devenv-custom:latest .
|
|
```sh
|
|
```
|
|
podman build -t devenv-custom:latest .
|
|
|
|
```
|
|
This will create an image tagged `devenv-custom:latest`. You can retag your images. You can also use versions instead of `latest`, to keep track of certain environment, or have multiple image for different situations.
|
|
|
|
|
|
This will create an image tagged `devenv-custom:latest`. You can retag your images. You can also use versions instead of `latest`, to keep track of certain environment, or have multiple image for different situations.
|
|
## Running the image
|
|
|
|
|
|
## Running the image
|
|
Only terminal development
|
|
|
|
|
|
Only terminal development
|
|
```sh
|
|
|
|
podman run --cpus 4 -m 8gb -it localhost/devenv-custom:latest
|
|
```sh
|
|
```
|
|
podman run --cpus 4 -m 8gb -it localhost/devenv-custom:latest
|
|
|
|
```
|
|
> IMPORTANT! Remember to limit the cpus and memory used by the container. Otherwise compilation can eat away your resources.
|
|
|
|
|
|
> IMPORTANT! Remember to limit the cpus and memory used by the container. Otherwise compilation can eat away your resources.
|
|
|
|
|
|
# VSCode
|
|
|
|
|
|
# VSCode
|
|
For those of you using Visual Studio Code (VS Code) as your development environment, it is very easy to use the Docker/Podman image. By leveraging the "Remote - Containers" extension in VS Code, you can develop directly inside a container without changing your workflow.
|
|
|
|
|
|
For those of you using Visual Studio Code (VS Code) as your development environment, it is very easy to use the Docker/Podman image. By leveraging the "Remote - Containers" extension in VS Code, you can develop directly inside a container without changing your workflow.
|
|
# GUI development with Containers
|
|
|
|
|
|
# GUI development with Containers
|
|
GUI with X11/Wayland development
|
|
|
|
|
|
GUI with X11/Wayland development
|
|
```sh
|
|
|
|
podman run --cpus 4 -m 8gb -e PULSE_SERVER=/run/user/$UID/pulse/native -e DISPLAY=:0 -e XAUTHORITY=$XAUTHORITY -e XDG_RUNTIME_DIR=/run/user/$UID --volume /tmp/.X11-unix/:/tmp/.X11-unix/ --volume /run/user/$UID:/run/user/$UID --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY":/tmp/wayland-0:z --device /dev/dri/:/dev/dri/:rwm --volume /run/user/$UID/bus:/tmp/bus:z --ipc host -it localhost/devenv-custom:latest
|
|
```sh
|
|
```
|
|
podman run --cpus 4 -m 8gb -e PULSE_SERVER=/run/user/$UID/pulse/native -e DISPLAY=:0 -e XAUTHORITY=$XAUTHORITY -e XDG_RUNTIME_DIR=/run/user/$UID --volume /tmp/.X11-unix/:/tmp/.X11-unix/ --volume /run/user/$UID:/run/user/$UID --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY":/tmp/wayland-0:z --device /dev/dri/:/dev/dri/:rwm --volume /run/user/$UID/bus:/tmp/bus:z --ipc host -it localhost/devenv-custom:latest
|
|
|
|
```
|
|
The extra volumes and environment variables are the sockets and their paths to X11, Wayland, Pulseaudio, dbus and the DirectRenderingInterface(dri, graphical acceleration), so that GUIs can work properly.
|
|
|
|
|
|
The extra volumes and environment variables are the sockets and their paths to X11, Wayland, Pulseaudio, dbus and the DirectRenderingInterface(dri, graphical acceleration), so that GUIs can work properly.
|
|
# Persistent storage
|
|
|
|
|
|
# Persistent storage
|
|
```sh
|
|
|
|
podman volume create rtctk
|
|
```sh
|
|
```
|
|
podman volume create rtctk
|
|
and add the `--volume v rtctk:/root/volume` to the podman run command
|
|
```
|
|
|
|
and add the `--volume v rtctk:/root/volume` to the podman run command
|
|
Simple case, only console is available
|
|
|
|
|
|
Simple case, only console is available
|
|
```sh
|
|
|
|
podman run --cpus 4 -m 8gb --volume v rtctk:/root/volume -it localhost/devenv-custom:latest
|
|
```sh
|
|
```
|
|
podman run --cpus 4 -m 8gb --volume v rtctk:/root/volume -it localhost/devenv-custom:latest
|
|
|
|
```
|
|
You can also find the files in the host system at $HOME/.local/share/containers/storage/volumes/rtctk
|
|
|
|
|
|
You can also find the files in the host system at $HOME/.local/share/containers/storage/volumes/rtctk
|
|
|
|
|