Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IMAS environment is available as a Docker image. Currently it is exported as an archive There are two flavors of the image: batch and GUI. Each image has a predefined environment, so unlike on Gateway, you do not need to load any modules or call imasdb to get started. Both images them are exported as archives and made available on the Gateway.

Loading

...

images to uDocker

To load the imageimages, please run:

Code Block
~/.local/bin/udocker load -i ~g2tomz/public/imas-fc2k-latest.tar.xz
~/.local/bin/udocker load -i ~g2tomz/public/imas-gui-latest.tar.xz


Info

This Each step takes about a bit longer than 1 minute without any progress indication, so please wait until it is finished.

Exercises

Running Python script to create IDSes

  1. Make sure that the images are loaded: ~/.local/bin/udocker images
  2. Create container: ~/.local/bin/udocker create --name=imas imas/fc2k:3.24.0-4.2.0-2.5p4-3.0.5-4.6.5
  3. Run an interactive shell: ~/.local/bin/udocker run imas /bin/bash
  4. Prepare and run a Python script which will create IDS pf_active in shot 1 and run 1:

    Code Block
    cat << EOF > put_pf.py
      
    import imas
    if __name__ == '__main__':
        ids = imas.ids(1, 1, 1, 1)
        ids.create_env('imas', 'test', '3')
        ids.pf_active.ids_properties.comment = 'Test data'
        ids.pf_active.ids_properties.homogeneous_time = 0
        ids.pf_active.coil.resize(2)
        ids.pf_active.coil[0].name = 'COIL 1A'
        ids.pf_active.coil[1].name = 'COIL 2B'
        number = 10
        ids.pf_active.coil[0].current.data.resize(number)
        ids.pf_active.coil[0].current.time.resize(number)
        for i in range(number):
            ids.pf_active.coil[0].current.data[i] = 2 * i
            ids.pf_active.coil[0].current.time[i] = i
        number = number + 2
        ids.pf_active.coil[1].current.data.resize(number)
        ids.pf_active.coil[1].current.time.resize(number)
        for i in range(number):
            ids.pf_active.coil[1].current.data[i] = 2 * i + 10
            ids.pf_active.coil[1].current.time[i] = i + number
        ids.pf_active.put()
    EOF
      
    python put_pf.py


  5. You can now exit container shell. Note, that the container is not executing anything, but it persists and all files are kept in ~/.udocker. Copy the generated pulsefile directly into your Gateway's collection of pulsefiles:
    cp ~/.udocker/containers/imas/ROOT/home/imas/public/imasdb/test/3/0/ids_10001.* ~/public/imasdb/test/3/0/
  6. Verify that the IDS pf_active has been created: idsdump $USER test 3 1 1 pf_active

Running Kepler workflow in a container

  1. Create container: ~/.local/bin/udocker create --name=imas-gui imas/gui:3.24.0-4.2.0-2.5p4-3.0.5-4.6.5
  2. Run the default application (VNC server) with port mapping: ~/.local/bin/udocker run --publish 15901:5901 imas-gui
  3. In another terminal, open VNC viewer, connect to localhost:15901 and use imas as the password: vncviewer localhost:15901
  4. You will see XFCE4 desktop environment. Open terminal and run: kepler
  5. Design an example workflow like the one below (it reads pf_active from shot 1 and run 1 as created by previous step):
    Image Added
  6. The expected result:
    Image Added