Skip to content

Commit

Permalink
fix conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
enxebre committed May 9, 2015
2 parents 37bbd4f + 7bf0378 commit 111ba7f
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 57 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Apollo
=========

[![Join the chat at https://gitter.im/Capgemini/Apollo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Capgemini/Apollo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![wercker status](https://app.wercker.com/status/71503ff3fde8b162b72e2cc094f52679/s/master "wercker status")](https://app.wercker.com/project/bykey/71503ff3fde8b162b72e2cc094f52679)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

Expand Down Expand Up @@ -43,7 +45,7 @@ support see our [roadmap](docs/roadmap.md).

Apollo is in alpha!

While the concepts and base architectural components of Apollo are not expected to change drastically, the project is still under heavy development. Expect bugs, design and API changes as we bring it to a stable, production ready, multi-cloud available product.
While the concepts and base architectural components of Apollo are not expected to change drastically, the project is still under heavy development. Expect bugs, design and feature changes as we bring it to a stable, production ready, multi-cloud available thing!

## Architecture

Expand Down
7 changes: 4 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Mesos master nodes
master_n = conf['master_n']
master_infos = (1..master_n).map do |i|
master_infos = (1..3).map do |i|
node = {
:zookeeper_id => i,
:hostname => "master#{i}",
:ip => conf['master_ipbase'] + "#{10+i}",
:ip => conf["master#{i}_ip"],
:mem => conf['master_mem'],
:cpus => conf['master_cpus'],
}
Expand All @@ -53,7 +53,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
slave_infos = (1..slave_n).map do |i|
node = {
:hostname => "slave#{i}",
:ip => conf['slave_ipbase'] + "#{10+i}",
:ip => conf["slave#{i}_ip"],
:mem => conf['slave_mem'],
:cpus => conf['slave_cpus'],
}
Expand Down Expand Up @@ -110,6 +110,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
mesos_local_address: node[:ip],
consul_bind_addr: node[:ip],
consul_dc: "vagrant",
registrator_uri: "consul://#{node[:ip]}:8500"
}
ansible.groups = ansible_groups
end
Expand Down
7 changes: 3 additions & 4 deletions docs/getting-started-guides/digitalocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
droplets. Execute ```ssh-keygen -t rsa``` to create a key pair.


### Cluster Turnup
### Cluster Startup

#### Download Apollo

Expand All @@ -22,7 +22,6 @@ droplets. Execute ```ssh-keygen -t rsa``` to create a key pair.
2. ```cd apollo```

#### Build the base image in Atlas
```

We are using [Atlas](https://atlas.hashicorp.com) to store artifacts (images) for
builds.
Expand Down Expand Up @@ -55,7 +54,7 @@ To generate a v1 API credentials see [https://www.digitalocean.com/community/tut
```
APOLLO_PROVIDER=digitalocean
# Path to your public ssh key (created in step 8 above).
# Path to your public ssh key (created in prerequisite step 8 above).
DIGITALOCEAN_SSH_KEY=
# Atlas variables.
Expand All @@ -65,7 +64,7 @@ ATLAS_ARTIFACT_MASTER=
ATLAS_ARTIFACT_SLAVE=
```

#### Turn up the cluster
#### Start up the cluster
```
sh bootstrap/apollo-launch.sh
```
Expand Down
11 changes: 11 additions & 0 deletions docs/getting-started-guides/vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,14 @@ sh bootstrap/apollo-down.sh
#### Interacting with your Apollo cluster with Vagrant

You can interact with your Apollo cluster via the normal vagrant commands - ```vagrant up``` ```vagrant halt``` ```vagrant destroy``` etc...

#### Adding more slave machines

Edit ``vagrant.yml```

Change ```slave_n:``` to the desired number of slave machines.

Add a ```slave2_ip:``` replacing 2 with the slave number.

In the ```Vagrantfile``` update the ```ansible_groups``` to reference the new
slave hostnames added (will be in the format slave2, slave3, etc...)
2 changes: 2 additions & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Mesos Frameworks
- [ ] Cassandra framework
- [ ] Spark framework
- [ ] Storm framework
- [ ] Mysos framework
- [ ] Elastiseach framework

Providers
---------
Expand Down
3 changes: 0 additions & 3 deletions packer/scripts/ubuntu/install_mesos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ sudo service mesos-master stop || true
echo manual | sudo tee /etc/init/mesos-master.override >/dev/null
sudo service mesos-slave stop || true
echo manual | sudo tee /etc/init/mesos-slave.override >/dev/null

echo 'docker,mesos' | sudo tee /etc/mesos-slave/containerizers >/dev/null
echo '10mins' | sudo tee /etc/mesos-slave/executor_registration_timeout >/dev/null
10 changes: 0 additions & 10 deletions packer/tests/spec/mesos_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,3 @@
it { should be_file }
end
end

describe file('/etc/mesos-slave/containerizers') do
it { should be_file }
its(:content) { should match /docker,mesos/ }
end

describe file('/etc/mesos-slave/executor_registration_timeout') do
it { should be_file }
its(:content) { should match /10mins/ }
end
3 changes: 2 additions & 1 deletion packer/ubuntu-14.04_amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"ssh_name": "vagrant",
"ssh_pass": "vagrant",
"hostname": "ubuntu",
"version": "0.22.0",
"mesos_version": "0.22.0-1.0.ubuntu1404",
"consul_version": "0.5.0",
"weave_version": "v0.10.0",
Expand Down Expand Up @@ -74,7 +75,7 @@
"post-processors": [
[{
"type": "vagrant",
"output": "build/ubuntu-14.04_amd64_{{.Provider}}/apollo-mesos-{{user `mesos_version`}}_amd64_{{.Provider}}.box",
"output": "build/ubuntu-14.04_amd64_{{.Provider}}/apollo-mesos-ubuntu-14.04-amd64-{{.Provider}}.box",
"keep_input_artifact": true,
"compression_level": 9
},
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ansible==1.9.0.1
ansible-lint
dopy
boto
10 changes: 5 additions & 5 deletions roles/consul/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
# tasks file for consul
- name: remove consul override
command: /bin/rm -f /etc/init/consul.override
file: path=/etc/init/consul.override state=absent

- name: start consul
service: name=consul state=started

- name: configure consul
sudo: yes
Expand All @@ -20,11 +23,8 @@
tags:
- consul

- name: start consul
service: name=consul state=started

- name: remove consul-join override
command: /bin/rm -f /etc/init/consul-join.override
file: path=/etc/init/consul-join.override state=absent
when: consul_join is defined

- name: configure consul-join
Expand Down
2 changes: 1 addition & 1 deletion roles/dnsmasq/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# tasks file for dnsmasq
- name: remove dnsmasq override
command: /bin/rm -f /etc/init/dnsmasq.override
file: path=/etc/init/dnsmasq.override state=absent

- name: ensure dnsmasq is running (and enable it at boot)
service: name=dnsmasq state=started enabled=yes
Expand Down
2 changes: 1 addition & 1 deletion roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# tasks file for docker
- name: remove docker override
command: /bin/rm -f /etc/init/docker.override
file: path=/etc/init/docker.override state=absent

- name: ensure docker is running (and enable it at boot)
service: name=docker state=started enabled=yes
4 changes: 4 additions & 0 deletions roles/mesos/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ mesos_zookeeper_group: zookeeper_servers
mesos_master_port: 5050
consul_dir: /etc/consul.d
mesos_local_address: "{{ ansible_default_ipv4.address }}"
mesos_executor_registration_timeout: 10mins
mesos_cluster_name: "Cluster01"
mesos_containerizers: "docker,mesos"
mesos_resources: "ports(*):[31000-32000]"
25 changes: 23 additions & 2 deletions roles/mesos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
when: mesos_install_mode == "master"

- name: remove mesos-master override
command: /bin/rm -f /etc/init/mesos-master.override
file: path=/etc/init/mesos-master.override state=absent
when: mesos_install_mode == "master"

- name: Set Mesos Master Cluster name
Expand Down Expand Up @@ -62,7 +62,28 @@
when: mesos_install_mode == "slave"

- name: remove mesos-slave override
command: /bin/rm -f /etc/init/mesos-slave.override
file: path=/etc/init/mesos-slave.override state=absent
when: mesos_install_mode == "slave"

- name: set executor registration timeout
sudo: yes
copy:
dest: /etc/mesos-slave/executor_registration_timeout
content: "{{ mesos_executor_registration_timeout }}"
when: mesos_install_mode == "slave"

- name: set containerizers
sudo: yes
copy:
dest: /etc/mesos-slave/containerizers
content: "{{ mesos_containerizers }}"
when: mesos_install_mode == "slave"

- name: set slave resources
sudo: yes
copy:
dest: /etc/mesos-slave/resources
content: "{{ mesos_resources }}"
when: mesos_install_mode == "slave"

- name: Set Mesos Slave ip
Expand Down
2 changes: 1 addition & 1 deletion roles/registrator/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# defaults file for registrator
registrator_image: "gliderlabs/registrator:master"
registrator_uri: "consul://consul.service.consul:8500"
registrator_uri: "consul://{{ ansible_default_ipv4.address }}:8500"
hostname: "{{ ansible_all_ipv4_addresses }}"

1 change: 1 addition & 0 deletions roles/weave/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ weave_launch_peers: "
{%- endfor -%}
{{ weave_peers|join(' ') }}
"
weave_docker_opts: "--bridge=weave --fixed-cidr={{ weave_docker_subnet }} --dns 172.17.42.1 --dns 8.8.8.8 --dns-search service.{{ consul_domain }}"
2 changes: 1 addition & 1 deletion roles/weave/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

- name: configure weave bridge for docker
sudo: yes
lineinfile: "dest=/etc/default/docker state=present regexp=^DOCKER_OPTS= line='DOCKER_OPTS=\"--bridge=weave --fixed-cidr={{ weave_docker_subnet }}\"'"
lineinfile: "dest=/etc/default/docker state=present regexp=^DOCKER_OPTS= line='DOCKER_OPTS=\"{{ weave_docker_opts }}\"'"
notify:
- Restart docker
- Weave launch
Expand Down
14 changes: 0 additions & 14 deletions terraform/aws/nat-server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@ resource "aws_instance" "nat" {
user = "ubuntu"
key_file = "${var.key_file}"
}
provisioner "file" {
source = "${var.key_file}"
destination = "/home/ubuntu/.ssh/ec2-key.pem"
}
provisioner "remote-exec" {
inline = [
"chmod 600 /home/ubuntu/.ssh/ec2-key.pem",
"echo \"Host ip-*\" >> /home/ubuntu/.ssh/config",
"echo \" IdentityFile /home/ubuntu/.ssh/ec2-key.pem\" >> /home/ubuntu/.ssh/config",
"echo \" StrictHostKeyChecking no\" >> /home/ubuntu/.ssh/config",
"echo \" UserKnownHostsFile=/dev/null\" >> /home/ubuntu/.ssh/config",
"echo \" LogLevel ERROR\" >> /home/ubuntu/.ssh/config",
]
}
provisioner "remote-exec" {
inline = [
"sudo iptables -t nat -A POSTROUTING -j MASQUERADE",
Expand Down
13 changes: 9 additions & 4 deletions vagrant.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
mesos_version: "0.22.1"
mesos_version: "0.22.0"

# The numbers of servers
#########################
master_n: 3 # hostname will be master1,master2,…
slave_n: 1 # hostname will be slave1,slave2,…

# Memory and Cpus setting
Expand All @@ -12,5 +11,11 @@ master_cpus: 1
slave_mem : 1024
slave_cpus : 2

master_ipbase: "172.31.1."
slave_ipbase : "172.31.2."
# Master IPs
master1_ip: "172.31.1.11"
master2_ip: "172.31.1.12"
master3_ip: "172.31.1.13"

# Slave IPs - must be in the same private address range as the master instances
# See http://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces
slave1_ip: "172.31.1.14"
22 changes: 16 additions & 6 deletions wercker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
box: wercker/ruby
box: wercker/python
no-response-timeout: 15
build:
steps:
- bundle-install
- install-packages:
packages: wget unzip
- pip-install
- script:
name: install packer
cwd: packer/
Expand All @@ -14,10 +14,20 @@ build:
./packer version
- script:
cwd: packer/
name: validate packer template
name: validate packer template for AMI
code: ./packer validate ubuntu-14.04_amd64-amis.json
- script:
name: build image
cwd: packer/
code: |
./packer build ubuntu-14.04_amd64-amis.json
name: validate packer template for Digitalocean
code: ./packer validate ubuntu-14.04_amd64-droplet.json
- script:
cwd: packer/
name: validate packer template for Vagrant
code: ./packer validate ubuntu-14.04_amd64.json
- script:
cwd: packer/
name: validate packer template for Google
code: ./packer validate ubuntu-14.04_amd64-google.json
- capgemini/ansible-lint:
name: run ansible-lint against the site.yml playbook
playbook: site.yml

0 comments on commit 111ba7f

Please sign in to comment.