This article shows how to build and start a container using the Docker files provided with Lumerical installation package and run a simulation in the container.
Prerequisites
You need to have Docker for Windows installed, with the WSL2 backend.
Docker files are provided with the Lumerical Linux installation package (2023 R1 or later) and located in the “docker” folder.
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/bash
This 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/bash
To 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}