Advertisement
marcoverl

user_data_ubuntu

May 26th, 2016
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.07 KB | None | 0 0
  1. #cloud-config
  2.  
  3. package_upgrade: true
  4.  
  5. packages:
  6. - wget
  7.  - tar
  8.  - git
  9.  - build-essential
  10.  - software-properties-common
  11.  - cmake
  12.  - python-dev
  13.  - python-pip
  14.  - Xorg
  15.  
  16. runcmd:
  17. - [ wget, "http://us.download.nvidia.com/XFree86/Linux-x86_64/352.93/NVIDIA-Linux-x86_64-352.93.run", -O, /root/NVIDIA-Linux-x86_64-352.93.run ]
  18.  - [ modprobe, -r, nouveau ]
  19.  - [ sed, -i, -e, 's/quiet/quiet rdblacklist=nouveau/g', /etc/default/grub ]
  20.  - echo 'blacklist nouveau' >/etc/modprobe.d/disable-nouveau.conf
  21.  - [ chmod, u+x, /root/NVIDIA-Linux-x86_64-352.93.run ]
  22.  - [ fallocate, -l, 1G, /swapfile ]
  23.  - [ chmod, 600, /swapfile ]
  24.  - [ mkswap, /swapfile ]
  25.  - [ swapon, /swapfile ]
  26.  - echo "/swapfile   none    swap    sw    0   0" > /etc/fstab
  27.  - [ pip, install, --upgrade, pip ]
  28.  - [ pip, install, Cython ]
  29.  
  30. final_message: "The system is finally up, after $UPTIME seconds"
  31.  
  32. write_files:
  33.   - path: /root/install-gpu-driver.sh
  34.     permissions: 744
  35.     content: |
  36.      sh /root/NVIDIA-Linux-x86_64-352.93.run -s
  37.       nvidia-smi -pm 1
  38.       nvidia-smi -am 1
  39.   - path: /root/install-disvis.sh
  40.     permissions: 744
  41.     content: |
  42.      apt-get -y install libffi-dev libfftw3-dev libfftw3-double3 libfftw3-long3 libfftw3-single3
  43.       cd /usr/include
  44.       wget http://www.pd.infn.it/~verlato/GPU/opencl-files.tgz
  45.       tar zxvf opencl-files.tgz
  46.       rm -f opencl-files.tgz
  47.       pip install mako
  48.       pip install numpy
  49.       pip install pyfftw
  50.       pip install pyopencl==2015.1
  51.       cd /root  
  52.       git clone https://github.com/clMathLibraries/clFFT.git
  53.       git clone https://github.com/haddocking/disvis.git
  54.       git clone https://github.com/geggo/gpyfft.git
  55.       cd /root/clFFT/src
  56.       cmake CMakeLists.txt
  57.       make install
  58.       cd /root/gpyfft
  59.       git checkout b462420e19a534d832a9925f01109e80d3431de2
  60.       python setup.py install
  61.       cd /root/disvis
  62.       python setup.py install
  63.       cd /home
  64.       wget http://www.pd.infn.it/~verlato/GPU/appl-files.tgz
  65.       tar zxvf appl-files.tgz
  66.       rm -f appl-files.tgz
  67.       # Testing DisVis (~20s on Tesla K20m)
  68.       # /home/run-disvisGPU.sh
  69.       # nvidia-smi --query-accounted-apps=pid,gpu_serial,gpu_name,gpu_utilization,time --format=csv
  70.  
  71.   - path: /root/install-powerfit.sh
  72.     permissions: 744
  73.     content: |
  74.      apt-get -y install libxml2-dev libxslt1-dev libffi-dev libfftw3-dev libfftw3-double3 libfftw3-long3 libfftw3-single3
  75.       cd /usr/include
  76.       wget http://www.pd.infn.it/~verlato/GPU/opencl-files.tgz
  77.       tar zxvf opencl-files.tgz
  78.       rm -f opencl-files.tgz
  79.       pip install mako
  80.       pip install numpy
  81.       pip install scipy
  82.       pip install virtualenv
  83.       pip install pyfftw
  84.       pip install pyopencl==2015.1
  85.       cd /root
  86.       git clone https://github.com/clMathLibraries/clFFT.git
  87.       git clone https://github.com/haddocking/powerfit.git
  88.       git clone https://github.com/geggo/gpyfft.git
  89.       cd /root/clFFT/src
  90.       cmake CMakeLists.txt
  91.       make install
  92.       cd /root/gpyfft
  93.       git checkout b462420e19a534d832a9925f01109e80d3431de2
  94.       python setup.py install
  95.       cd /root/powerfit
  96.       python setup.py install
  97.       cd /home
  98.       wget http://www.pd.infn.it/~verlato/GPU/appl-files.tgz
  99.       tar zxvf appl-files.tgz
  100.       rm -f appl-files.tgz
  101.       # Testing PowerFit (~90s on Tesla K20m)
  102.       # /home/run-powerfitGPU.sh
  103.       # nvidia-smi --query-accounted-apps=pid,gpu_serial,gpu_name,gpu_utilization,time --format=csv
  104.  
  105. users:
  106.   - name: ubuntu
  107.     sudo: ALL=(ALL) NOPASSWD:ALL
  108.     lock-passwd: true
  109.     ssh-import-id: ubuntu
  110.     ssh-authorized-keys:
  111.      - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuNBEiH455kxaEr8tWEjdqICI4PDnOus7hTx0Qvix05pySKQuQlSoALk8UsPSHSgFZj9ATpgFFSepACn0hnHu9DISGHn6aIWE8snUc5UctWMlzNoutTngooSjYQxRPZTfHcntjgd5T0Amfqgn1PjO8qaseKLmsR87FhG7Pfe6yodnxqFXu2rzhFYbzkB9MdkFGplCjCT+8+YaGyThxEvB33YHP5hNzCtdqrJ/ojGUgPRZ9QwxrJLgwMOe6EKrngJsVQUfF82CvpQltH82mPDEWCBtLUOx+Mo/PFrvcDMZbgbIEIp9kOPeRLD3jRGObYuANJYaVoxir9N9N2TFbbcDHQ== verlato@prod-ui-02.pd.infn.it
  112.  
  113. power_state:
  114.  mode: reboot
  115.  message: Bye Bye
  116.  timeout: 600
  117.  condition: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement