Trelis in Docker

Hey All !

Thanks to @jshimwell for the tutorial on how to containerize Trelis.

We had problems with the graphical interface when running an old Trelis (Trelis-16.5.4) on a recent Fedora OS (FedoraCore 38). Without the GUI / via the python interface it worked as expected. Curiously, the even older Trelis-15.1 runs (with GUI) without any problems at all.

The error messages we got were related to “QOPENGLWidget” and “QXcbConnection”.

We decided to setup a singularity container and run Trelis-16.5.4 inside that container.
Our approach is based on the one posted above with some tweaks.

We install Trelis inside the container at the location /group/programs64/

The recipe we used to create the singularity container: centos7-trelis.recipe

# to build use: singularity build --sandbox ./centos7-trelis.ssb ./centos7-trelis.recipe
# to run: singularity run /path/to/centos7-trelis.ssb

BootStrap: docker
From: centos:7

%labels
        Maintainer name@group.com

%setup
        mkdir -p ${SINGULARITY_ROOTFS}/group

%help
        A baseline container for Trelis on CentOS 7

%environment
        LC_ALL=C
        LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib
        TZ='Europe/Berlin'
        alias ll='ls -l'
        export LC_ALL LD_LIBRARY_PATH TZ

%post
        yum update -y

        # Install basic package (such as editor)
        yum install -y  wget \
                        xz-utils \
                        cmake \
                        vim \
                        less \
                        curl

        # Necessary libs
        yum install -y  mesa-libGL
        yum install -y  mesa-libGLU
        yum install -y  gtk2
        yum install -y  GConf2
        yum install -y  alsa-lib
        yum install -y  libSM
        yum install -y  libXt
        yum install -y  libXmu
        yum install -y  tcp_wrappers-libs
        yum install -y  PackageKit-gtk3-module
        yum install -y  libcanberra-gtk2

        # install dependencies
        yum install -y libX11
        yum install -y xcb-util-wm
        yum install -y xcb-util-image
        yum install -y xcb-util-keysyms
        yum install -y xcb-util-renderutil
        yum install -y libxkbcommon-x11
        yum install -y libglvnd-opengl

        # install cubit utilizing the rpm package from the coreform website
        rpm -i "https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Trelis-16.5.4-Lin64.rpm" --prefix=/group/programs64/Trelis-16.5.4/ 

        # setup license file (we use a floating license, hosted on the server hostname.domain.com, accessible via port 5051)
        echo -e "HOST hostname.domain.com ANY 5051\nISV csimsoft\n" >> /group/programs64/Trelis-16.5.4/bin/licenses/remote.lic

# when the singularity container is "run" the following runscript is executed (inside the container)
%runscript
        /group/programs64/Trelis-16.5.4/bin/trelis

Further notes:

  • you may need allow the singularity container to connect to X: xhost +
  • we used singularity-ce-4.0.0 to build and run the container: Quick Start — SingularityCE User Guide 4.0 documentation
  • probably not all the libraries listed above are necessary
  • you probably need to adjust the recipe above to meet your needs

Hopefully this is helpful to someone struggling with an old Trelis or Cubit version.

Best,
Lukas