From 37ae8cb33c6af8ab9f8be1d2db2d8838ce0c3eb8 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Wed, 28 Feb 2024 11:48:16 +0100 Subject: [PATCH] Migrate the docker compose files --- run/env/service.env | 4 +- .../docker-compose-barebones-1.yml.template | 27 +++------- .../docker-compose-barebones-2.yml.template | 48 ++++++----------- .../docker-compose-marginalia.yml.template | 51 ++++--------------- 4 files changed, 31 insertions(+), 99 deletions(-) diff --git a/run/env/service.env b/run/env/service.env index 5ccabc86..f14a93cc 100644 --- a/run/env/service.env +++ b/run/env/service.env @@ -1,7 +1,5 @@ -WMSA_HOME=run/ -JAVA_OPTS="--enable-preview -da -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" +JDK_JAVA_OPTIONS="--enable-preview -da -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" JAVA_TOOL_OPTIONS="--enable-preview -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000" -EXECUTOR_SERVICE_OPTS="" CONVERTER_PROCESS_OPTS="-Dservice-name=converter" CRAWLER_PROCESS_OPTS="-Dservice-name=crawler" LOADER_PROCESS_OPTS="-Dservice-name=loader" diff --git a/run/install/docker-compose-barebones-1.yml.template b/run/install/docker-compose-barebones-1.yml.template index 11dc8dcf..8b36d64e 100644 --- a/run/install/docker-compose-barebones-1.yml.template +++ b/run/install/docker-compose-barebones-1.yml.template @@ -8,21 +8,12 @@ x-svc: &service - logs:/var/log/wmsa networks: - wmsa - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 + depends_on: + - mariadb + - zookeeper x-p1: &partition-1 env_file: - "${INSTALL_DIR}/env/service.env" - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 volumes: - conf:/wmsa/conf:ro - model:/wmsa/model @@ -37,28 +28,22 @@ x-p1: &partition-1 - wmsa environment: - "WMSA_SERVICE_NODE=1" + depends_on: + - mariadb + - zookeeper services: index-service-1: <<: *partition-1 image: "marginalia/index-service" container_name: "index-service-1" - depends_on: - control-service: - condition: service_healthy executor-service-1: <<: *partition-1 image: "marginalia/executor-service" container_name: "executor-service-1" - depends_on: - control-service: - condition: service_healthy query-service: <<: *service image: "marginalia/query-service" container_name: "query-service" - depends_on: - control-service: - condition: service_healthy expose: - 80 labels: diff --git a/run/install/docker-compose-barebones-2.yml.template b/run/install/docker-compose-barebones-2.yml.template index 94e35d34..6232cf01 100644 --- a/run/install/docker-compose-barebones-2.yml.template +++ b/run/install/docker-compose-barebones-2.yml.template @@ -8,21 +8,12 @@ x-svc: &service - logs:/var/log/wmsa networks: - wmsa - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 + depends_on: + - mariadb + - zookeeper x-p1: &partition-1 env_file: - "${INSTALL_DIR}/env/service.env" - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 volumes: - conf:/wmsa/conf:ro - model:/wmsa/model @@ -35,17 +26,14 @@ x-p1: &partition-1 - uploads-1:/uploads networks: - wmsa + depends_on: + - mariadb + - zookeeper environment: - "WMSA_SERVICE_NODE=1" x-p2: &partition-2 env_file: - "${INSTALL_DIR}/env/service.env" - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 volumes: - conf:/wmsa/conf:ro - model:/wmsa/model @@ -58,6 +46,9 @@ x-p2: &partition-2 - uploads-2:/uploads networks: - wmsa + depends_on: + - mariadb + - zookeeper environment: - "WMSA_SERVICE_NODE=2" services: @@ -65,37 +56,22 @@ services: <<: *partition-1 image: "marginalia/index-service" container_name: "index-service-1" - depends_on: - control-service: - condition: service_healthy executor-service-1: <<: *partition-1 image: "marginalia/executor-service" container_name: "executor-service-1" - depends_on: - control-service: - condition: service_healthy index-service-2: <<: *partition-2 image: "marginalia/index-service" container_name: "index-service-2" - depends_on: - control-service: - condition: service_healthy executor-service-2: <<: *partition-2 image: "marginalia/executor-service" container_name: "executor-service-2" - depends_on: - control-service: - condition: service_healthy query-service: <<: *service image: "marginalia/query-service" container_name: "query-service" - depends_on: - control-service: - condition: service_healthy expose: - 80 labels: @@ -140,6 +116,12 @@ services: - db:/var/lib/mysql networks: - wmsa + zookeeper: + image: zookeeper + container_name: "zookeeper" + restart: always + ports: + - "127.0.0.1:2181:2181" traefik: image: "traefik:v2.10" container_name: "traefik" diff --git a/run/install/docker-compose-marginalia.yml.template b/run/install/docker-compose-marginalia.yml.template index 2adef02d..b92543e7 100644 --- a/run/install/docker-compose-marginalia.yml.template +++ b/run/install/docker-compose-marginalia.yml.template @@ -8,21 +8,12 @@ x-svc: &service - logs:/var/log/wmsa networks: - wmsa - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 + depends_on: + - mariadb + - zookeeper x-p1: &partition-1 env_file: - "${INSTALL_DIR}/env/service.env" - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 volumes: - conf:/wmsa/conf:ro - model:/wmsa/model @@ -35,17 +26,14 @@ x-p1: &partition-1 - uploads-1:/uploads networks: - wmsa + depends_on: + - mariadb + - zookeeper environment: - "WMSA_SERVICE_NODE=1" x-p2: &partition-2 env_file: - "${INSTALL_DIR}/env/service.env" - healthcheck: - test: curl -f http://localhost:80/internal/ping || exit 1 - start_period: 1s - interval: 5s - timeout: 5s - retries: 60 volumes: - conf:/wmsa/conf:ro - model:/wmsa/model @@ -58,6 +46,9 @@ x-p2: &partition-2 - uploads-2:/uploads networks: - wmsa + depends_on: + - mariadb + - zookeeper environment: - "WMSA_SERVICE_NODE=2" services: @@ -65,44 +56,26 @@ services: <<: *partition-1 image: "marginalia/index-service" container_name: "index-service-1" - depends_on: - control-service: - condition: service_healthy executor-service-1: <<: *partition-1 image: "marginalia/executor-service" container_name: "executor-service-1" - depends_on: - control-service: - condition: service_healthy index-service-2: <<: *partition-2 image: "marginalia/index-service" container_name: "index-service-2" - depends_on: - control-service: - condition: service_healthy executor-service-2: <<: *partition-2 image: "marginalia/executor-service" container_name: "executor-service-2" - depends_on: - control-service: - condition: service_healthy query-service: <<: *service image: "marginalia/query-service" container_name: "query-service" - depends_on: - control-service: - condition: service_healthy search-service: <<: *service image: "marginalia/search-service" container_name: "search-service" - depends_on: - control-service: - condition: service_healthy expose: - 80 labels: @@ -117,9 +90,6 @@ services: <<: *service image: "marginalia/assistant-service" container_name: "assistant-service" - depends_on: - control-service: - condition: service_healthy expose: - 80 labels: @@ -138,9 +108,6 @@ services: <<: *service image: "marginalia/api-service" container_name: "api-service" - depends_on: - control-service: - condition: service_healthy expose: - "80" labels: