Skip to content

Commit 6bd403f

Browse files
author
Christopher M. Neill
committed
Merge branch 'master' into SAN-3546-loggly-tags
2 parents 04a8ce1 + 740f23f commit 6bd403f

27 files changed

Lines changed: 100 additions & 100 deletions

File tree

ansible/delta-hosts/variables

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ eru_github_id=46a23f5f99f0aa9460f8
3131
eru_github_secret=a0336d72e3d540fb9fbbed2c123a81e1cb329dab
3232

3333
[khronos:vars]
34+
intercom_api_key=14771f14efb617900724a16345e57beb55ba9beb
35+
intercom_app_id=wqzm3rju
36+
khronos_canary_github_branches_instance_id=56f05754a443842400b66a53
37+
khronos_canary_logs_instance_id=56f07f5c1e089a200077f2a3
38+
khronos_canary_rebuild_instance_id=56df6674058d592500f76c9f
39+
khronos_canary_rebuild_navi_url=http://canary-build-staging-runnabletest.runnableapp.com:8000/
40+
khronos_canary_token=24592325a6f881e77a01e3bacf0952c49f4e9f1c
3441
khronos_mongo_auth=api:72192e5a-a5e1-11e5-add9-0270db32f7ad
3542
khronos_mongo_database=delta
3643
khronos_mongo_replset_name=delta
37-
khronos_canary_token=24592325a6f881e77a01e3bacf0952c49f4e9f1c
38-
khronos_canary_rebuild_instance_id=56df6674058d592500f76c9f
39-
khronos_canary_rebuild_navi_url=http://canary-build-staging-runnabletest.runnableapp.com:8000/
40-
khronos_canary_logs_instance_id=56f07f5c1e089a200077f2a3
41-
khronos_canary_github_branches_instance_id=56f05754a443842400b66a53
42-
intercom_app_id=wqzm3rju
43-
intercom_api_key=14771f14efb617900724a16345e57beb55ba9beb
4444

4545
[metis:vars]
4646
metis_rollbar_key=fdc8565a7ce64c6d9432c34be425937c

ansible/eru.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
- hosts: redis
3+
- hosts: consul
34

45
- hosts: eru
56
vars_files:

ansible/gamma-hosts/variables

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ eru_github_secret=74a23ee56486d57b14f292283cb04625f600917c
3333
khronos_mongo_auth=api:3f5210b8-8fe3-11e5-8e62-07b6eff19ecb
3434
khronos_mongo_database=gamma
3535
khronos_mongo_replset_name=gamma
36-
khronos_canary_token=d939b612d75244947c9e07b3fec22c9fe95f13ae
37-
khronos_canary_rebuild_instance_id=56e077e595ba23200046ce7a
38-
khronos_canary_rebuild_navi_url=http://canary-build-staging-runnabletest.runnable.ninja:8000/
39-
intercom_app_id=xs5g95pd
40-
intercom_api_key=037d14f2758eac144de1d2657b2ef9a4f26aef1a
4136

4237
[metis:vars]
4338
metis_rollbar_key=fdc8565a7ce64c6d9432c34be425937c

ansible/group_vars/all.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ loggly_token: f673760d-e0b3-4a93-a15e-2862ea074f91
2828
loggly_password: TebejAcutHeH_Ch0tR9ru4anaT6CRu*3
2929
loggly_username: ops
3030

31+
##
32+
## cores and logs
33+
##
34+
35+
app_log_dir: /var/log
36+
core_file_dir: /var/log/core
37+
3138
##
3239
## shared application configs
3340
##
@@ -96,8 +103,6 @@ fluffy_rollbar_token: 6eb108bab1f54687b9b023e5b485967a
96103

97104
# khronos
98105
rollbar_khronos_token: 5a140828cce14410812d34a3ef936f25
99-
khronos_canary_logs_instance_id: undefined
100-
khronos_canary_github_branches_instance_id: undefined
101106

102107
# krain
103108
krain_port: 3100

ansible/group_vars/alpha-khronos.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,41 @@ npm_version: 2
88

99
# for cron job
1010
# this is the list of queues we want to enqueue a job into
11-
cron_queues: khronos:containers:orphan:prune khronos:context-versions:prune-expired khronos:images:prune khronos:weave:prune
11+
main_cron_queues: "\
12+
khronos:containers:orphan:prune \
13+
khronos:context-versions:prune-expired \
14+
khronos:images:prune \
15+
khronos:weave:prune"
16+
17+
canary_cron_queues: "\
18+
khronos:canary:build \
19+
khronos:canary:github-branch \
20+
khronos:canary:log \
21+
khronos:canary:network \
22+
khronos:metrics:container-status"
23+
1224
# a nice version of the rabbitmq host
1325
cron_rabbit_host_address: "{{ rabbit_host_address }}:{{ rabbit_port }}"
1426
# a quick version of authentication for rabbit for cron
1527
cron_rabbit_auth: --username {{ rabbit_username }} --password {{ rabbit_password }}
16-
# this is the command we want to run in the container.
17-
cron_command: "bash -c \"for QUEUE in {{ cron_queues }}; do /khronos/bin/cli.js --queue \\$QUEUE --job '{}' --host {{ cron_rabbit_host_address }} {{ cron_rabbit_auth }}; done\""
18-
# This is the build canary cron command
19-
cron_build_canary_command: "/khronos/bin/cli.js --queue khronos:canary:build --job '{}' --host {{ cron_rabbit_host_address }} {{ cron_rabbit_auth }}"
20-
# This is the log canary cron command
21-
cron_log_canary_command: "/khronos/bin/cli.js --queue khronos:canary:log --job '{}' --host {{ cron_rabbit_host_address }} {{ cron_rabbit_auth }}"
22-
# This is the github-branch canary cron command
23-
cron_github_branch_canary_command: "/khronos/bin/cli.js --queue khronos:canary:github-branch --job '{}' --host {{ cron_rabbit_host_address }} {{ cron_rabbit_auth }}"
24-
cron_container_metrics_command: "/khronos/bin/cli.js --queue khronos:metrics:container-status --job '{}' --host {{ cron_rabbit_host_address }} {{ cron_rabbit_auth }}"
2528

2629
# for container settings
2730
container_envs: >
28-
-e API_URL={{ api_url }}
2931
-e API_SOCKET_SERVER=https://{{ api_socket_server_hostname }}
30-
-e CANARY_API_TOKEN={{ khronos_canary_token }}
31-
-e CANARY_REBUILD_INSTANCE_ID={{ khronos_canary_rebuild_instance_id }}
32-
-e CANARY_REBUILD_NAVI_URL={{ khronos_canary_rebuild_navi_url }}
32+
-e API_URL={{ api_url }}
33+
-e CANARY_API_TOKEN={{ khronos_canary_token | default('undefined') }}
34+
-e CANARY_GITHUB_BRANCHES_INSTANCE_ID={{ khronos_canary_github_branches_instance_id | default('undefined') }}
35+
-e CANARY_LOG_INSTANCE_ID={{ khronos_canary_logs_instance_id | default('undefined') }}
36+
-e CANARY_LOG_TERMINAL_SLEEP=10
37+
-e CANARY_REBUILD_INSTANCE_ID={{ khronos_canary_rebuild_instance_id | default('undefined') }}
38+
-e CANARY_REBUILD_NAVI_URL={{ khronos_canary_rebuild_navi_url | default('undefined') }}
3339
-e DATADOG_HOST={{ datadog_host_address }}
3440
-e DATADOG_PORT={{ datadog_port }}
35-
-e KHRONOS_PREFETCH=6
41+
-e INTERCOM_API_KEY={{ intercom_api_key | default('undefined') }}
42+
-e INTERCOM_APP_ID={{ intercom_app_id | default('undefined') }}
3643
-e KHRONOS_MAVIS=http://{{ mavis_hostname }}
3744
-e KHRONOS_MONGO=mongodb://{{ khronos_mongo_auth }}@{{ mongo_hosts }}/{{ khronos_mongo_database }}
45+
-e KHRONOS_PREFETCH=6
3846
-e LOG_LEVEL=error
3947
{% if node_env != "production-epsilon" %}
4048
-e MONGO_CACERT=/opt/ssl/mongo-client/ca.pem
@@ -46,12 +54,8 @@ container_envs: >
4654
-e RABBITMQ_PASSWORD={{ rabbit_password }}
4755
-e RABBITMQ_PORT={{ rabbit_port }}
4856
-e RABBITMQ_USERNAME={{ rabbit_username }}
57+
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
4958
-e WORKER_MAX_RETRY_DELAY=3600000
50-
-e CANARY_LOG_TERMINAL_SLEEP=10
51-
-e CANARY_LOG_INSTANCE_ID={{khronos_canary_logs_instance_id}}
52-
-e CANARY_GITHUB_BRANCHES_INSTANCE_ID={{khronos_canary_github_branches_instance_id}}
53-
-e INTERCOM_APP_ID={{ intercom_app_id }}
54-
-e INTERCOM_API_KEY={{ intercom_api_key }}
5559
5660
container_run_opts: >
5761
-h {{ name }}
@@ -60,5 +64,3 @@ container_run_opts: >
6064
-v /opt/ssl/mongo-client:/opt/ssl/mongo-client:ro
6165
--memory=1500m
6266
{{container_envs}}
63-
64-
npm_start_command: run start-json-output

ansible/group_vars/alpha-vault.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ container_run_opts: >
1414
-v /opt/runnable/vault/vault.hcl:/vault.hcl:ro
1515
-v /opt/vault/client-consul:/opt/vault/client-consul:ro
1616
-v /opt/vault/server:/opt/vault/server:ro
17-
-v /var/log:/var/log:rw
17+
-v {{ app_log_dir }}:{{ app_log_dir }}:rw
1818
-p {{ ansible_default_ipv4.address }}:8200:8200
1919
-p {{ ansible_default_ipv4.address }}:8201:8201
2020
--cap-add IPC_LOCK

ansible/khronos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- hosts: rabbitmq
33
- hosts: mongodb
44
- hosts: consul
5+
- hosts: swarm-manager
56

67
- hosts: khronos
78
vars_files:
@@ -14,4 +15,3 @@
1415
- { role: builder, tags: [ build ] }
1516
- { role: khronos, tags: [ deploy ] }
1617
- { role: container_kill_start }
17-

ansible/link.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- hosts: mongo-navi
33
- hosts: rabbitmq
4+
- hosts: consul
45

56
- hosts: link
67
vars_files:

ansible/roles/builder/templates/basic_node/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ RUN {{ command }}
2222
{% endfor %}
2323
{% endif %}
2424

25-
# Add shrinkwrap from the current build context (`.` is the repo) first
26-
# If we change a non first-level dependency, this will break cache as expected
27-
{% if name in ['api', 'api-worker'] %}
28-
ADD ./repo/npm-shrinkwrap.json /{{ name }}/npm-shrinkwrap.json
29-
{% endif %}
30-
3125
# Add package.json from the current build context (`.` is the repo) second
3226
ADD ./repo/package.json /{{ name }}/package.json
3327

@@ -45,4 +39,4 @@ RUN {{ command }}
4539
{% endif %}
4640

4741
# Define default command.
48-
CMD ulimit -c unlimited && /usr/local/bin/npm {{ npm_start_command | default('start') }} > /var/log/{{ name }}.log 2>&1
42+
CMD ulimit -c unlimited && /usr/local/bin/npm {{ npm_start_command | default('start') }} > {{ app_log_dir }}/{{ name }}.log 2>&1

ansible/roles/container_kill_start/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
command: >
6565
sudo docker run
6666
--log-driver={{ log_driver | default("none")}}
67-
-v /var/log:/var/log:rw
67+
-v {{ app_log_dir }}:{{ app_log_dir }}:rw
68+
-v /dev/log:/dev/log:rw
6869
--restart={{ restart_policy | default('always') }}
6970
{{ container_run_opts}}
7071
{{ container_image }}:{{ container_tag }}

0 commit comments

Comments
 (0)