-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tpetr
committed
Feb 17, 2015
1 parent
4251f15
commit a43cd23
Showing
19 changed files
with
369 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
\#*# | ||
*# | ||
.#* | ||
.*~ | ||
*~ | ||
**/.DS_Store | ||
*.sw[po] | ||
tags | ||
TAGS | ||
Session.vim | ||
.svn | ||
*.dSYM | ||
*.log | ||
*.dvi | ||
*.aux | ||
*.elc | ||
.zshrc_local | ||
.zsh_alias | ||
samples | ||
|
||
.vim/bundle/ | ||
.vim/.netrwhist | ||
|
||
# Eclipse | ||
.classpath | ||
.settings | ||
.metadata | ||
.project | ||
.hsproject | ||
.dist-scion | ||
Servers | ||
target | ||
|
||
# cabal | ||
dist | ||
|
||
# SpringSource Tool Suite | ||
.springBeans | ||
|
||
# IntelliJ IDEA | ||
*.iml | ||
*.ipr | ||
*.iws | ||
*.idea | ||
.idea | ||
|
||
# Simple Build Tool | ||
project/boot | ||
project/plugins/project | ||
lib_managed | ||
src_managed | ||
target | ||
|
||
#ensime | ||
.ensime | ||
.ensime~ | ||
|
||
# R app | ||
**/.Rapp.history | ||
|
||
.kitchen/* | ||
Gemfile.lock |
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 @@ | ||
--- | ||
driver: | ||
name: vagrant | ||
require_chef_omnibus: 11.16.4 | ||
|
||
provisioner: | ||
name: chef_solo | ||
encrypted_data_bag_secret_key_path: <%= ENV['HOME'] %>/.chef/encrypted_data_bag_secret | ||
|
||
platforms: | ||
- name: ubuntu-14.04 | ||
driver_config: | ||
customize: | ||
cpus: 4 | ||
memory: 1536 | ||
network: | ||
- - private_network | ||
- ip: '192.168.33.10' | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[singularity::default] | ||
attributes: |
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 @@ | ||
source 'https://supermarket.getchef.com' | ||
|
||
metadata |
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,20 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test, :development do | ||
gem 'rake' | ||
end | ||
|
||
group :test do | ||
gem 'berkshelf', '~> 3.2' | ||
end | ||
|
||
group :test, :integration do | ||
gem 'test-kitchen', | ||
github: 'test-kitchen/test-kitchen', | ||
tag: '4dc905a74bd86257e9f01bd91b06c0c18515763c' | ||
gem 'serverspec', '~> 2.7' | ||
end | ||
|
||
group :test, :vagrant do | ||
gem 'kitchen-vagrant', '~> 0.15' | ||
end |
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,8 @@ | ||
cookbook-singularity | ||
==================== | ||
|
||
This cookbook provides the dependencies for the Singularity Mesos framework: | ||
|
||
- ZooKeeper | ||
- Mesos | ||
- MySQL |
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,49 @@ | ||
if node[:network][:interfaces][:eth1] | ||
private_ip = node[:network][:interfaces][:eth1][:addresses].detect{|k,v| v[:family] == "inet" }.first | ||
else | ||
private_ip = node[:network][:interfaces][:eth0][:addresses].find do |_k, v| | ||
v[:family] == 'inet' | ||
end.first | ||
end | ||
|
||
default[:singularity] = { | ||
:database => { | ||
:db_name => "singularity", | ||
:username => "singularity", | ||
:password => "9thlevel" | ||
}, | ||
} | ||
|
||
default[:mesos] = { | ||
:package_version => "0.21.0-1.0.ubuntu1404", | ||
:common => { | ||
:ip => private_ip, | ||
}, | ||
:master => { | ||
:cluster => 'vagrant-singularity', | ||
}, | ||
:slave => { | ||
:containerizers => 'docker,mesos', | ||
:switch_user => 'false' | ||
}, | ||
:slave_resources => {}, | ||
:slave_attributes => {} | ||
} | ||
|
||
default[:docker] = { | ||
:enabled => true, | ||
:package_version => "1.0.1~dfsg1-0ubuntu1~ubuntu0.14.04.1", | ||
} | ||
|
||
default[:mysql] = { | ||
:port => '3306', | ||
:bind_address => '0.0.0.0', | ||
:version => '5.5', | ||
} | ||
|
||
override['java']['install_flavor'] = "oracle" | ||
override['java']['jdk_version'] = "7" | ||
override['java']['oracle']['accept_oracle_download_terms'] = true | ||
override['java']['set_default'] = true | ||
set['java']['ark_timeout'] = 10 | ||
set['java']['ark_retries'] = 3 |
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 'singularity' | ||
maintainer 'Tom Petr' | ||
maintainer_email 'tpetr@hubspot.com' | ||
license 'All rights reserved' | ||
description 'Installs Singularity dependencies (mesos, zk, mysql)' | ||
version '0.6.0' | ||
supports 'ubuntu' | ||
|
||
depends 'apt' | ||
depends 'mysql', '6.0.13' | ||
depends 'mysql2_chef_gem' | ||
depends 'database' | ||
depends 'hostsfile' | ||
depends 'java' |
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,6 @@ | ||
include_recipe "singularity::hosts" | ||
include_recipe "singularity::mesos" | ||
include_recipe "singularity::mesos_master" | ||
include_recipe "singularity::mesos_slave" | ||
include_recipe "singularity::mysql" | ||
include_recipe "singularity::java" |
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,9 @@ | ||
docker_enabled = node[:docker][:enabled] | ||
docker_package_version = node[:docker][:package_version] | ||
|
||
if docker_enabled | ||
apt_package "docker.io" do | ||
action :install | ||
version docker_package_version | ||
end | ||
end |
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,8 @@ | ||
hostsfile_entry '127.0.1.1' do | ||
action :remove | ||
end | ||
|
||
hostsfile_entry node[:mesos][:common][:ip] do | ||
hostname node['hostname'] | ||
action :create | ||
end |
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 @@ | ||
include_recipe "java" | ||
|
||
apt_package "maven" do | ||
action :install | ||
end |
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,27 @@ | ||
apt_repository "mesosphere" do | ||
uri "http://repos.mesosphere.io/ubuntu" | ||
distribution node['lsb']['codename'] | ||
components ["main"] | ||
end | ||
|
||
apt_package "mesos" do | ||
action :install | ||
version node[:mesos][:package_version] | ||
options "-y --force-yes" # ghetto | ||
end | ||
|
||
directory '/etc/mesos' do | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
end | ||
|
||
node[:mesos][:common].each do |key, value| | ||
file "/etc/mesos/#{key}" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
action :create | ||
content value | ||
end | ||
end |
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,20 @@ | ||
directory '/etc/mesos-master' do | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
end | ||
|
||
node[:mesos][:master].each do |key, value| | ||
file "/etc/mesos-master/#{key}" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
action :create | ||
content value | ||
end | ||
end | ||
|
||
service "mesos-master" do | ||
provider Chef::Provider::Service::Upstart | ||
action :start | ||
end |
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,58 @@ | ||
include_recipe 'singularity::docker' | ||
|
||
directory '/etc/mesos-slave' do | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
end | ||
|
||
node[:mesos][:slave].each do |key, value| | ||
file "/etc/mesos-slave/#{key}" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
action :create | ||
content value | ||
end | ||
end | ||
|
||
if node[:mesos][:slave_resources] | ||
directory '/etc/mesos-slave/resources' do | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
end | ||
|
||
node[:mesos][:slave_resources].each do |key, value| | ||
file "/etc/mesos-slave/resources/#{key}" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
action :create | ||
content value | ||
end | ||
end | ||
end | ||
|
||
if node[:mesos][:slave_attributes] | ||
directory '/etc/mesos-slave/attributes' do | ||
owner 'root' | ||
group 'root' | ||
action :create | ||
end | ||
|
||
node[:mesos][:slave_attributes].each do |key, value| | ||
file "/etc/mesos-slave/attributes/#{key}" do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
action :create | ||
content value | ||
end | ||
end | ||
end | ||
|
||
service "mesos-slave" do | ||
provider Chef::Provider::Service::Upstart | ||
action :start | ||
end |
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,35 @@ | ||
mysql2_chef_gem 'default' do | ||
action :install | ||
end | ||
|
||
mysql_service 'default' do | ||
port node[:mysql][:port] | ||
bind_address node[:mysql][:bind_address] | ||
version node[:mysql][:version] | ||
initial_root_password node[:mysql][:server_root_password] | ||
action [:create, :start] | ||
end | ||
|
||
mysql_client 'default' do | ||
action :create | ||
end | ||
|
||
mysql_connection_info = { | ||
:host => '127.0.0.1', | ||
:username => 'root', | ||
:password => node[:mysql][:server_root_password] | ||
} | ||
|
||
mysql_database node[:singularity][:database][:db_name] do | ||
connection mysql_connection_info | ||
action :create | ||
end | ||
|
||
mysql_database_user node[:singularity][:database][:username] do | ||
connection mysql_connection_info | ||
password node[:singularity][:database][:password] | ||
database_name node[:singularity][:database][:db_name] | ||
host '%' | ||
privileges [:all] | ||
action [:grant] | ||
end |
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,9 @@ | ||
# Encoding: utf-8 | ||
require 'spec_helper' | ||
|
||
describe 'Filesystem' do | ||
describe file('/home/singularity') do | ||
it { should be_directory } | ||
it { should be_owned_by 'singularity' } | ||
end | ||
end |
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,4 @@ | ||
# Encoding: utf-8 | ||
require 'serverspec' | ||
|
||
set :backend, :exec |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source 'https://supermarket.getchef.com' | ||
|
||
cookbook 'singularity', github: 'HubSpot/cookbook-singularity' | ||
cookbook 'singularity', path: '../cookbook' |
Oops, something went wrong.