Versions Compared

Key

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

...

  • Docker on your own computer:
  • uDocker:

    Code Block
    languagebash
    if grep MARCONI /etc/motd &>/dev/null; then
    	WORK=${WORK}
    	SCRATCH=${CINECA_SCRATCH}
    	stat ${WORK} &>/dev/null || WORK=${HOME}/work
    elif grep 'Nord III' /etc/motd &>/dev/null; then
    	WORK=/gpfs/projects/$(id -gn)/$(id -un)
    	SCRATCH=/gpfs/scratch/$(id -gn)/$(id -un)
    else
    	WORK=${HOME}/work
    	SCRATCH=${HOME}/scratch
    fi
     
    mkdir -p ~/.local/bin ${WORK}/dot-udocker ${SCRATCH}
    ln -s ${WORK}/dot-udocker ~/.udocker
    
    curl -Lwget https://github.com/indigo-dc/udocker/releases/download/v11.3.4/udocker-1.3.4.tar.gz > udocker-1.3.4.tar.gz
    tar zxvf udocker-1.3.4.tar.gz > ~/.local/bin/udocker-C ${WORK}/
    chmod u+rx ~/.local/bin${WORK}/udocker
    echo "tmpdir='${SCRATCH}'" > ~/.udocker/udocker.conf
    ~/.local/bin
    
    #test udocker exec
    ${WORK}/udocker/udocker --help
    
    #install
    ${WORK}/udocker/udocker install


    Info
    titleuDocker startup errors

    If ${WORK}/udocker/udocker  command throws errors try to add python3  command before path.

    Code Block
    module load itm-python/3.10
    python3 ${WORK}/udocker/udocker --help
    python3 ${WORK}/udocker/udocker install



Loading Docker image

  • Docker on your own computer:

    Code Block
    languagebash
    # Linux
    
    scp login.eufus.eu:~g2tomz/public/imas-fc2k-latest.tar.xz ./
    xzcat imas-fc2k-latest.tar.xz | docker load
    
    # macOS
    
    scp login.eufus.eu:~g2tomz/public/imas-fc2k-latest.tar.xz ./
    docker load < imas-fc2k-latest.tar.xz


  • uDocker on Gateway:

    Code Block
    languagebash
    ~/.local/bin${WORK}/udocker/udocker load -i ~g2tomz/public/imas-fc2k-latest.tar.xz


...

  • Create a container and start a shell in it:

    • Docker on your own computer:

      Code Block
      languagebash
      docker run --interactive --tty --name imas imas/fc2k


    • uDocker on Gateway:

      Code Block
      languagebash
      export PROOT_NO_SECCOMP=1
      ~/.local/bin/${WORK}/udocker/udocker create --name=imas imas/fc2k
      ~/.local/bin${WORK}/udocker/udocker run imas


  • In the container shell, execute:

    Code Block
    languagebash
    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


  • Transfer the results to the Gateway:

    • Docker on your own computer:

      Code Block
      languagebash
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.characteristics /tmp/
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.datafile /tmp/
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.tree /tmp/
      scp /tmp/ids_10001.* login.eufus.eu:public/imasdb/test/3/0/


    • uDocker on Gateway:

      Code Block
      languagebash
      cp ~${WORK}/.udocker/containers/imas/ROOT/home/imas/public/imasdb/test/3/0/ids_10001.* ~/public/imasdb/test/3/0/


...

  • Create a container and start a shell in it:

    • Docker on your own computer:

      Code Block
      languagebash
      docker run --interactive --tty --name imas imas/fc2k


    • uDocker on Gateway:

      Code Block
      languagebash
      ~/.local/bin${WORK}/udocker/udocker create --name=imas imas/fc2k
      ~/.local/bin/${WORK}/udocker/udocker run imas


  • Transfer the Kepler workflow into the container

    • Docker on your own computer:

      Code Block
      scp login.eufus.eu:~g2tomz/public/simple-workflow.xml ./
      docker cp simple-workflow.xml imas:simple-workflow.xml


    • uDocker on Gateway:

      Code Block
      cp ~g2tomz/public/simple-workflow.xml ~/.udocker/containers/imas/ROOT/home/imas/


  • In the container shell, execute:

    Code Block
    languagebash
    cp $IMAS_PREFIX/models/mdsplus/ids_model.characteristics public/imasdb/test/3/0/ids_19998.characteristics
    cp $IMAS_PREFIX/models/mdsplus/ids_model.datafile public/imasdb/test/3/0/ids_19998.datafile
    cp $IMAS_PREFIX/models/mdsplus/ids_model.tree public/imasdb/test/3/0/ids_19998.tree
    kepler -runwf -nogui -user imas /home/imas/simple-workflow.xml


  • Transfer the results to the Gateway:

    • Docker on your own computer:

      Code Block
      languagebash
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.characteristics /tmp/
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.datafile /tmp/
      docker cp imas:/home/imas/public/imasdb/test/3/0/ids_10001.tree /tmp/
      scp /tmp/ids_10001.* login.eufus.eu:public/imasdb/test/3/0/


    • uDocker on Gateway:

      Code Block
      languagebash
      cp ~${WORK}/.udocker/containers/imas/ROOT/home/imas/public/imasdb/test/3/0/ids_10001.* ~/public/imasdb/test/3/0/


...