Building the Docker image
- Prerequisites:
- You must place
id_rsa
file asroles/*/files/id_rsa
- The
id_rsa
file contains private key which allows passwordless login to ssh://git@git.iter.org
- You must place
- External documentation: http://docs.ansible.com/ansible-container/
Steps:
Code Block language bash # 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 <THIS-REPO> 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
Demonstration 1: Python script
Start a new Docker container
Code Block language bash docker run --interactive --tty --name imas imas-installer
In the container shell, execute:
Code Block language bash 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:
Code Block language bash 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:
Code Block language bash scp /tmp/ids_120001.* login.eufus.eu:public/imasdb/test/3/0/
Demonstration 2: Kepler workflow
Start a new Docker container
Code Block language bash docker run --interactive --tty --name imas imas-installer
In the container shell, execute:
Code Block language bash 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:
Code Block language bash 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:
Code Block language bash scp /tmp/ids_10001.* login.eufus.eu:public/imasdb/test/3/0/