Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added raspberry pi config #80

Merged
merged 1 commit into from
Apr 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions setup/ansible-inventory
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ iojs-build-freebsd101-64-1
iojs-build-containers-1
iojs-build-containers-2

[iojs-raspbian]
iojs-ns-pi1-1
iojs-ns-pi1-2
iojs-ns-pi1p-1
iojs-ns-pi2-1
iojs-ns-pi2-2
iojs-ns-pi2-3
iojs-ns-pi2-4

[iojs-www]
iojs-www

Expand Down
26 changes: 26 additions & 0 deletions setup/raspberry-pi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# io.js Build Raspberry Pi Setup

For setting up Raspberry Pi boxes

```text
Host iojs-ns-pi1-1
HostName xx.xx.xx.xx
User pi
...
```

Note that these hostnames are also used in the *ansible-inventory* file. The IP addresses will need to be updated each time the servers are reprovisioned.

To set up a host, run:

```text
$ ansible-playbook -i ../ansible-inventory ansible-playbook.yaml
```

Start-up of the Jenkins slaves is manual (for now), run:

```text
$ ssh iojs@iojs-ns-pi1-1 ./start.sh
```

**Users**: The ansible-vars.yaml file contains a list of users who's GitHub public keys are pulled and placed into authorized_keys for both root and iojs users. This file should be updates when new users are added to the build project who are able to help maintain the containerized builds.
80 changes: 80 additions & 0 deletions setup/raspberry-pi/ansible-playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
- hosts: iojs-raspbian
sudo: yes

tasks:

- include_vars: ansible-vars.yaml
tags: vars

- name: General | APT Update
apt: update_cache=yes
tags: general

- name: General | APT Upgrade
apt: upgrade=dist
tags: general

- name: General | Install required packages
apt: name={{ item }} update_cache=yes state=latest
with_items: packages
tags: general

- name: General | update-alternatives for gcc
alternatives: name=gcc link=/usr/bin/gcc path=/usr/bin/gcc-4.8

- name: General | update-alternatives for cc
alternatives: name=cc link=/usr/bin/cc path=/usr/bin/gcc-4.8

- name: General | update-alternatives for g++
alternatives: name=g++ link=/usr/bin/g++ path=/usr/bin/g++-4.8

- name: General | update-alternatives for c++
alternatives: name=c++ link=/usr/bin/c++ path=/usr/bin/g++-4.8

- name: General | update-alternatives for cpp
alternatives: name=cpp link=/usr/bin/cpp path=/usr/bin/g++-4.8

- name: General | Increase file descriptor limits
lineinfile: dest=/etc/security/limits.conf line="{{ item }}"
with_items:
- "* hard nofile 500000"
- "* soft nofile 500000"
- "root hard nofile 500000"
- "root soft nofile 500000"
tags: general

- name: User | Add {{ server_user }} user
user: name="{{ server_user }}" shell=/bin/bash
tags: user

- name: User | Download pubkey(s)
get_url: url=https://github.com/{{ item }}.keys dest=/tmp/{{ item }}.keys
delegate_to: 127.0.0.1
with_items: ssh_users
tags: user

- name: General | Create authorized_keys for {{ server_user }}
authorized_key: user="{{ server_user }}" key="{{ lookup('file', '/tmp/' + item + '.keys') }}"
with_items: ssh_users
tags: user

- name: Jenkins | Download Jenkins' slave.jar to {{ server_user }}
command: curl -sL https://jenkins-iojs.nodesource.com/jnlpJars/slave.jar -o /home/{{ server_user }}/slave.jar
tags: jenkins

- name: Jenkins | Copy start.sh script
copy: src=./resources/start.sh dest=/home/{{ server_user }}/start.sh owner={{ server_user }} group={{ server_user }} mode=0755
tags: jenkins

- name: Jenkins | Copy secrets to start.sh script
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{secret\}\}" replace="{{ server_secret }}"
tags: jenkins

- name: Jenkins | Copy server ids to start.sh script
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{id\}\}" replace="{{ server_id }}"
tags: jenkins

- name: Jenkins | Copy arch to start.sh script
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{server_arch\}\}" replace="{{ server_arch }}"
tags: jenkins
17 changes: 17 additions & 0 deletions setup/raspberry-pi/ansible-vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
server_user: iojs
ssh_users:
- rvagg
- wblankenship
- jbergstrom
packages:
- openjdk-7-jre
- python-all
- python-software-properties
- automake
- libtool
- curl
- git
- gcc-4.8
- g++-4.8
- ccache
1 change: 1 addition & 0 deletions setup/raspberry-pi/host_vars/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iojs-*
4 changes: 4 additions & 0 deletions setup/raspberry-pi/resources/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

rm -f nohup.out
ARCH={{server_arch}} DESTCPU=arm PATH=/usr/lib/ccache/:$PATH JOBS=1 NODE_COMMON_PIPE=/home/iojs/test.pipe OSTYPE=linux-gnu nohup java -jar slave.jar -jnlpUrl https://jenkins-iojs.nodesource.com/computer/iojs-nodesource-raspbian-wheezy-{{id}}/slave-agent.jnlp -secret {{secret}} &