SHARE
TWEET

ansible_user_data_ubuntu

marcoverl Mar 17th, 2017 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #cloud-config
  2.  
  3. package_upgrade: true
  4.  
  5. packages:
  6.  - wget
  7.  - tar
  8.  - git
  9.  - ansible
  10.  
  11. runcmd:
  12.  - [ modprobe, -r, nouveau ]
  13.  - [ sed, -i, -e, 's/quiet/quiet rdblacklist=nouveau/g', /etc/default/grub ]
  14.  - echo 'blacklist nouveau' >/etc/modprobe.d/disable-nouveau.conf
  15.  - [ grub2-mkconfig, -o, /boot/grub2/grub.cfg ]
  16.  - [ ansible-galaxy, install, LIP-Computing.ansible-role-nvidia ]
  17.  
  18. final_message: "The system is finally up, after $UPTIME seconds"
  19.  
  20. users:
  21.   - name: ubuntu
  22.     sudo: ALL=(ALL) NOPASSWD:ALL
  23.     lock-passwd: true
  24.     ssh-import-id: ubuntu
  25.     ssh-authorized-keys:
  26.       - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuNBEiH455kxaEr8tWEjdqICI4PDnOus7hTx0Qvix05pySKQuQlSoALk8UsPSHSgFZj9ATpgFFSepACn0hnHu9DISGHn6aIWE8snUc5UctWMlzNoutTngooSjYQxRPZTfHcntjgd5T0Amfqgn1PjO8qaseKLmsR87FhG7Pfe6yodnxqFXu2rzhFYbzkB9MdkFGplCjCT+8+YaGyThxEvB33YHP5hNzCtdqrJ/ojGUgPRZ9QwxrJLgwMOe6EKrngJsVQUfF82CvpQltH82mPDEWCBtLUOx+Mo/PFrvcDMZbgbIEIp9kOPeRLD3jRGObYuANJYaVoxir9N9N2TFbbcDHQ== verlato@prod-ui-02.pd.infn.it
  27.  
  28. write_files:  
  29.   - path: /root/install-gpu-driver.sh
  30.     permissions: 0744
  31.     content: |
  32.       ansible-playbook /etc/ansible/roles/LIP-Computing.ansible-role-nvidia/tests/install-vm.yml --extra-vars nvidia_driver_version=375.39
  33.       nvidia-smi -pm 1
  34.       nvidia-smi -am 1
  35.  
  36.   - path: /root/install-disvis.sh
  37.     permissions: 0744
  38.     content: |
  39.       curl -fsSL https://get.docker.com/ | sh
  40.       systemctl start docker
  41.       version=$(nvidia-smi | awk '/Driver Version/ {print $6}')
  42.       # Testing DisVis (~100s on Tesla K20m)
  43.       #export WDIR=/usr/local/disvis/test-cases/PRE5-PUP2-complex
  44.       #export ang=10.0
  45.       #export vox=2
  46.       #./udocker run --hostenv dis375 disvis $WDIR/O14250.pdb $WDIR/Q9UT97.pdb $WDIR/restraints.dat -g -a $ang -vs $vox -d $WDIR/example-results
  47.       # nvidia-smi --query-accounted-apps=pid,gpu_serial,gpu_name,gpu_utilization,time --format=csv
  48.       docker run --name=dis1 --device=/dev/nvidia0:/dev/nvidia0 --device=/dev/nvidia1:/dev/nvidia1 --device=/dev/nvidiactl:/dev/nvidiactl --device=/dev/nvidia-uvm:/dev/nvidia-uvm -v /root:/home indigodatacloudapps/disvis:nvdrv_$version /bin/sh -c 'export WDIR=/usr/local/disvis/test-cases/PRE5-PUP2-complex; disvis $WDIR/O14250.pdb $WDIR/Q9UT97.pdb $WDIR/restraints.dat -g -a 10.0 -vs 2 -d /home/example-results'
  49.       nvidia-smi --query-accounted-apps=pid,gpu_serial,gpu_name,gpu_utilization,time --format=csv
  50.  
  51.   - path: /root/install-powerfit.sh
  52.     permissions: 0744
  53.     content: |
  54.       sudo curl -fsSL https://get.docker.com/ | sh
  55.       sudo systemctl start docker
  56.       version=$(nvidia-smi | awk '/Driver Version/ {print $6}')
  57.       #git clone https://github.com/indigo-dc/udocker
  58.       #cd udocker
  59.       #./udocker pull indigodatacloudapps/powerfit:nvdrv_$version
  60.       #./udocker create --name=pow  indigodatacloudapps/powerfit:nvdrv_$version
  61.       # Testing PowerFit (~5m on Tesla K20m)
  62.       wget http://www.pd.infn.it/~verlato/GPU/appl-files.tgz
  63.       tar zxvf appl-files.tgz
  64.       # export MAP=/home/centos/GroEL-GroES/1046.map
  65.       # export RESOL=46.0
  66.       # export ANG=4.71
  67.       # export PDB=/home/centos/GroEL-GroES/GroES_1gru.pdb
  68.       # export TYPE="-g"
  69.       # export OUT_DIR=/home/centos/outdir
  70.       # udocker/udocker run --hostenv --bindhome pow powerfit ${MAP} ${RESOL} ${PDB} -a $ANG -l ${TYPE} -d ${OUT_DIR}
  71.       time docker run --name=pow1 --device=/dev/nvidia0:/dev/nvidia0 --device=/dev/nvidia1:/dev/nvidia1 --device=/dev/nvidiactl:/dev/nvidiactl --device=/dev/nvidia-uvm:/dev/nvidia-uvm -v /root:/home indigodatacloudapps/powerfit:nvdrv_$version /bin/sh -c 'powerfit /home/GroEL-GroES/1046.map 46.0 /home/GroEL-GroES/GroES_1gru.pdb -a 4.71 -l -g -d /home/out'
  72.       nvidia-smi --query-accounted-apps=pid,gpu_serial,gpu_name,gpu_utilization,time --format=csv
  73.  
  74. power_state:
  75.  mode: reboot
  76.  delay: "+1"
  77.  message: Bye Bye
  78.  timeout: 120
  79.  condition: True
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top