diff options
author | Robert Newson <rnewson@apache.org> | 2023-03-24 12:23:28 +0000 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2023-03-27 17:39:45 +0100 |
commit | 4f99fb74bcf91f2b47c3ca5e8329460d1d3ab489 (patch) | |
tree | db969d54196a5c4406e7f43f13e300a66768d40f | |
parent | 016a075e793b3d7e37f84831b27667ffd1e1cd7f (diff) | |
download | couchdb-4f99fb74bcf91f2b47c3ca5e8329460d1d3ab489.tar.gz |
Incorporate nouveau into main makefile and dev/run targets
-rw-r--r-- | Makefile | 39 | ||||
-rwxr-xr-x | configure | 10 | ||||
-rwxr-xr-x | dev/run | 21 | ||||
-rw-r--r-- | java/nouveau/server/README.md | 16 |
4 files changed, 52 insertions, 34 deletions
@@ -100,7 +100,7 @@ TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local'" .PHONY: all # target: all - Build everything -all: couch fauxton docs escriptize +all: couch fauxton docs escriptize nouveau .PHONY: help @@ -151,7 +151,8 @@ escriptize: couch .PHONY: check # target: check - Test everything -check: all +check: all nouveau-test + @$(MAKE) exunit @$(MAKE) eunit @$(MAKE) mango-test @$(MAKE) elixir-suite @@ -465,6 +466,9 @@ clean: @rm -f src/couch/priv/couch_js/config.h @rm -f dev/*.beam dev/devnode.* dev/pbkdf2.pyc log/crash.log @rm -f dev/erlserver.pem dev/couch_ssl_dist.conf + ifeq ($(with_nouveau), 1) + @cd java/nouveau && mvn clean + endif .PHONY: distclean @@ -530,26 +534,15 @@ derived: # Nouveau ################################################################################ -.PHONY: nouveau-test -nouveau-test: - @cd java/nouveau && mvn test - -.PHONY: nouveau-all-test -nouveau-all-test: - @cd java/nouveau && mvn test -P allTests - -.PHONY: nouveau-clean -nouveau-clean: - @cd java/nouveau && mvn clean - -.PHONY: nouveau-install -nouveau-install: - @cd java/nouveau && mvn install - -.PHONY: nouveau-install-no-tests -nouveau-install-no-tests: +.PHONY: nouveau +# Build nouveau +nouveau: +ifeq ($(with_nouveau), 1) @cd java/nouveau && mvn -D maven.test.skip=true install +endif -.PHONY: nouveau-start -nouveau-start: nouveau-install-no-tests - @cd java/nouveau/server && mvn exec:exec -D exec.executable="java" +.PHONY: nouveau-test +nouveau-test: nouveau +ifeq ($(with_nouveau), 1) + @cd java/nouveau && mvn test -P allTests +endif @@ -27,6 +27,7 @@ REBAR3_BRANCH="main" WITH_PROPER="true" WITH_FAUXTON=1 WITH_DOCS=1 +WITH_NOUVEAU=0 ERLANG_MD5="false" SKIP_DEPS=0 @@ -56,6 +57,7 @@ Options: -u | --user USER set the username to run as (defaults to $COUCHDB_USER) --disable-fauxton do not build Fauxton --disable-docs do not build any documentation or manpages + --enable-nouveau enable the new experimental search module --erlang-md5 use erlang for md5 hash operations --dev alias for --disable-docs --disable-fauxton --spidermonkey-version VSN specify the version of SpiderMonkey to use (defaults to $SM_VSN) @@ -112,6 +114,12 @@ parse_opts() { continue ;; + --enable-nouveau) + WITH_NOUVEAU=1 + shift + continue + ;; + --erlang-md5) ERLANG_MD5="true" shift @@ -121,6 +129,7 @@ parse_opts() { --dev) WITH_DOCS=0 WITH_FAUXTON=0 + WITH_NOUVEAU=1 shift continue ;; @@ -302,6 +311,7 @@ package_author_name = $PACKAGE_AUTHOR_NAME with_fauxton = $WITH_FAUXTON with_docs = $WITH_DOCS +with_nouveau = $WITH_NOUVEAU user = $COUCHDB_USER spidermonkey_version = $SM_VSN @@ -226,6 +226,13 @@ def get_args_parser(): default=[], help="Path to config to place in 'local.d'. Can be repeated", ) + parser.add_option( + "--with-nouveau", + dest="with_nouveau", + default=False, + action="store_true", + help="Start Nouveau server" + ) return parser @@ -255,6 +262,7 @@ def setup_context(opts, args): "procs": [], "auto_ports": opts.auto_ports, "locald_configs": opts.locald_configs, + "with_nouveau": opts.with_nouveau, } @@ -451,6 +459,16 @@ def boot_haproxy(ctx): " ".join(cmd), shell=True, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT, env=env ) +def boot_nouveau(ctx): + if not ctx["with_nouveau"]: + return + cmd = 'mvn exec:exec -D exec.executable="java"' + logfname = os.path.join(ctx["devdir"], "logs", "nouveau.log") + log = open(logfname, "w") + return sp.Popen( + cmd, cwd='java/nouveau/server', shell=True, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT + ) + def hack_default_ini(ctx, node, contents): contents = re.sub( @@ -552,6 +570,9 @@ def boot_nodes(ctx): haproxy_proc = boot_haproxy(ctx) if haproxy_proc is not None: ctx["procs"].append(haproxy_proc) + nouveau_proc = boot_nouveau(ctx) + if nouveau_proc is not None: + ctx["procs"].append(nouveau_proc) def ensure_all_nodes_alive(ctx): diff --git a/java/nouveau/server/README.md b/java/nouveau/server/README.md index 675e5c86a..76cf889e7 100644 --- a/java/nouveau/server/README.md +++ b/java/nouveau/server/README.md @@ -30,23 +30,17 @@ Nouveau is an experimental search extension for CouchDB 3.x. * direct I/O used for segment merging (so we don't evict useful data from disk cache) * It's new and shiny. -## Erlang side - -You'll need to run a fork of couchdb: https://github.com/rnewson/couchdb-nouveau - ## Getting started +Configure CouchDB with `--enable-nouveau' + Build Nouveau with; -`mvn package` +`make` Run Nouvea with; -`java -jar target/nouveau-*.jar server nouveau.yaml` - -Now run CouchDB using the 'nouveau' branch of my fork at https://github.com/rnewson/couchdb-nouveau; - -`make && dev/run --admin=foo:bar` +`dev/run --admin=foo:bar --with-nouveau` Make a database with some data and an index definition; @@ -75,7 +69,7 @@ while true; do done ``` -In order not to collide with `dreyfus` I've hooked Nouveau in with some uglier paths for now; +In order not to collide with `dreyfus` I've hooked Nouveau in with new paths; `curl 'foo:bar@localhost:15984/foo/_design/foo/_nouveau/bar?q=*:*'` |