-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from drfloob/feat_vw
Implement Vowpal Wabbit installation for Ansible Playbook
- Loading branch information
Showing
8 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
key_pair: adam-heller | ||
instance_type: t2.micro | ||
region: us-west-2 | ||
security_group_id: sg-2b6cf950 | ||
num_instances: 2 | ||
subnet_id: subnet-d7db7ab0 | ||
tag_key_vals: | ||
Name: aj-ec2-test | ||
class: vw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: Testing apt | ||
apt: "name=make state=installed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
- name: Ensure vw's dependencies are installed | ||
become: yes | ||
apt: "name={{ item }} state=installed" | ||
with_items: | ||
- make | ||
- libboost-program-options-dev | ||
- zlib1g-dev | ||
- libboost-python-dev | ||
- clang | ||
register: vw_dependencies_deb | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Clone the vw repo | ||
become: no | ||
git: | ||
repo: 'git://github.com/JohnLangford/vowpal_wabbit.git' | ||
dest: "{{ BUILD_DIR }}" | ||
register: vw_cloned | ||
when: vw_dependencies_deb|success | ||
|
||
- name: Build vw | ||
become: no | ||
command: make CXX=clang++ prefix={{ INSTALL_DIR }} {{ item }} | ||
args: | ||
chdir: vw-git | ||
with_items: | ||
- | ||
- test | ||
when: vw_cloned|success | ||
register: vw_built | ||
|
||
- name: Install vw | ||
become: yes | ||
command: make CXX=clang++ prefix={{ INSTALL_DIR }} install | ||
args: | ||
chdir: vw-git | ||
when: vw_built|success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- name: Check if vw is installed | ||
stat: | ||
path: "{{ VW_HOME }}" | ||
register: vw | ||
tags: ['test', 'start', 'stop', 'install', 'uninstall', 'info'] | ||
|
||
- name: Install Vowpal Wabbit | ||
include: install.yml | ||
tags: install | ||
when: vw.stat.exists == False | ||
|
||
- name: Testing apt | ||
include: test.yml | ||
tags: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- name: Testing | ||
file: | ||
path: "/home/ubuntu/bort" | ||
owner: ubuntu | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BUILD_DIR: /home/ubuntu/vw-git | ||
INSTALL_DIR: /usr/local | ||
VW_HOME: /usr/local/vw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Creating host group vowpal wabbit from dynamic inventory | ||
hosts: localhost | ||
connection: local | ||
tags: ['info', 'install', 'start', 'stop', 'uninstall'] | ||
vars: | ||
vw_tag_name: "tag_{{ vw_tag | replace('-', '_') }}" | ||
tasks: | ||
- add_host: name={{ item }} groups=vw | ||
with_items: "{{ groups[vw_tag_name] }}" | ||
|
||
- name: Execute Vowpal Wabbit roles | ||
hosts: vw | ||
user: ubuntu | ||
become: true | ||
become_method: sudo | ||
roles: | ||
- role: vw |