You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

1.1. Building the Docker image

  • Prerequisites:
    • You must place id_rsa file as roles/kepler/files/id_rsa and roles/ual/files/id_rsa
    • The id_rsa file contains private key which allows passwordless login to ssh://git@git.iter.org 
  • External documentation: http://docs.ansible.com/ansible-container/ 
  • Steps:

    # git-clone the main repo and make a small patch
    git clone https://github.com/ansible/ansible-container.git
    echo 'ENV DOCKER_CLIENT_TIMEOUT=600' >> ansible-container/container/docker/templates/conductor-local-dockerfile.j2
    sed -i 's/from pip.req import parse_requirements/try:\n    from pip._internal.req import parse_requirements\nexcept ImportError:\n    from pip.req import parse_requirements/g' ansible-container/setup.py
    
    # create virtualenv with ansible-container
    virtualenv venv
    source venv/bin/activate
    pip install -e ansible-container[docker]
    
    # FIXME: workaround to a bug https://github.com/ansible/ansible-container/issues/884
    pip install docker==2.7.0
    
    # git-clone this repository and start the build
    git clone https://bitbucket.org/tzok/imas-container
    cd imas-container
    ansible-container --vars-files vars.yml build --no-cache
    
    # once ready, save the image
    $ docker save imas-installer:latest | xz --threads=0 > imas-installer-latest.tar.xz

1.2. Demonstration 1: Python script

  • Start a new Docker container

    docker run --interactive --tty --name imas imas-installer
  • In the container shell, execute:

    module load imas
    imasdb test
    python /home/imas/imas-installer/src/$IMAS_VERSION/ual/$UAL_VERSION/examples/dd-v3/python/put_pf.py
  • On the host machine, execute:

    docker cp imas:/home/imas/public/imasdb/test/3/0/ids_120001.characteristics /tmp/
    docker cp imas:/home/imas/public/imasdb/test/3/0/ids_120001.datafile /tmp/
    docker cp imas:/home/imas/public/imasdb/test/3/0/ids_120001.tree /tmp/
  • Transfer the generated IDSes to the Gateway:

    scp /tmp/ids_120001.* login.eufus.eu:public/imasdb/test/3/0/

1.3. Demonstration 2: Kepler workflow

 

  • Start a new Docker container

    docker run --interactive --tty --name imas imas-installer
  • In the container shell, execute:

    module load imas kepler
    module load keplerdir
    imasdb test
    export USER=imas
    kepler -runwf -nogui -user imas /home/imas/simple-workflow.xml
  • On the host machine, execute:

    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/
  • Transfer the generated IDSes to the Gateway:

    scp /tmp/ids_10001.* login.eufus.eu:public/imasdb/test/3/0/
  • No labels