Trelis in Docker

Hi all

Just wondering if anyone has any experience installing Trelis in a Docker container.

Is containerization allowed / possible with node locked / floating license

best

Jon

We have done limited testing using Trelis in Docker containers. If the image contains Trelis with a remote.lic file in the bin/licenses folder that points Trelis to a license server (floating license), it should work as long as the Trelis can ping the license server. A container that includes a single-user, node-locked license that is distributed to many users would not be permitted.

Armed with the new cloud based .lic file and the ability to download cubit from the products page without login I’ve been having another go at dockerizing Cubit :slight_smile:

I’ve come across some familiar issues (that are reported elsewhere) and wanted to post the dockerfile up in case anyone can see what is going wrong

When building and then running the dockerfile I get errors when runing coreform_cubit and am unable to import cubit using python

# This Dockerfile creates an enviroment / dependancies needed to run the 
# cubit_docker package.

# To build this Dockerfile into a docker image:
# docker build -t cubit_docker .

# To run the resulting Docker image:
# docker run -it cubit_docker


FROM continuumio/miniconda3:4.9.2 as dependencies


ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 \
    PATH=/opt/openmc/bin:$PATH \
    LD_LIBRARY_PATH=/opt/openmc/lib:$LD_LIBRARY_PATH \
    CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \
    DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && \
    apt-get upgrade -y

RUN apt-get install -y libgl1-mesa-glx \
                       libgl1-mesa-dev \
                       libglu1-mesa-dev \
                       freeglut3-dev \
                       libosmesa6 \
                       libosmesa6-dev \
                       libgles2-mesa-dev \
                       curl \
                       wget && \
                       apt-get clean

# download cubit
RUN wget -O coreform-cubit-2021.5.deb https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-2021.5%2B15962_5043ef39-Lin64.deb

# install dependencies
RUN apt-get install -y libx11-6 
RUN apt-get install -y libxt6 
RUN apt-get install -y libgl1
RUN apt-get install -y libglu1-mesa
RUN apt-get install -y libgl1-mesa-glx
RUN apt-get install -y libxcb-icccm4 
RUN apt-get install -y libxcb-image0 
RUN apt-get install -y libxcb-keysyms1 
RUN apt-get install -y libxcb-render-util0 
RUN apt-get install -y libxkbcommon-x11-0 
RUN apt-get install -y libxcb-randr0 
RUN apt-get install -y libxcb-xinerama0

# install cubit
RUN dpkg -i coreform-cubit-2021.5.deb

# assumes you have a local copy of your lic file ready to copy into the docker image
# COPY cloud.lic /opt/Coreform-Cubit-2021.5/bin/licenses/cloud.lic

# makes a python file and trys to import cubit
RUN printf 'import sys\nsys.path.append("/opt/Coreform-Cubit-2021.5/bin/python3/")\nimport cubit\ncubit.init([])\n' >> test_cubit_import.py

I’ve attached our centos 7 dockerfile that we use for GUI testing.
CubitDockerfile.zip (1.0 KB)
It exposes a VNC port (6080) you can attach to in your browser by going to localhost:6080 when you run the container with a 6080:6080 port mapping.

1 Like

Thanks very much Scot, this is most interesting. I’m going to see if I can move the rest of my software stack into centos:7

Also I think I just noticed my mistake in the python path appending

RUN printf 'import sys\nsys.path.append("/opt/Coreform-Cubit-2021.5/bin/python3/")\nimport cubit\ncubit.init([])\n' >> test_cubit_import.py

Should be

RUN printf 'import sys\nsys.path.append("/opt/Coreform-Cubit-2021.5/bin/")\nimport cubit\ncubit.init([])\n' >> test_cubit_import.py

It doesn’t have to be centos 7, that same solution should more or less work in other flavors of linux as well. That’s just what we test on for compatibility reasons.

Thanks, I can confirm I’ve got Cubit working inside a Debian 10.10 and Ubuntu 21.04 Docker container now. Thanks for the help