From e2463d0f5dba016309516eb3052d802d5fc80ee5 Mon Sep 17 00:00:00 2001 From: Jon Van Oast Date: Wed, 29 May 2024 13:16:10 -0600 Subject: [PATCH 1/5] take1: 2-node opensearch cluster, no ssl security --- devops/development/_env.template | 1 + devops/development/docker-compose.yml | 62 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/devops/development/_env.template b/devops/development/_env.template index ef6ca72c72..2724b2f9f8 100644 --- a/devops/development/_env.template +++ b/devops/development/_env.template @@ -15,6 +15,7 @@ POSTGRES_PASSWORD=development PGADMIN_DEFAULT_EMAIL=dev@example.com PGADMIN_DEFAULT_PASSWORD=development +OPENSEARCH_INITIAL_ADMIN_PASSWORD=D3v3l0p-ment WILDBOOK_DB_NAME=wildbook WILDBOOK_DB_USER=wildbook diff --git a/devops/development/docker-compose.yml b/devops/development/docker-compose.yml index af13892111..14f4366747 100644 --- a/devops/development/docker-compose.yml +++ b/devops/development/docker-compose.yml @@ -62,6 +62,66 @@ services: # JAVA_OPTS from old-world wildbook, which gives us 4G heap memory JAVA_OPTS: "-Djava.awt.headless=true -Xms4096m -Xmx4096m" + opensearch: + image: opensearchproject/opensearch:latest + healthcheck: + test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"] + interval: 10s + timeout: 5s + retries: 60 + labels: + - autoheal=true + volumes: + - opensearch-var1:/usr/share/opensearch/data + ulimits: + memlock: + soft: -1 + hard: -1 + networks: + - intranet + ports: + # development exposure, not exposed in production + - 9200:9200 + - 9300:9300 + environment: + - plugins.security.disabled=true + - node.name=opensearch + #- discovery.seed_hosts=elasticsearch2,elasticsearch3 + #- cluster.initial_master_nodes=elasticsearch,elasticsearch2,elasticsearch3 + - discovery.seed_hosts=opensearch2 + - cluster.initial_master_nodes=opensearch,opensearch2 + - bootstrap.memory_lock=true + - cluster.routing.allocation.disk.threshold_enabled=${ES_THRESHOLD:-true} + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}" + + opensearch2: + image: opensearchproject/opensearch:latest + healthcheck: + test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"] + interval: 10s + timeout: 5s + retries: 60 + labels: + - autoheal=true + volumes: + - opensearch-var2:/usr/share/opensearch/data + ulimits: + memlock: + soft: -1 + hard: -1 + networks: + - intranet + environment: + - plugins.security.disabled=true + - node.name=opensearch2 + - discovery.seed_hosts=opensearch + - cluster.initial_master_nodes=opensearch,opensearch2 + - bootstrap.memory_lock=true + - cluster.routing.allocation.disk.threshold_enabled=${ES_THRESHOLD:-true} + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}" + autoheal: image: willfarrell/autoheal volumes: @@ -79,3 +139,5 @@ networks: volumes: db-pgdata-var: wildbook-var: + opensearch-var1: + opensearch-var2: From 9d920202e767022b9b2dd34e092687a295f81f6b Mon Sep 17 00:00:00 2001 From: Jon Van Oast Date: Tue, 4 Jun 2024 16:54:54 -0600 Subject: [PATCH 2/5] drop dev opensearch to only 1 node --- devops/development/docker-compose.yml | 31 ++------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/devops/development/docker-compose.yml b/devops/development/docker-compose.yml index 14f4366747..fb6a67b77e 100644 --- a/devops/development/docker-compose.yml +++ b/devops/development/docker-compose.yml @@ -88,35 +88,8 @@ services: - node.name=opensearch #- discovery.seed_hosts=elasticsearch2,elasticsearch3 #- cluster.initial_master_nodes=elasticsearch,elasticsearch2,elasticsearch3 - - discovery.seed_hosts=opensearch2 - - cluster.initial_master_nodes=opensearch,opensearch2 - - bootstrap.memory_lock=true - - cluster.routing.allocation.disk.threshold_enabled=${ES_THRESHOLD:-true} - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}" - - opensearch2: - image: opensearchproject/opensearch:latest - healthcheck: - test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"] - interval: 10s - timeout: 5s - retries: 60 - labels: - - autoheal=true - volumes: - - opensearch-var2:/usr/share/opensearch/data - ulimits: - memlock: - soft: -1 - hard: -1 - networks: - - intranet - environment: - - plugins.security.disabled=true - - node.name=opensearch2 - - discovery.seed_hosts=opensearch - - cluster.initial_master_nodes=opensearch,opensearch2 + #- discovery.seed_hosts=opensearch2 + - cluster.initial_master_nodes=opensearch - bootstrap.memory_lock=true - cluster.routing.allocation.disk.threshold_enabled=${ES_THRESHOLD:-true} - "ES_JAVA_OPTS=-Xms512m -Xmx512m" From 461079356aaec67ed2678ae0f46a7ae147aa68b9 Mon Sep 17 00:00:00 2001 From: Jon Van Oast Date: Tue, 4 Jun 2024 17:27:54 -0600 Subject: [PATCH 3/5] add instruction for upping map_count for OpenSearch --- devops/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/devops/README.md b/devops/README.md index fc7101a2f2..04f383eea0 100644 --- a/devops/README.md +++ b/devops/README.md @@ -15,6 +15,7 @@ Presently, this deployment does not start a local WBIA (image analysis) docker c ### Setup and running +1. `sudo sysctl -w vm.max_map_count=262144` (this only needs to be run once on your system) 1. In this folder, create a `.env` file and copy the contents of `_env.template` to it. By default, no changes should be needed, but you can edit this new file. 1. In your terminal, create your base directory (value of `WILDBOOK_BASE_DIR`) and the required subdirectories. The default is `~/wildbook-dev/`): ``` From 69b3946f8d6e49c34f442ce9d577fb81640d3663 Mon Sep 17 00:00:00 2001 From: holmbergius Date: Wed, 5 Jun 2024 12:14:32 -0700 Subject: [PATCH 4/5] Dynamically set Wildbook version via pom.xml Maven build --- src/main/resources/bundles/contexts.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/bundles/contexts.properties b/src/main/resources/bundles/contexts.properties index fa36513223..198634bd4b 100755 --- a/src/main/resources/bundles/contexts.properties +++ b/src/main/resources/bundles/contexts.properties @@ -1,6 +1,6 @@ #project-related variables -application.version=6.0.0-EXPERIMENTAL +application.version=${pom.version} defaultContext = context0 From 4cb5c24fb9b153d3440df30d488a34f53ed04a66 Mon Sep 17 00:00:00 2001 From: Jason Holmberg Date: Fri, 7 Jun 2024 14:29:57 -0700 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b62ce15683..b783a8bd82 100755 --- a/README.md +++ b/README.md @@ -204,4 +204,4 @@ This method also checks for the strings “none” and “unknown” which have Wildbook started as a collaborative software platform for globally-coordinated whale shark (Rhincodon typus ) research as deployed in the Wildbook for Whale Sharks (now part of http://www.sharkbook.ai). After many requests to use our software outside of whale shark research, it is now an open source, community-maintained standard for mark-recapture studies. -Wildbook is a registered trademark of [Conservation X Labs](https://conservationxlabs.com/), a 501(c)(3) non-profit organization, and is supported by the [Wild Me](https://wildme.org) team. +Wildbook is a trademark of [Conservation X Labs](https://conservationxlabs.com/), a 501(c)(3) non-profit organization, and is supported by the [Wild Me](https://wildme.org) team.