Git Product home page Git Product logo

Comments (9)

psuter avatar psuter commented on May 21, 2024

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.

from openwhisk.

psuter avatar psuter commented on May 21, 2024

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.

from openwhisk.

mbehrendt avatar mbehrendt commented on May 21, 2024

@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?

from openwhisk.

mbehrendt avatar mbehrendt commented on May 21, 2024

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

from openwhisk.

rabbah avatar rabbah commented on May 21, 2024

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

from openwhisk.

rabbah avatar rabbah commented on May 21, 2024

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.

from openwhisk.

psuter avatar psuter commented on May 21, 2024

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.

from openwhisk.

psuter avatar psuter commented on May 21, 2024

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.

from openwhisk.

sjfink avatar sjfink commented on May 21, 2024

Docs checked in -- closing as fixed

from openwhisk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.