Lumerical supports containerized workflows by providing necessary rpm and Dockerfiles that can be used with a variety of container management software. To obtain these files, check the Lumerical-RPM option in Ansys Automated Installer when installing the software. The files are available for both Windows and Linux starting in 2026 R1.
The container files are in the docker_and_rpm folder in the installation directory. Since the 2023 R1.2 release, additional docker files are also provided to build containers for the interop server.
This article shows an example on how to build and start a container using the Dockerfiles provided with Lumerical installation package and run a simulation in the container.
Note: The article uses Docker for Windows as an example, but you can use the provided files on any supported operating system with a variety of software to manage the containers.
Prerequisites
First, install Docker for Windows , with the WSL2 backend.
They will install Lumerical tools on a standard Linux OS, using Ubuntu image or Amazon Linux image, with the selected MPI variant (MPICH2, Intel MPI or Open MPI).
Since the 2023 R1.2 release, additional docker files are provided to build containers for the interop server.
Build a container
You can follow the following steps to build a container and install Lumerical with MPICH2 on Ubuntu, using the file “Dockerfile-ubuntu-mpich2nem”.
- Open a Command Prompt window and navigate to the folder where the Dockerfile is located
- Call 'docker build', providing a tag, port, license server, name of the Dockerfile, and the top level of the installation package as context
docker build --rm -t local/{image_name} --build-arg "license_server={port@license_server_url}" -f {Dockerfile_name} ../../Note: It might take some time to create your first image as you have to download and install the base OS and required components. A “lumerical” user account is also created.
Once created, the image will be listed in Docker Desktop.
The process to build an image with the Interop Server - Remote API is the same, but additional parameters are required:
docker build --rm -t local/{image_name} --build-arg license_server={port@license_server_url} --build-arg ip_address={ip address} --build-arg port_start={port start} --build-arg port_end={port end} --build-arg key={key file name} --build-arg certificate={certificate file name} -f {Dockerfile_name} ../../Start a container and run a simulation
To start a container, use “docker run”:
docker run -ti --rm local/{image name} /bin/bashThis will start a bash shell in the current Prompt window.
You can also start the container with a local folder mounted in the home directory of the container, for example, to access your simulation files:
docker run -ti --rm -v {local folder path}:/home/lumerical local/{image name} /bin/bashTo start a container with interop server running
docker run -it --rm -p {port_start}-{port_end}:{port_start}-{port_end} -t local/{image name}You can check the interop server log file in
$HOME/.ansys/InteropServer/Once the container has started, you can run a simulation using the installed MPI variant:
Refer to the “README” file in the “docker” folder for additional information on starting a container with other MPI variants.
You can also run your .lsf script using:
fdtd-solutions-batch {your script file}