Using Lagun via docker

Reminder

Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security lets you run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you don’t need to rely on what’s installed on the host. You can share containers while you work, and be sure that everyone you share with gets the same container that works in the same way.
https://docs.docker.com/get-started/overview/

Prerequesities
docker installation: see https://docs.docker.com/desktop/ for Windows (DockerDesktop), Linux and Mac.

Run Lagun via a docker image

Lagun docker image is available at https://hub.docker.com/r/detocs/lagun

  • Start docker if necessary (e.g. run DockerDesktop on Windows)
  • Run Lagun image (on Windows, open a CMD or a PowerShell window to execute the following command):
    docker run -dp 0.0.0.0:6023:6023 detocs/lagun:1.1.0-I-b3-alpine
  • Open a navigator (e.g. Edge, Firefox) and type localhost:6023

Lagun can be used either in a static or dynamic mode:

  • static mode: the user provides a file with the values of outputs of interest for several combinations of the input variables;
  • dynamic mode: the user sets up its own simulator (some examples are provided, see hereafter) and the simulations are launched automatically from Lagun, thanks to the Simulation Launcher facility.

Run Simulator Launcher via a docker image

Simulation_launcher docker image is available at https://hub.docker.com/r/detocs/lagun-simulations-launcher

NB: The docker image of the simulation launcher is useful only for simulators that run on Linux OS.

(on Windows: open a PowerShell window to execute the following commands)

  • Download examples of simulator files either

    • if git is available on your machine, by executing the command git clone https://ifpen-gitlab.appcollaboratif.fr/detocs/lagun_resources.git
    • or by downloading the zip file of the repository files (via the Code button on Lagun gitlab web site).
  • Possibly unzip the downloaded file

  • In the root folder (containing simulator-examples folder), run Simulation launcher image by this command :

    • on Windows :
      docker run -dp 0.0.0.0:3000:3000 `
        --mount type=bind,src="$(pwd)/runningDir",target=/runningDir `
        --mount type=bind,src="$(pwd)/simulator-examples",target=/simulator-examples `
        detocs/lagun-simulations-launcher:1.1.0-I-b3-alpine 
      
    • on Linux :
      docker run -dp 0.0.0.0:3000:3000 \
        --mount type=bind,src="$(pwd)/runningDir",target=/runningDir \
        --mount type=bind,src="$(pwd)/simulator-examples",target=/simulator-examples \
        detocs/lagun-simulations-launcher:1.1.0-I-b3-alpine
      
  • Open a navigator (e.g. Edge, Firefox) and type localhost:3000

  • Load simulator examples:

    • click on Simulator configurations
    • click on import button and choose the configuration file to import:
      $(pwd)/simulator-examples/RSimulator/launcherServer-linux.json

Simulation_launcher_config

You can now access the configured simulators from Lagun (cf navigation bar Problem Definition and then Import DOE).

Enjoy Lagun !

See Tutorials per group of functionnalities and test cases:

4 Likes

Using docker image of Lagun at IFPEN under Linux

At IFPEN, we do not have access to DockerHub from Linux.
We give access to the current images of Lagun and of the simulation launcher via tar files.
At the first use, the images should be loaded via the following commands:

  • Start the docker:
    ifpen_docker start
    
  • Load the 2 images (Lagun and simulation launcher):
    docker load < /home/irsrvshare1/R11/OPTIMR11/LAGUN/lagun_1.1.0-I-b2-alpine.tar
    docker load < /home/irsrvshare1/R11/OPTIMR11/LAGUN/lagun-simulations-launcher_1.1.0-I-b2-alpine.tar
    
  • Run the images as described in the previous message
1 Like

If you don’t have access to the directory /home/irsrvhome1/R11/sinoquet/LAGUN_images/, or if you want to use an image which is not available in this directory, it may be interesting to know how to generate such a file.

To do this, you need access to a machine where docker is installed and dockerhub can be accessed.

For example, to generate in the current directory a tar file called lagun-simulations-launcher_1.1.0-I-b2-alpine.tar and corresponding to the export of the image detocs/lagun-simulations-launcher:1.1.0-I-b2-alpine, the command is:

docker save detocs/lagun-simulations-launcher:1.1.0-I-b2-alpine > lagun-simulations-launcher_1.1.0-I-b2-alpine.tar

Note that the content of this post is also available at: https://ifpen-gitlab.appcollaboratif.fr/detocs/lagun_resources

If, as I did, you follow the instructions from this site, you may encounter some strange behavior:

if a group of lines is copied from this site, the paste in Powershell happens fine if you use the keyboard shortcut Ctrl+V, but it goes wrong if you use the mouse right-click.