You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2017/09/11 05:49:42 UTC

[incubator-openwhisk] branch master updated: Increase CouchDB to version 2.0. (#2697)

This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 418fcd1  Increase CouchDB to version 2.0. (#2697)
418fcd1 is described below

commit 418fcd147dc366d61b9bb943a40b203a381b4bce
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Mon Sep 11 07:49:39 2017 +0200

    Increase CouchDB to version 2.0. (#2697)
---
 ansible/group_vars/all                             |  2 +-
 ansible/roles/couchdb/tasks/clean.yml              |  2 +-
 ansible/roles/couchdb/tasks/deploy.yml             | 25 +++++++++++-----------
 .../whisk/core/database/test/ReplicatorTests.scala |  1 +
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index a154b20..92183be 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -197,7 +197,7 @@ linux:
   version: 4.4.0-31
 
 couchdb:
-  version: 1.6
+  version: 2.0
 
 docker:
   # The user to install docker for. Defaults to the ansible user if not set. This will be the user who is able to run
diff --git a/ansible/roles/couchdb/tasks/clean.yml b/ansible/roles/couchdb/tasks/clean.yml
index 19d90db..8e8f638 100644
--- a/ansible/roles/couchdb/tasks/clean.yml
+++ b/ansible/roles/couchdb/tasks/clean.yml
@@ -4,6 +4,6 @@
 - name: remove CouchDB
   docker_container:
     name: couchdb
-    image: couchdb
+    image: klaemo/couchdb
     state: absent
   ignore_errors: True
diff --git a/ansible/roles/couchdb/tasks/deploy.yml b/ansible/roles/couchdb/tasks/deploy.yml
index 4e0be99..895c4ec 100644
--- a/ansible/roles/couchdb/tasks/deploy.yml
+++ b/ansible/roles/couchdb/tasks/deploy.yml
@@ -1,6 +1,10 @@
 ---
 # This role will run a CouchDB server on the db group
 
+- name: "Set node name to couchdb{{ groups['db'].index(inventory_hostname) }}"
+  set_fact:
+    nodeName: "couchdb{{ groups['db'].index(inventory_hostname) }}"
+
 - name: check if db credentials are valid for CouchDB
   fail: msg="The db provider in your {{ inventory_dir }}/group_vars/all is {{ db_provider }}, it has to be CouchDB, pls double check"
   when: db_provider != "CouchDB"
@@ -17,21 +21,25 @@
     volume_dir: "{{ instance.volume.fsmount | default( '/mnt/' + group_names|first, true ) }}:/usr/local/var/lib/couchdb"
   when: (block_device is defined) and (block_device in disk_status.stdout)
 
-- name: "pull the couchdb:{{ couchdb.version }} image"
-  shell: "docker pull couchdb:{{ couchdb.version }}"
+- name: "pull the klaemo/couchdb:{{ couchdb.version }} image"
+  shell: "docker pull klaemo/couchdb:{{ couchdb.version }}"
   retries: "{{ docker.pull.retries }}"
   delay: "{{ docker.pull.delay }}"
 
 - name: (re)start CouchDB
   docker_container:
     name: couchdb
-    image: couchdb:{{ couchdb.version }}
+    image: klaemo/couchdb:{{ couchdb.version }}
     state: started
     recreate: true
     restart_policy: "{{ docker.restart.policy }}"
     volumes: "{{volume_dir | default([])}}"
     ports:
       - "{{ db_port }}:5984"
+    env:
+      COUCHDB_USER: "{{ db_username }}"
+      COUCHDB_PASSWORD: "{{ db_password }}"
+      NODENAME: "{{ nodeName }}"
 
 - name: wait until the CouchDB in this host is up and running
   wait_for:
@@ -40,18 +48,9 @@
     port: "{{ db_port }}"
     timeout: 60
 
-- name: create admin user
-  uri:
-    url: "{{ db_protocol }}://{{ ansible_host }}:{{ db_port }}/_config/admins/{{ db_username }}"
-    method: PUT
-    body: >
-        "{{ db_password }}"
-    body_format: json
-    status_code: 200
-
 - name: disable reduce limit on views
   uri:
-    url: "{{ db_protocol }}://{{ ansible_host }}:{{ db_port }}/_config/query_server_config/reduce_limit"
+    url: "{{ db_protocol }}://{{ ansible_host }}:{{ db_port }}/_node/couchdb@{{ nodeName }}/_config/query_server_config/reduce_limit"
     method: PUT
     body: >
         "false"
diff --git a/tests/src/test/scala/whisk/core/database/test/ReplicatorTests.scala b/tests/src/test/scala/whisk/core/database/test/ReplicatorTests.scala
index 38a222a..e1f6a59 100644
--- a/tests/src/test/scala/whisk/core/database/test/ReplicatorTests.scala
+++ b/tests/src/test/scala/whisk/core/database/test/ReplicatorTests.scala
@@ -52,6 +52,7 @@ class ReplicatorTests
 
   val replicatorClient =
     new ExtendedCouchDbRestClient(dbProtocol, dbHost, dbPort.toInt, dbUsername, dbPassword, "_replicator")
+  replicatorClient.createDb().futureValue
 
   val replicator = WhiskProperties.getFileRelativeToWhiskHome("tools/db/replicateDbs.py").getAbsolutePath
   val designDocPath =

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].