Skip to content

Commit

Permalink
Nuke Consul.
Browse files Browse the repository at this point in the history
Update controller config.
Update params for invoker and clean up some deadcode.

Hardcoded db prefix for docker-machine since db init runs on host not inside VM.
  • Loading branch information
rabbah committed Jul 29, 2017
1 parent 2a8b07c commit 4352aca
Show file tree
Hide file tree
Showing 45 changed files with 91 additions and 1,208 deletions.
2 changes: 1 addition & 1 deletion ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ cd ansible
ansible-playbook -i environments/<environment> controller.yml -e mode=clean
```

**Caveat:** In distributed environments some components (e.g. Consul, Invoker, etc.) exist on multiple machines. So if you run a playbook to clean or deploy those components, it will run on **all** of the hosts targeted by the component's playbook.
**Caveat:** In distributed environments some components (e.g. Invoker, etc.) exist on multiple machines. So if you run a playbook to clean or deploy those components, it will run on **all** of the hosts targeted by the component's playbook.


### Cleaning an OpenWhisk Deployment
Expand Down
10 changes: 0 additions & 10 deletions ansible/consul.yml

This file was deleted.

4 changes: 0 additions & 4 deletions ansible/environments/distributed/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ instances:
num_instances: 1
flavor:

- name: consul_servers
num_instances: 1
flavor:

- name: invokers
num_instances: 2
flavor:
Expand Down
2 changes: 0 additions & 2 deletions ansible/environments/distributed/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ edge
10.3.2.155
[kafka]
10.3.2.156
[consul_servers]
10.3.2.157
[invokers]
10.3.2.158
10.3.2.159
Expand Down
3 changes: 2 additions & 1 deletion ansible/environments/docker-machine/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ docker_dns: ""
# a hostname that is resolved on the client, via /etc/hosts for example.
whisk_api_localhost_name: "openwhisk"

db_prefix: "{{ ansible_user_id|lower }}_{{ ansible_hostname|lower }}_"
# Hardcoded for docker-machine since db init runs on host not inside VM
db_prefix: dockermachine_

# Auto lookup to find the db credentials
db_provider: "{{ lookup('ini', 'db_provider section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
Expand Down
4 changes: 0 additions & 4 deletions ansible/environments/docker-machine/hosts.j2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ ansible ansible_connection=local
[kafka]
{{ docker_machine_ip }}

; the consul_servers group has maximum 5 machines
[consul_servers]
{{ docker_machine_ip }}

[invokers]
{{ docker_machine_ip }}

Expand Down
4 changes: 0 additions & 4 deletions ansible/environments/local/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ ansible ansible_connection=local
[kafka]
172.17.0.1 ansible_connection=local

; the consul_servers group has maximum 5 machines
[consul_servers]
172.17.0.1 ansible_connection=local

[invokers]
172.17.0.1 ansible_connection=local

Expand Down
4 changes: 0 additions & 4 deletions ansible/environments/mac/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ ansible ansible_connection=local
[kafka]
172.17.0.1 ansible_connection=local

; the consul_servers group has maximum 5 machines
[consul_servers]
172.17.0.1 ansible_connection=local

[invokers]
172.17.0.1 ansible_connection=local

Expand Down
11 changes: 0 additions & 11 deletions ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,6 @@ controller:
blackboxFraction: 0.10
instances: "{{ groups['controllers'] | length }}"

consul:
confdir: "{{ config_root_dir }}/consul"
version: 0.7.0
port:
server: 8300
serf_lan: 8301
serf_wan: 8302
rpc: 8400
http: 8500
dns: 8600

registry:
confdir: "{{ config_root_dir }}/registry"

Expand Down
2 changes: 0 additions & 2 deletions ansible/openwhisk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# It assumes you have already set up your database with the respective db provider playbook (currently cloudant.yml or couchdb.yml)
# It assumes that wipe.yml have being deployed at least once

- include: consul.yml

- include: kafka.yml

- include: controller.yml
Expand Down
7 changes: 0 additions & 7 deletions ansible/roles/consul/handlers/main.yml

This file was deleted.

34 changes: 0 additions & 34 deletions ansible/roles/consul/tasks/clean.yml

This file was deleted.

92 changes: 0 additions & 92 deletions ansible/roles/consul/tasks/deploy.yml

This file was deleted.

10 changes: 0 additions & 10 deletions ansible/roles/consul/tasks/main.yml

This file was deleted.

15 changes: 0 additions & 15 deletions ansible/roles/consul/templates/config.json.j2

This file was deleted.

37 changes: 30 additions & 7 deletions ansible/roles/controller/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,41 @@
restart_policy: "{{ docker.restart.policy }}"
hostname: "controller{{ groups['controllers'].index(inventory_hostname) }}"
env:
"JAVA_OPTS": "-Xmx{{ controller.heap }}"
"CONTROLLER_OPTS": "{{ controller.arguments }}"

"COMPONENT_NAME": "controller{{ groups['controllers'].index(inventory_hostname) }}"
"CONSULSERVER_HOST": "{{ groups['consul_servers'] | first }}"
"CONSUL_HOST_PORT4": "{{ consul.port.http }}"
"PORT": 8080

"WHISK_VERSION_NAME": "{{ whisk_version_name }}"
"WHISK_VERSION_DATE": "{{ whisk.version.date }}"
"WHISK_VERSION_BUILDNO": "{{ docker.image.tag }}"
"SERVICE_CHECK_HTTP": "/ping"
"SERVICE_CHECK_TIMEOUT": "2s"
"SERVICE_CHECK_INTERVAL": "15s"
"JAVA_OPTS": "-Xmx{{ controller.heap }}"
"CONTROLLER_OPTS": "{{ controller.arguments }}"

"KAFKA_HOST": "{{ groups['kafka']|first }}"
"KAFKA_HOST_PORT": "{{ kafka.port }}"

"DB_PROTOCOL": "{{ db_protocol }}"
"DB_PROVIDER": "{{ db_provider }}"
"DB_HOST": "{{ db_host }}"
"DB_PORT": "{{ db_port }}"
"DB_USERNAME": "{{ db_username }}"
"DB_PASSWORD": "{{ db_password }}"
"DB_WHISK_ACTIONS": "{{ db.whisk.actions }}"
"DB_WHISK_AUTHS": "{{ db.whisk.auth }}"
"DB_WHISK_ACTIVATIONS": "{{ db.whisk.activations }}"

"DEFAULTLIMITS_ACTIONS_INVOKES_PERMINUTE": "{{ defaultLimits.actions.invokes.perMinute }}"
"DEFAULTLIMITS_ACTIONS_INVOKES_CONCURRENT": "{{ defaultLimits.actions.invokes.concurrent }}"
"DEFAULTLIMITS_TRIGGERS_FIRES_PERMINUTE": "{{ defaultLimits.triggers.fires.perMinute }}"
"DEFAULTLIMITS_ACTIONS_INVOKES_CONCURRENTINSYSTEM": "{{ defaultLimits.actions.invokes.concurrentInSystem }}"
"DEFAULTLIMITS_ACTIONS_SEQUENCE_MAXLENGTH": "{{ defaultLimits.actions.sequence.maxLength }}"
"LIMITS_ACTIONS_INVOKES_PERMINUTE": "{{ limits.actions.invokes.perMinute }}"
"LIMITS_ACTIONS_INVOKES_CONCURRENT": "{{ limits.actions.invokes.concurrent }}"
"LIMITS_ACTIONS_INVOKES_CONCURRENTINSYSTEM": "{{ limits.actions.invokes.concurrentInSystem }}"
"LIMITS_TRIGGERS_FIRES_PERMINUTE": "{{ limits.triggers.fires.perMinute }}"
"LOADBALANCER_INVOKERBUSYTHRESHOLD": "{{ invoker.busyThreshold }}"

"RUNTIMES_MANIFEST": "{{ runtimesManifest | to_json }}"
volumes:
- "{{ whisk_logs_dir }}/controller{{ groups['controllers'].index(inventory_hostname) }}:/logs"
ports:
Expand Down
36 changes: 29 additions & 7 deletions ansible/roles/invoker/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,38 @@
--name invoker{{ groups['invokers'].index(inventory_hostname) }}
--hostname invoker{{ groups['invokers'].index(inventory_hostname) }}
--restart {{ docker.restart.policy }}
-e JAVA_OPTS=-Xmx{{ invoker.heap }}
-e INVOKER_OPTS='{{ invoker.arguments }}'
-e COMPONENT_NAME=invoker{{ groups['invokers'].index(inventory_hostname) }}
-e CONSULSERVER_HOST={{ groups['consul_servers'] | first }}
-e CONSUL_HOST_PORT4={{ consul.port.http }}
-e PORT=8080
-e KAFKA_HOST={{ groups['kafka']|first }}
-e KAFKA_HOST_PORT={{ kafka.port }}
-e DB_PROTOCOL={{ db_protocol }}
-e DB_PROVIDER={{ db_provider }}
-e DB_HOST={{ db_host }}
-e DB_PORT={{ db_port }}
-e DB_USERNAME={{ db_username }}
-e DB_PASSWORD={{ db_password }}
-e DB_WHISK_ACTIONS={{ db.whisk.actions }}
-e DB_WHISK_ACTIVATIONS={{ db.whisk.activations }}
-e WHISK_API_HOST_PROTO={{ whisk_api_host_proto | default('https') }}
-e WHISK_API_HOST_PORT={{ whisk_api_host_port | default('443') }}
-e WHISK_API_HOST_NAME={{ whisk_api_host_name | default(groups['edge'] | first) }}
-e RUNTIMES_MANIFEST='{{ runtimesManifest | to_json }}'
-e SELF_DOCKER_ENDPOINT=localhost
-e SERVICE_CHECK_HTTP=/ping
-e SERVICE_CHECK_TIMEOUT=2s
-e SERVICE_CHECK_INTERVAL=15s
-e JAVA_OPTS=-Xmx{{ invoker.heap }}
-e INVOKER_OPTS='{{ invoker.arguments }}'
-e DOCKER_REGISTRY={{ docker_registry }}
-e DOCKER_IMAGE_PREFIX={{ docker.image.prefix }}
-e DOCKER_IMAGE_TAG={{ docker.image.tag }}
-e INVOKER_CONTAINER_NETWORK={{ invoker_container_network_name | default("bridge") }}
-e INVOKER_CONTAINER_POLICY={{ invoker_container_policy_name | default()}}
-e INVOKER_CONTAINER_DNS={{ invoker_container_network_dns_servers | default()}}
-e INVOKER_NUMCORE={{ invoker.numcore }}
-e INVOKER_CORESHARE={{ invoker.coreshare }}
-e INVOKER_SERIALIZEDOCKEROP={{ invoker.serializeDockerOp }}
-e INVOKER_SERIALIZEDOCKERPULL={{ invoker.serializeDockerPull }}
-e INVOKER_USERUNC={{ invoker_use_runc | default(invoker.useRunc) }}
-e INVOKER_USEREACTIVEPOOL={{ invoker.useReactivePool }}
-e WHISK_LOGS_DIR={{ whisk_logs_dir }}
-v /sys/fs/cgroup:/sys/fs/cgroup
-v /run/runc:/run/runc
-v {{ whisk_logs_dir }}/invoker{{ groups['invokers'].index(inventory_hostname) }}:/logs
Expand Down
2 changes: 1 addition & 1 deletion ansible/tasks/writeWhiskProperties.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# This task will write whisk.properties to the openwhisk_home.
# Currently whisk.properties is still needed for consul and tests.
# Currently whisk.properties is still needed for tests.

- name: write whisk.properties template to openwhisk_home
template:
Expand Down
Loading

0 comments on commit 4352aca

Please sign in to comment.