-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add two new buildbots with hardware support from Joyent. Most work from @geek. Closes #64. PR-URL: #64 Reviewed-by: Wyatt Preul <[email protected]> Reviewed-by: Rod Vagg <[email protected]>
- Loading branch information
1 parent
6a10343
commit 414fbe1
Showing
7 changed files
with
190 additions
and
0 deletions.
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
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,24 @@ | ||
# io.js Build SmartOS Setup | ||
|
||
To set up hosts, make sure you add them to your ssh config first: | ||
``` | ||
Host iojs-build-smartos-64-1 | ||
HostName 165.225.137.91 | ||
User root | ||
Host iojs-build-smartos-32-1 | ||
HostName 165.225.138.254 | ||
User root | ||
``` | ||
|
||
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 | ||
``` | ||
|
||
**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. |
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,77 @@ | ||
--- | ||
- hosts: iojs-build-smartos | ||
|
||
remote_user: root | ||
|
||
vars: | ||
- ansible_python_interpreter: "/usr/bin/env python" | ||
|
||
tasks: | ||
|
||
- include_vars: ansible-vars.yaml | ||
tags: vars | ||
|
||
- name: General | pkgin Update | ||
command: pkgin up | ||
tags: general | ||
|
||
- name: General | Install required packages | ||
command: pkgin -y in {{ item }} | ||
with_items: packages | ||
tags: general | ||
|
||
- name: User | Add {{ server_user }} group | ||
command: groupadd {{ server_user }} | ||
tags: user | ||
|
||
- name: User | Add {{ server_user }} user | ||
user: name="{{ server_user }}" shell=/bin/bash append=yes groups=staff,{{ server_user }} | ||
tags: user | ||
|
||
- name: User | Unlock {{ server_user }} user | ||
command: passwd -N {{ server_user }} | ||
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 root | ||
authorized_key: user="root" key="{{ lookup('file', '/tmp/' + item + '.keys') }}" | ||
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 | ||
command: curl -sL https://jenkins-iojs.nodesource.com/jnlpJars/slave.jar -o /home/{{ server_user }}/slave.jar | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy SMF manifest | ||
copy: src=./resources/jenkins_manifest.xml dest=/home/{{ server_user }}/jenkins_manifest.xml owner={{ server_user }} group={{ server_user }} mode=0755 | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy secrets into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{secret\}\}" replace="{{ server_secret }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy server id into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{id\}\}" replace="{{ server_id }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy destination cpu architecture into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{destcpu\}\}" replace="{{ destcpu }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Import jenkins SMF manifest | ||
command: svccfg -v import /home/{{ server_user }}/jenkins_manifest.xml | ||
tags: jenkins | ||
|
||
- name: Jenkins | Start service | ||
command: svcadm enable svc:/application/jenkins:default | ||
tags: jenkins |
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 @@ | ||
--- | ||
server_user: iojs | ||
# override through host_vars if needed. we need it since we currently | ||
# run 32-bit tests on a 64-bit host. default is 64-bit. | ||
destcpu: x64 | ||
ssh_users: | ||
- geek | ||
- rvagg | ||
- jbergstroem | ||
packages: | ||
- openjdk7 | ||
- git | ||
- gcc49 | ||
- gcc49-libs | ||
- gccmakedep | ||
- gmake | ||
- automake | ||
- libtool |
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 @@ | ||
iojs-build-smartos-* |
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,61 @@ | ||
<?xml version='1.0'?> | ||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | ||
<service_bundle type='manifest' name='jenkins'> | ||
<service name='application/jenkins' type='service' version='1'> | ||
|
||
<create_default_instance enabled='true' /> | ||
|
||
<single_instance /> | ||
|
||
<dependency name='network' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/milestone/network:default' /> | ||
</dependency> | ||
<dependency name='filesystem' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/system/filesystem/local' /> | ||
</dependency> | ||
|
||
<method_context working_directory="/home/iojs"> | ||
<method_credential user='iojs' group='iojs' privileges='basic,net_privaddr' /> | ||
<method_environment> | ||
<envvar name='NODE_COMMON_PIPE' value='/home/iojs/test.pipe' /> | ||
<envvar name='OSTYPE' value='solaris' /> | ||
<envvar name='JOBS' value='8' /> | ||
<envvar name='DESTCPU' value='{{destcpu}}' /> | ||
<envvar name='PATH' value='/usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin' /> | ||
</method_environment> | ||
</method_context> | ||
|
||
<exec_method type='method' | ||
name='start' | ||
exec='/opt/local/bin/java -Xmx512m -jar slave.jar -jnlpUrl https://jenkins-iojs.nodesource.com/computer/iojs-joyent-smartos-{{id}}/slave-agent.jnlp -secret {{secret}} >> /home/iojs/jenkins_console.log' | ||
timeout_seconds='60' /> | ||
|
||
<exec_method type="method" | ||
name="stop" | ||
exec=":kill" | ||
timeout_seconds="60" /> | ||
|
||
<exec_method name='refresh' | ||
type='method' | ||
exec=':kill -HUP' | ||
timeout_seconds='60' /> | ||
|
||
<property_group name="startd" type="framework"> | ||
<propval name="duration" type="astring" value="child"/> | ||
<propval name="ignore_error" type="astring" value="core,signal"/> | ||
</property_group> | ||
|
||
<property_group name="application" type="application"></property_group> | ||
|
||
<stability value='Evolving' /> | ||
|
||
<template> | ||
<common_name> | ||
<loctext xml:lang='C'>Jenkins Continuous Build Server</loctext> | ||
</common_name> | ||
<documentation> | ||
<doc_link name='hudson.dev.java.net' uri='http://jenkins-ci.org/' /> | ||
</documentation> | ||
</template> | ||
</service> | ||
</service_bundle> |