Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support local CouchDB in place of Cloudant #1

Closed
sjfink opened this issue Feb 19, 2016 · 9 comments
Closed

support local CouchDB in place of Cloudant #1

sjfink opened this issue Feb 19, 2016 · 9 comments
Labels

Comments

@sjfink
Copy link
Contributor

sjfink commented Feb 19, 2016

Add an option to deploy openwhisk pointing to a CouchDB installation rather than requiring a Cloudant account.

@psuter
Copy link
Contributor

psuter commented Feb 26, 2016

Just a quick note that I've been working on this and got all the tests in DataStoreTests.scala to pass in my branch psuter/openwhisk@d75f187. The plan is now to unify the Cloudant/CouchDB classes to avoid the duplication I introduced, and to improve the setup scripts.

@psuter
Copy link
Contributor

psuter commented Feb 26, 2016

Also, one point we should discuss is whether we want to make a CouchDB container an (optional) part of the deployment, or whether we "just" want to support connections to databases that users set up themselves.

@mbehrendt
Copy link

@psuter can you pls document all changes you had to make for supporting couchdb?

to your 2nd point....how much effort would that be? i guess no code changes?

@mbehrendt
Copy link

just looked at the branch, seems like there were no real changes needed?

@rabbah rabbah assigned psuter and unassigned rabbah Feb 28, 2016
@rabbah
Copy link
Member

rabbah commented Feb 28, 2016

@psuter is head of my changes, I am working off his fork.

@rabbah
Copy link
Member

rabbah commented Feb 28, 2016

Here are two patches required to get the CLI tests to pass on the couchdb-in-a-box branch.

diff --git a/common/scala/src/whisk/core/entity/WhiskStore.scala b/common/scala/src/whisk/core/entity/WhiskStore.scala
index 661c7ba..eebc1bb 100644
--- a/common/scala/src/whisk/core/entity/WhiskStore.scala
+++ b/common/scala/src/whisk/core/entity/WhiskStore.scala
@@ -80,7 +80,7 @@ protected[core] object Util {
         if(config.dbProvider == "Cloudant") {
             new CloudantStore[RawDocument, DocumentAbstraction](config.dbUsername, config.dbPassword, name(config))
         } else {
-            new CouchDbStore[RawDocument, DocumentAbstraction](config.dbHost, config.dbPort.toInt, config.dbUsername, config.dbPassword, config.dbAuths)
+            new CouchDbStore[RawDocument, DocumentAbstraction](config.dbHost, config.dbPort.toInt, config.dbUsername, config.dbPassword, name(config))
         }
     }
 }
diff --git a/tools/db/couchdb/createAdmin.sh b/tools/db/couchdb/createAdmin.sh
index e6c7917..fe64386 100755
--- a/tools/db/couchdb/createAdmin.sh
+++ b/tools/db/couchdb/createAdmin.sh
@@ -45,3 +45,6 @@ CURL="curl -k"
 #   - an output of "" is a good sign.
 #   - an output of {"error": ...} is not a good sign. 
 ${CURL} -X PUT https://${COUCHDB_HOST}:${COUCHDB_PORT}/_config/admins/${COUCHDB_USER} -d "\"${COUCHDB_PASS}\""
+
+# Disable reduce limit on views
+${CURL} -X PUT https://${COUCHDB_HOST}:${COUCHDB_PORT}/_config/query_server_config/reduce_limit -d '"false"' -u ${COUCHDB_USER}:${COUCHDB_PASS}

The reduce_limit is set false to suppress couch's heuristic for map/reduce on views (which detect if a view is not reducing to a scalar). As this scripts will require further refactoring to restructure the build and deployment, I'm providing a patch for @psuter to merge as part of the ongoing work.

@psuter
Copy link
Contributor

psuter commented Feb 29, 2016

The branch at psuter/openwhisk@5226d62 passes all tests using either Cloudant or a generic CouchDB installation as the database backend. The database code is shared to the extent possible, considering the Java APIs for Cloudant and CouchDB are type-incompatible.

We still need to make a pass on all comments and documentation elements that are Cloudant-specific. We also need to consider how the refactoring (in particular of environment variables in shell scripts) affects our various builds.

@psuter
Copy link
Contributor

psuter commented Mar 8, 2016

The code has made it to master, and Travis continuous integration testing is now done on the full test suite, using CouchDB as store. Keeping this issue open to remind me to document the setup for interested CouchDB users.

@sjfink
Copy link
Contributor Author

sjfink commented Mar 12, 2016

Docs checked in -- closing as fixed

@sjfink sjfink closed this as completed Mar 12, 2016
rabbah pushed a commit that referenced this issue Apr 9, 2019
This PR empowers the project with the following features:

* Add the support to define the list of repos to be released
and the hash value to be picked for each repo in a config file of
JSON format define the hash value

* Download the repos based on the definitions in the config file.

* Install openwhisk based on the dowloaded source code, build the
binaries for CLI and wskdeploy.
selfxp added a commit to selfxp/openwhisk that referenced this issue Aug 15, 2019
Capture more metrics and add more tags to monitor cold starts etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants