... | ... | @@ -5,64 +5,39 @@ |
|
|
* 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.
|
|
|
|
|
|
# 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.
|
|
|
* 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
|
|
|
|
|
|
Linus Karl has provided a DevEnv 4.5 and 4.6 image at https://quay.io/repository/recreate0674/esodevenv, code available at https://gitlab.eso.org/lkarl/oci-devenv
|
|
|
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.
|
|
|
|
|
|
You can use this image as a base and provide some of the dependencies you needs for your software.
|
|
|
The source code of the images can be found at https://gitlab.eso.org/lkarl/oci-devenv
|
|
|
The available versions are listed at https://quay.io/repository/eso/devenv?tab=tags
|
|
|
|
|
|
## 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.
|
|
|
|
|
|
If you have podman in your machine, you can easily expand on an existing one.
|
|
|
|
|
|
# Custom Podman Image
|
|
|
|
|
|
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:
|
|
|
|
|
|
This is `Containerfile`
|
|
|
```Containerfile
|
|
|
FROM quay.io/recreate0674/esodevenv:latest
|
|
|
RUN dnf -y check-upgrade
|
|
|
RUN dnf -y install git Lmod waf elt-wtools elt-ciisrv-common elt-common-tools elt-common-system elt-ciisrv-oldb-client-devel.x86_64 elt-ciisrv-config-ng-devel.x86_64 elt-etr elt-mal* gcc g++ protobuf-devel qt5-qtbase-devel qt5-qtsvg-devel python3-pyside2-devel qt5-linguist fast-dds-gen czmq-devel open62541-devel log4cplus-devel opentelemetry-cpp-devel boost-devel python3-devel pytest gtest-devel gmock-devel python3-pytest python3-pytest-qt cli11-devel xerces-c-devel CCfits-devel yaml-cpp-devel libbacktrace-devel numactl-devel hiredis-devel azmq-devel gsl-pc elt-ciisrv-client-api-devel elt-trs-common-devel pybind11-devel python3-protobuf python3-jinja2 python3-jsonschema python3-psutil python3-robotframework python3-robotframework-redislibrary elt-ciisrv-robot-library python3-pyyaml python3-zmq rt-pc fmt-devel google-benchmark-devel nlohmann-json openblas-devel openblas-devel-pc libpcap-devel guidelines-support-library-pc libppconsul-devel pybind11-devel-pc.noarch python3-pybind11 python3-click elt-taiclock-devel elt-cut-devel python3-lxml elt-ddt-devel python3-taurus libatomic hostname python3-cookiecutter git-lfs python3-astropy python3-ipython qt5-qtwayland qt5-designer python3-mock psmisc python3-pytest-custom_exit_code python3-asyncua net-snmp-devel libcurl-devel python3-snmpsim python3-netmiko python3-async-timeout python3-flask python3-networkx python3-hashids tk python3-zope-interface qt5-qt3d-devel clang qt5-qttools-devel libasan libtsan libubsan
|
|
|
RUN mkdir /root/modulefiles
|
|
|
COPY private.lua /root/modulefiles/private.lua
|
|
|
VOLUME /root/volume
|
|
|
RUN chown root:root /root/volume
|
|
|
ENV WAYLAND_DISPLAY=/tmp/wayland-0
|
|
|
ENV DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/bus"
|
|
|
#ENV QT_QPA_PLATFORM=wayland
|
|
|
WORKDIR /root/volume
|
|
|
CMD ["bash"]
|
|
|
```
|
|
|
FROM quay.io/eso/devenv:5.0.0
|
|
|
|
|
|
This is the `private.lua` file:
|
|
|
```
|
|
|
local homedir = os.getenv("HOME")
|
|
|
local introot = pathJoin(homedir .. "/volume/INTROOT")
|
|
|
local dataroot = pathJoin(homedir .. "/volume/DATAROOT")
|
|
|
setenv("PREFIX", introot)
|
|
|
setenv("INTROOT", introot)
|
|
|
setenv("DATAROOT", dataroot)
|
|
|
setenv("CII_LOGS", "/var/log/elt")
|
|
|
prepend_path("MODULEPATH", pathJoin(introot, "/etc/modulefiles"))
|
|
|
prepend_path("PKG_CONFIG_PATH", pathJoin(introot, "/lib64/pkgconfig"))
|
|
|
prepend_path("CFGPATH", dataroot .. "/config/persistent_repo")
|
|
|
load("introot")
|
|
|
try_load("ciisrv")
|
|
|
try_load("elt-trs")
|
|
|
try_load("taiclock")
|
|
|
try_load("cut")
|
|
|
|
|
|
-- DDT variables
|
|
|
setenv("DDT_TEST_DATA_DIR", "/elt/ddt/resource/image")
|
|
|
|
|
|
-- This FIXES the problem when expanding on bash with TAB
|
|
|
execute{cmd="shopt -s direxpand", modeA={"load"}}
|
|
|
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.
|
|
|
|
|
|
|
|
|
## Building the image
|
|
|
|
|
|
```sh
|
... | ... | @@ -81,6 +56,13 @@ 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.
|
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
# GUI development with Containers
|
|
|
|
|
|
GUI with X11/Wayland development
|
|
|
|
|
|
```sh
|
... | ... | @@ -89,7 +71,7 @@ podman run --cpus 4 -m 8gb -e PULSE_SERVER=/run/user/$UID/pulse/native -e DISPLA |
|
|
|
|
|
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 in /root/volume
|
|
|
# Persistent storage
|
|
|
|
|
|
```sh
|
|
|
podman volume create rtctk
|
... | ... | @@ -102,13 +84,4 @@ Simple case, only console is available |
|
|
podman run --cpus 4 -m 8gb --volume v rtctk:/root/volume -it localhost/devenv-custom:latest
|
|
|
```
|
|
|
|
|
|
GUI is available
|
|
|
|
|
|
```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 --volume v rtctk:/root/volume --ipc host -it localhost/devenv-custom:latest
|
|
|
```
|
|
|
|
|
|
## VSCode
|
|
|
|
|
|
You can use this image with VSCode.
|
|
|
Install the "Dev Containers" extension. It will automatically detect available podman containers in the "Remote Explorer" tab. |
|
|
\ No newline at end of file |