Skip to content

Commit 0b7422b

Browse files
Merge branch 'master' into swarm-api
2 parents e8da1a3 + fb5e25c commit 0b7422b

30 files changed

Lines changed: 533 additions & 70 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ It is the custom at Runnable to play a song to the entire team when deploying. F
7777

7878
[runnable-angular: Push it to the limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA)
7979

80-
[mavis: Fairy Tail theme song](https://www.youtube.com/watch?v=kIwmrk7LoDk)
80+
[mavis: Fairy Tail theme song](https://www.youtube.com/watch?v=R4UFCTMrV-o)
8181

8282
[khronos: Time After Time - Cyndi Lauper](https://www.youtube.com/watch?v=VdQY7BusJNU)
8383

ansible/beta-hosts/docks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var params = {
1414
// Only search for docks in the cluster security group
1515
{
1616
Name: 'instance.group-id',
17-
Values: ['sg-87ca04e3']
17+
Values: ['sg-d6e684b2']
1818
},
1919
// Only fetch instances that are tagged as docks
2020
{

ansible/beta-hosts/hosts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ beta-redis-slave
6262
[shiva]
6363
beta-services
6464

65+
[metis]
66+
beta-services
67+
6568
[registry]
6669
beta-registry
6770

ansible/docks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
- hosts: charon
32
- hosts: redis
43
- hosts: redis-slave
54
- hosts: neo4j
@@ -11,8 +10,10 @@
1110
roles:
1211
- { role: docker, tags: "docker" }
1312
- { role: iptables, tags: "iptables, security" }
13+
- { role: datadog }
1414

1515
- include: krain.yml
1616
- include: filibuster.yml
1717
- include: sauron.yml
1818
- include: image-builder.yml
19+
- include: charon.yml

ansible/gamma-hosts/docks.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
var aws = require('aws-sdk');
6+
var ec2 = new aws.EC2({
7+
accessKeyId: 'AKIAJ3RCYU6FCULAJP2Q',
8+
secretAccessKey: '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',
9+
region: 'us-west-2'
10+
});
11+
12+
var params = {
13+
Filters: [
14+
// Only search for docks in the cluster security group
15+
{
16+
Name: 'instance.group-id',
17+
Values: ['sg-87ca04e3']
18+
},
19+
// Only fetch instances that are tagged as docks
20+
{
21+
Name: 'tag:role',
22+
Values: ['dock']
23+
},
24+
// Only fetch running instances
25+
{
26+
Name: 'instance-state-name',
27+
Values: ['running']
28+
}
29+
]
30+
};
31+
32+
ec2.describeInstances(params, function (err, data) {
33+
if (err) {
34+
console.error("An error occurred: ", err);
35+
process.exit(1);
36+
}
37+
38+
// Get a set of instances from the describe response
39+
var instances = [];
40+
data.Reservations.forEach(function (res) {
41+
res.Instances.forEach(function (instance) {
42+
instances.push(instance);
43+
});
44+
});
45+
46+
// Map the instances to their private ip addresses
47+
// NOTE This will work locally because of the wilcard ssh proxy in the config
48+
var hosts = instances.map(function (instance) {
49+
return instance.PrivateIpAddress;
50+
});
51+
52+
var hostVars = {};
53+
instances.forEach(function (instance) {
54+
for (var i = 0; i < instance.Tags.length; i++) {
55+
if (instance.Tags[i].Key === 'org') {
56+
hostVars[instance.PrivateIpAddress] = {
57+
host_tags: instance.Tags[i].Value + ',build,run'
58+
};
59+
}
60+
}
61+
});
62+
63+
// Output the resulting JSON
64+
// NOTE http://docs.ansible.com/ansible/developing_inventory.html
65+
console.log(JSON.stringify(
66+
{
67+
docks: {
68+
hosts: hosts
69+
},
70+
_meta : {
71+
hostvars : hostVars
72+
}
73+
}
74+
));
75+
});

ansible/gamma-hosts/hosts

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[bastion]
2+
gamma-bastion
3+
4+
[hipache]
5+
gamma-hipache httpsCheckForBackend80=false prependIncomingPort=true subDomainDepth=4
6+
gamma-userland-hipache domain=runnable.ninja httpsCheckForBackend80=true prependIncomingPort=true subDomainDepth=3
7+
8+
[mongodb]
9+
gamma-mongo-us-west-2a
10+
gamma-mongo-us-west-2b
11+
gamma-mongo-us-west-2c
12+
13+
[neo4j]
14+
gamma-neo4j
15+
16+
[api_group:children]
17+
worker
18+
api
19+
20+
[api]
21+
gamma-api
22+
23+
[worker]
24+
gamma-api
25+
26+
[eru]
27+
gamma-services
28+
29+
[navi]
30+
gamma-services
31+
32+
[charon]
33+
gamma-services
34+
35+
[khronos]
36+
gamma-services
37+
38+
[mavis]
39+
gamma-services
40+
41+
[optimus]
42+
gamma-services
43+
44+
[detention]
45+
gamma-services
46+
47+
[palantiri]
48+
gamma-services
49+
50+
[rabbitmq]
51+
gamma-rabbit
52+
53+
[web]
54+
gamma-web
55+
56+
[redis]
57+
gamma-redis
58+
59+
[redis-slave]
60+
gamma-redis-slave
61+
62+
[shiva]
63+
gamma-services
64+
65+
[registry]
66+
gamma-registry
67+
68+
[swarm-manager]
69+
gamma-services
70+
71+
[docks]
72+
73+
[gamma:children]
74+
bastion
75+
hipache
76+
mongodb
77+
api
78+
web
79+
redis
80+
redis-slave
81+
docks
82+
registry
83+
neo4j
84+
navi
85+
charon
86+
khronos
87+
mavis
88+
optimus
89+
rabbitmq
90+
eru
91+
shiva
92+
swarm-manager
93+
94+
[targets]
95+
localhost ansible_connection=local bastion_name=gamma-bastion

ansible/gamma-hosts/variables

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[api_group:vars]
2+
api_aws_access_key_id=AKIAIDC4WVMTCGV7KRVQ
3+
api_aws_secret_access_key=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
4+
api_github_client_id=baa5c868b6d17d7ae002
5+
api_github_client_secret=ad4f8527ae98d7eea15a32ee5abbead5c9a25abc
6+
api_github_deploy_keys_bucket=runnable.deploykeys.production-gamma
7+
api_hello_runnable_github_token=88ddc423c2312d02a8bbcaad76dd4c374a30e4af
8+
api_mixpanel_app_id=c41affa4b08818443365c526cbb51606
9+
api_mongo_auth=api:oW4c7x9Wiv28oiNBy2Bc
10+
api_mongo_database=gamma
11+
api_mongo_replset_name=gamma
12+
api_neo4j_auth=neo4j:oqGlRV1KTpaqbHDkdlJz
13+
api_new_relic_app_name=gamma-api-production
14+
api_rollbar_key=a90d9c262c7c48cfabbd32fd0a1bc61c
15+
api_s3_context_bucket=runnable.context.resources.production-gamma
16+
17+
[docks:vars]
18+
docker_config=docks
19+
20+
[eru:vars]
21+
eru_github_id=8abb08f83f6d1c52bd1a
22+
eru_github_secret=74a23ee56486d57b14f292283cb04625f600917c
23+
24+
[khronos:vars]
25+
khronos_mongo_auth=api:oW4c7x9Wiv28oiNBy2Bc
26+
khronos_mongo_database=gamma
27+
khronos_mongo_replset_name=gamma
28+
29+
[optimus:vars]
30+
optimus_aws_access_id=AKIAJPA2ZYSVVA5V7XXQ
31+
optimus_aws_secret_id=5V70AUxfIyHeLvlYZe0xaYevDAdgTOWOn5G7nHlt
32+
optimus_github_deploy_keys_bucket=runnable.deploykeys.production-gamma
33+
34+
[palantiri:vars]
35+
palantiri_rollbar_key=f675e9090d6f483ca4e742af2c7f2f83
36+
37+
[registry:vars]
38+
registry_s3_access_key=AKIAJZQHOFYKTZP52XCQ
39+
registry_s3_bucket=runnableimages.gamma
40+
registry_s3_secret_key=iOKNwff7HhUnTmHxt1HrJj1lUkrccZTqWvrKi54C
41+
registry_s3_region=us-west-2
42+
43+
[shiva:vars]
44+
aws_access_key_id=AKIAJ3RCYU6FCULAJP2Q
45+
aws_secret_access_key=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
46+
shiva_rollbar_key=0526a90faec845d796e1ef5361a00526
47+
48+
[gamma:vars]
49+
ansible_ssh_private_key_file=~/.ssh/gamma.pem
50+
datadog_host=10.4.6.251
51+
datadog_tags=env:gamma
52+
domain=runnable-gamma.com
53+
new_relic_license_key=338516e0826451c297d44dc60aeaf0a0ca4bfead
54+
node_env=production-gamma
55+
pg_host=gamma-infrastructure-db.cnksgdqarobf.us-west-2.rds.amazonaws.com
56+
pg_pass=QBjSpAXVYwmGHu4Y
57+
rabbit_password=wKK7g7NWKpQXEeSzyWB7mIpxZIL8H2mDSf3Q6czR3Vk
58+
rabbit_username=o2mdLh9N9Ke2GzhoK8xsruYPhIQFN7iEL44dQJoq7OM
59+
registry_host=10.4.4.82
60+
swarm_token=d363b783f03a845a2c82b081bfe8443e
61+
user_content_domain=runnable.ninja

ansible/group_vars/alpha-hipache.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# container_kill_start settings
2+
name: hipache
3+
redis_host: "{{ hostvars[groups['redis'][0]]['ansible_default_ipv4']['address'] }}"
4+
redis_port: 6379
5+
26
container_image: registry.runnable.com/runnable/hipache
37
container_tag: latest
48
container_run_opts: >

ansible/group_vars/alpha-krain.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# krain options
2+
name: krain
3+
24
krain_env: default
35

46
# upstart template variables

ansible/group_vars/alpha-metis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "metis"
2+
container_image: "registry.runnable.com/runnable/{{ name }}"
3+
container_tag: "{{ git_branch }}"
4+
repo: "git@github.com:CodeNow/astral.git"
5+
node_version: "4.2.1"
6+
npm_version: "2.8.3"
7+
8+
# Overrides the start command in the builder role
9+
npm_start_command: "run metis-start"
10+
11+
# Not actually needed, just allows container-kill-start to work
12+
hosted_ports: ["3000"]
13+
14+
# Needed for the UserData script in shiva
15+
redis_host: "{{ hostvars[groups['redis'][0]]['ansible_default_ipv4']['address'] }}"
16+
redis_port: 6379
17+
18+
# container settings
19+
container_envs: >
20+
-e DATADOG_HOST={{ datadog_host }}
21+
-e DATADOG_PORT={{ datadog_port }}
22+
-e RABBITMQ_HOSTNAME={{ rabbit_host | default(hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address']) }}
23+
-e RABBITMQ_PASSWORD={{ rabbit_password }}
24+
-e RABBITMQ_PORT={{ rabbit_port }}
25+
-e RABBITMQ_USERNAME={{ rabbit_username }}
26+
-e POSTGRES_CONNECT_STRING=postgres://{{ pg_user }}:{{ pg_pass }}@{{ pg_host }}/{{ pg_database }}
27+
-e AWS_ACCESS_KEY_ID={{ aws_access_key_id }}
28+
-e AWS_SECRET_ACCESS_KEY={{ aws_secret_access_key }}
29+
-e NODE_ENV={{ node_env }}
30+
-e REDIS_HOST={{ redis_host }}
31+
-e REDIS_PORT={{ redis_port }}
32+
-e REDIS_IPADDRESS={{ redis_host }}
33+
-e REGISTRY_HOST={{ registry_host }}
34+
-e ROLLBAR_KEY={{ shiva_rollbar_key }}
35+
-e DOCKER_PORT={{ docker_port }}
36+
-e SWARM_TOKEN={{ swarm_token }}
37+
--hostname={{ name }}
38+
39+
container_run_opts: "-d -P {{container_envs}}"

0 commit comments

Comments
 (0)