diff --git a/exposed/hivemind.exposed.yaml b/exposed/hivemind.exposed.yaml index 9ad23db8b78f3e376b2d7ca4a07272bdf13235fb..51657c3d740023e4853263c46f44d5c9b0cc1cce 100644 --- a/exposed/hivemind.exposed.yaml +++ b/exposed/hivemind.exposed.yaml @@ -1,4 +1,12 @@ services: + # When we want to benchmark the old hivemind server against the new, you can use this + # to expose it on a different port from the postgrest version. For everyone else, + # it's not needed at all. This should be removed once we remove the config for the + # python version of the server. + # + # hivemind-server: + # ports: + # - "${HAF_API_NODE_EXPOSED_IPADDR:-0.0.0.0}:${HAF_API_NODE_EXPOSED_PORT_PREFIX:-3}7002:8080" hivemind-postgrest-rewriter: ports: - "${HAF_API_NODE_EXPOSED_IPADDR:-0.0.0.0}:${HAF_API_NODE_EXPOSED_PORT_PREFIX:-1}7002:80" diff --git a/haf_base.yaml b/haf_base.yaml index e203b57deb4d837896a69413ce1d39583d02f9e3..2f9d54f88c8186c855aa50a62489e4b73c9f5d81 100644 --- a/haf_base.yaml +++ b/haf_base.yaml @@ -56,6 +56,7 @@ services: host haf_block_log hivemind ${COMPOSE_PROJECT_NAME}-hivemind-install-1.${NETWORK_NAME} trust\n host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-hivemind-block-processing-1.${NETWORK_NAME} trust\n host haf_block_log hivemind ${COMPOSE_PROJECT_NAME}-hivemind-block-processing-1.${NETWORK_NAME} trust\n + host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-hivemind-server-1.${NETWORK_NAME} trust\n host haf_block_log hivemind ${COMPOSE_PROJECT_NAME}-hivemind-server-1.${NETWORK_NAME} trust\n host haf_block_log hivemind ${COMPOSE_PROJECT_NAME}-hivemind-postgrest-server-1.${NETWORK_NAME} trust\n diff --git a/hivemind.yaml b/hivemind.yaml index dc1dc875c357c034fd51f7c5f472be14344169f7..1c4f0ab38114336cdaa66df8685087af26e199d8 100644 --- a/hivemind.yaml +++ b/hivemind.yaml @@ -23,6 +23,22 @@ services: reputation-tracker-install: condition: service_completed_successfully + hivemind-server: + image: ${HIVEMIND_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}} + profiles: + - apps + - hivemind + networks: + haf-network: + command: + - "--database-url=postgresql://hivemind@haf/haf_block_log" + - "server" + depends_on: + hivemind-block-processing: + condition: service_healthy + haf: + condition: service_healthy + hivemind-postgrest-server: image: ${POSTGREST_IMAGE:-registry.gitlab.syncad.com/hive/haf_api_node/postgrest}:${POSTGREST_VERSION:-latest} profiles: @@ -33,15 +49,15 @@ services: environment: PGRST_ADMIN_SERVER_PORT: 3001 PGRST_SERVER_PORT: 8080 - PGRST_DB_URI: "postgresql://hivemind@haf/haf_block_log?application_name=hive-mind-postgrest" #warning hivemind improperly matches all connections starting from `hivemind` and crashes if they are made externally (not from python) + PGRST_DB_URI: "postgresql://hivemind@haf/haf_block_log?application_name=hive-mind-postgrest" # warning hivemind improperly matches all connections starting from `hivemind` and crashes if they are made externally (not from python) PGRST_DB_SCHEMA: hivemind_endpoints - #PGRST_DB_ROOT_SPEC: home + # PGRST_DB_ROOT_SPEC: home PGRST_DB_ANON_ROLE: hivemind - PGRST_DB_POOL: 20 + PGRST_DB_POOL: 40 PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10 PGRST_OPENAPI_MODE: "disabled" # unclear why this is set, I guess because we currently only support json-rpc? # when debugging, you can enable this - PGRST_DB_PLAN_ENABLED: true + # PGRST_DB_PLAN_ENABLED: true healthcheck: test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:3001/ready || exit 1"] interval: 10s diff --git a/pgtune.conf b/pgtune.conf index aec54b708f93c2a5954acf6bd4e06bc31c44f2fb..b80b4fce2a16326060407f1f63230539d5687ddd 100644 --- a/pgtune.conf +++ b/pgtune.conf @@ -1,5 +1,5 @@ shared_buffers = 16GB -effective_cache_size = 8GB +effective_cache_size = 48GB maintenance_work_mem = 4GB work_mem = 1024MB diff --git a/postgrest/Dockerfile b/postgrest/Dockerfile index c74b1a76842b95245c39de9dd7eba7ed50ceb76a..0b2f087f113fb824097fa8ad4f297f25ae338db3 100644 --- a/postgrest/Dockerfile +++ b/postgrest/Dockerfile @@ -1,4 +1,4 @@ -ARG POSTGREST_VERSION=v12.0.2 +ARG POSTGREST_VERSION=v12.2.3 FROM postgrest/postgrest:${POSTGREST_VERSION} AS postgrest-base FROM alpine:latest AS base COPY --from=postgrest-base /bin/postgrest /bin