-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
104 lines (85 loc) · 2.81 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
# Playbook machine-learning-basecamp
- hosts: all
vars:
miniconda_home: ~/miniconda
tasks:
- name: Download miniconda python distribution
get_url:
url: http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
dest: /tmp/miniconda.sh
mode: 0755
- name: Execute the miniconda setup script
shell: /tmp/miniconda.sh -b -p {{ miniconda_home }} creates={{ miniconda_home }} executable=/bin/bash
notify:
- remove miniconda setup script
- name: Add miniconda to the PATH
shell: "echo '{{ item }}' >> ~/.bashrc executable=/bin/bash"
with_items:
- "export PATH={{ miniconda_home }}/bin:$PATH"
- name: Update conda to latest version
shell: "{{ miniconda_home }}/bin/conda update conda --yes -q executable=/bin/bash"
- name: download spark
become: true
become_method: sudo
get_url: url=http://d3kbcqa49mib13.cloudfront.net/spark-2.0.2-bin-hadoop2.7.tgz dest=/opt/
- name: unzip spark
become: true
become_method: sudo
unarchive: copy=no src=/opt/spark-2.0.2-bin-hadoop2.7.tgz dest=/opt
environment:
SPARK_HOME: /opt/spark-2.0.2-bin-hadoop2.7
- name: set SPARK_HOME
shell: "echo '{{ item }}' >> ~/.bashrc executable=/bin/bash"
with_items:
- "export SPARK_HOME=/opt/spark-2.0.2-bin-hadoop2.7"
- name: update apt cache
become: true
become_method: sudo
apt: update_cache=yes
- name: install git
become: true
become_method: sudo
apt: name=git state=present
- name: install java
become: true
become_method: sudo
apt: name=openjdk-7-jre state=present
environment:
JAVA_HOME: /usr/lib/jvm/java-7-openjdk
- name: clone torch
git:
repo: https://github.com/torch/distro.git
accept_hostkey: true
dest: ~/torch
recursive: yes
- name: install torch
shell: bash install-deps; ./install.sh
args:
chdir: ~/torch
- name: install libzmq3-dev
become: true
become_method: sudo
apt: name=libzmq3-dev state=present
- name: install libssl-dev
become: true
become_method: sudo
apt: name=libssl-dev state=present
- name: install python-zmq
become: true
become_method: sudo
apt: name=python-zmq state=present
- name: clone iTorch
git:
repo: https://github.com/facebook/iTorch.git
accept_hostkey: true
dest: ~/iTorch
# - name: install iTorch
# shell: luarocks make
# args:
# chdir: ~/iTorch
# - name: config Jupyter
# command: cp /vagrant/jupyter_notebook_config.py ~/.jupyter/jupyter_notebook_config.py
handlers:
- name: remove miniconda setup script
file: name=/tmp/miniconda.sh state=absent