Skip to content
Snippets Groups Projects
Commit 54f67697 authored by Dan Notestein's avatar Dan Notestein
Browse files

add option to run legcy python server for now, and increase postgrest...

add option to run legcy python server for now, and increase postgrest connection pool (seems to help loading)
parent f537467d
No related branches found
No related tags found
2 merge requests!66Merge develop to master for release,!48Use the PostgREST implementation of Hivemind API server
Pipeline #111349 passed
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"
......@@ -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
......
......@@ -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
......
shared_buffers = 16GB
effective_cache_size = 8GB
effective_cache_size = 48GB
maintenance_work_mem = 4GB
work_mem = 1024MB
......
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment