Skip to content

Palgo Self-Deployment Operation Manual

Version: 1.0 Deployment method: Docker Compose application stack

1. Deployment Overview

Palgo is deployed as one Docker Compose application stack. Operations staff should enter the delivered palgo deployment directory and maintain these two files:

text
.env
docker-compose.yml

Run all start, stop, update, rollback, and troubleshooting commands from this deployment directory.

2. Service List

ServiceContainerImagePortPurpose
train-servicetrain-servicedocker.medipath.com.cn/palgo/train-service59999Training task service
alg-servicepalgo-algdocker.medipath.com.cn/palgo/alg-service58888Palgo algorithm/business algorithm service
search-servicesearch-servicedocker.medipath.com.cn/palgo/search-service48888Search service using local lucene directory
backend-servicebackend-servicedocker.medipath.com.cn/palgo/backend-service18888Main backend service
tenant-servicetenant-servicedocker.medipath.com.cn/palgo/tenant-service28888Tenant service
project-serviceproject-servicedocker.medipath.com.cn/palgo/project-service38888Project service and Socket JS endpoint
case-servicecase-servicedocker.medipath.com.cn/case-service18082Case service

All services use network_mode: host, so ports are occupied directly on the host.

3. Prerequisite Service Stack

The Palgo docker-compose.yml starts application services only. It does not include MongoDB, MinIO, RabbitMQ, Keycloak, or the base algorithm containers. These prerequisite services are provided by the delivered esb deployment directory.

Required startup order:

  1. Start the esb prerequisite service stack first.
  2. Confirm MinIO, MongoDB, RabbitMQ, algorithm containers, and related services are healthy.
  3. Start the palgo application service stack.

esb/docker-compose.yml service list:

ServiceContainerPortPurpose
minio-1minio-19000, 9001Object storage and console
mongomongo27017MongoDB
postgreskeycloak-postgresinternalKeycloak database
keycloakkeycloak18080SSO/authentication service
rabbitmqrabbitmqhost networkMessage queue
pmapmahost networkData helper service
alg-0alg-08080Palgo base algorithm service
sam-0sam-04040SAM algorithm service

esb/docker-compose.yml example:

yaml
x-alg-template: &alg-template
  image: docker.medipath.com.cn/alg:palgo
  restart: always
  network_mode: host
  runtime: nvidia
  mem_limit: 15G
  volumes:
    - /mnt:/mnt
    - ./cache:/root/.medipath
  healthcheck:
    test: [ "CMD", "bash", "-c", "curl -f http://127.0.0.1:$$API_PORT/health || exit 1", ]
    interval: 30s
    timeout: 10s
    retries: 6
    start_period: 10s

x-env-template: &env-template
  TZ: Asia/Shanghai
  MINIO_ENDPOINT: 127.0.0.1:9000
  NVIDIA_DRIVER_CAPABILITIES: all

services:
  minio-1:
    image: quay.io/minio/minio:RELEASE.2024-08-29T01-40-52Z
    hostname: minio-1
    container_name: minio-1
    restart: always
    command: server --console-address ":9001" http://minio-{1...1}/data{1...2}
    volumes:
      - /media/data1:/data1
      - /media/data2:/data2
    environment:
      MINIO_ROOT_USER: minio
      MINIO_ROOT_PASSWORD: ***
    expose:
      - 9000
      - 9001
    ports:
      - 9000:9000
      - 9001:9001
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
      interval: 30s
      timeout: 20s
      retries: 3

  mongo:
    image: docker.medipath.com.cn/mongo
    container_name: mongo
    restart: always
    command: --quiet
    environment:
      TZ: Asia/Shanghai
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: ***
    expose:
      - 27017
    ports:
      - 27017:27017
    volumes:
      - ./mongo/db:/data/db

  postgres:
    image: docker.medipath.com.cn/postgres:16
    container_name: keycloak-postgres
    restart: always
    volumes:
      - ./postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password

  keycloak:
    image: docker.medipath.com.cn/keycloak
    container_name: keycloak
    restart: always
    environment:
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: ***
      KC_DB: postgres
      KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak"
      KC_DB_USERNAME: keycloak
      KC_DB_PASSWORD: password
      KC_HTTP_ENABLED: true
      KC_HOSTNAME_STRICT: false
      KC_HOSTNAME: sso.local
    entrypoint: [ "/opt/keycloak/bin/kc.sh", "start" ]
    ports:
      - 18080:8080
    depends_on:
      - postgres

  rabbitmq:
    image: docker.medipath.com.cn/rabbitmq
    container_name: rabbitmq
    restart: always
    network_mode: host
    volumes:
      - ./mq:/var/lib/rabbitmq/mnesia
      - ./alg.mq:/etc/rabbitmq/conf.d/99-alg.conf
    environment:
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=***

  pma:
    image: docker.medipath.com.cn/pma
    container_name: pma
    restart: always
    network_mode: host
    environment:
      TZ: Asia/Shanghai
    volumes:
      - /mnt:/mnt

  alg-0:
    <<: *alg-template
    container_name: alg-0
    environment:
      <<: *env-template
      API_PORT: 8080
      NVIDIA_VISIBLE_DEVICES: "0"
    volumes:
      - /mnt:/mnt

  sam-0:
    <<: *alg-template
    image: docker.medipath.com.cn/alg:sam
    container_name: sam-0
    environment:
      <<: *env-template
      API_PORT: 4040
      NVIDIA_VISIBLE_DEVICES: "0"
    volumes:
      - /mnt:/mnt

Start prerequisite services:

bash
cd esb
docker compose up -d
docker compose ps

Prerequisite checks:

bash
curl -f http://127.0.0.1:9000/minio/health/live
curl -f http://127.0.0.1:8080/health
curl -f http://127.0.0.1:4040/health
docker ps
ss -lntp

If alg-0 or sam-0 health checks fail, check GPU and NVIDIA container runtime before starting Palgo.

4. docker-compose.yml Example

yaml
services:
  train-service:
    image: docker.medipath.com.cn/palgo/train-service
    container_name: train-service
    restart: always
    privileged: true
    pid: host
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 59999
      PALGO_TRAIN_DIR: /mnt/data/palgo/train
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./log:/log
      - /mnt:/mnt

  alg-service:
    image: docker.medipath.com.cn/palgo/alg-service
    container_name: palgo-alg
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 58888
    volumes:
      - ./log:/log
      - /mnt:/mnt

  search-service:
    image: docker.medipath.com.cn/palgo/search-service
    container_name: search-service
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 48888
    volumes:
      - ./log:/log
      - /mnt:/mnt
      - ./lucene:/lucene

  backend-service:
    image: docker.medipath.com.cn/palgo/backend-service
    container_name: backend-service
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 18888
    volumes:
      - ./log:/log
      - /mnt:/mnt

  tenant-service:
    image: docker.medipath.com.cn/palgo/tenant-service
    container_name: tenant-service
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 28888
    volumes:
      - ./log:/log
      - /mnt:/mnt

  project-service:
    image: docker.medipath.com.cn/palgo/project-service
    container_name: project-service
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 38888
    volumes:
      - ./log:/log
      - /mnt:/mnt

  case-service:
    image: docker.medipath.com.cn/case-service
    container_name: case-service
    restart: always
    network_mode: host
    env_file:
      - .env
    environment:
      TZ: Asia/Shanghai
      IXTF_API_PORT: 18082
    volumes:
      - ./log:/log
      - /mnt:/mnt

5. Server Requirements

ItemRequirement
OSUbuntu Server 22.04/24.04
CPU8 cores or above
Memory32 GB or above; 64 GB or above recommended for training
GPUNVIDIA GPU is required for training and algorithm scenarios
Disk1 TB or above data disk recommended
Time zoneAsia/Shanghai

Required:

  • Docker
  • Docker Compose plugin
  • curl
  • pigz, for offline image import/export
  • NVIDIA Driver and NVIDIA Container Toolkit when GPU is needed

Pre-deployment checks:

bash
docker version
docker compose version
nvidia-smi
docker ps

6. Port Plan

PortServiceDescription
18888backend-serviceMain backend service
28888tenant-serviceTenant service
38888project-serviceProject service and Socket JS endpoint
48888search-serviceSearch service
58888alg-servicePalgo algorithm business service
59999train-serviceTraining service
18082case-serviceCase service
9000MinIOesb prerequisite service
9001MinIO Consoleesb prerequisite service
27017MongoDBesb prerequisite service
18080Keycloakesb prerequisite service
8080Base algorithm service alg-0esb prerequisite service
4040SAM service sam-0esb prerequisite service

Expose only a unified reverse proxy port or HTTPS publicly. MongoDB, MinIO, RabbitMQ, training service, and algorithm service should not be exposed publicly.

7. Directory Plan

Create local directories in the Palgo deployment directory:

bash
mkdir -p log lucene

Training directory:

bash
sudo mkdir -p /mnt/data/palgo/train
sudo chown -R "$USER":"$USER" /mnt/data/palgo/train

Mounts:

MountDescription
./log:/logLog directory for all Palgo application services
/mnt:/mntShared data directory
./lucene:/luceneSearch index directory
/var/run/docker.sock:/var/run/docker.sockTrain service access to host Docker

Note: train-service uses privileged: true, pid: host, and mounts the Docker socket. Deploy it only on trusted servers.

8. .env Configuration

Enter the Palgo deployment directory and edit:

bash
vi .env

Example:

dotenv
MP_SDK_MARKET_BIND_TENANT_CODE=67d92caa22d9ed0dc78bd002

PALGO_OSS_ENDPOINT=http://127.0.0.1:9000
PALGO_OSS_ACCESS_KEY=minio
PALGO_OSS_SECRET_KEY=***

PALGO_MQ_HOST=127.0.0.1
PALGO_MQ_USER=admin
PALGO_MQ_PASSWORD=***

PALGO_MONGO_URI=mongodb://root:***@127.0.0.1

PALGO_ALG_ENDPOINTS=http://127.0.0.1:8080
PALGO_SOCKET_JS_ENDPOINT=http://127.0.0.1:38888
PALGO_SEARCH_ENDPOINT=http://127.0.0.1:48888
PALGO_TRAIN_ENDPOINT=http://127.0.0.1:59999
PALGO_TRAIN_GPUS_START_IDX=1

CASE_MQ_HOST=127.0.0.1
CASE_MQ_USER=admin
CASE_MQ_PASSWORD=***
CASE_MONGO_URI=mongodb://root:***@127.0.0.1

Configuration:

KeyDescription
MP_SDK_MARKET_BIND_TENANT_CODEBound tenant code
PALGO_OSS_*MinIO/object storage configuration
PALGO_MQ_*Palgo message queue configuration
PALGO_MONGO_URIPalgo MongoDB URI
PALGO_ALG_ENDPOINTSBase algorithm service endpoint
PALGO_SOCKET_JS_ENDPOINTProject service Socket endpoint
PALGO_SEARCH_ENDPOINTSearch service endpoint
PALGO_TRAIN_ENDPOINTTraining service endpoint
PALGO_TRAIN_GPUS_START_IDXStart GPU index for training tasks
CASE_*Case service dependency configuration

Replace default passwords with secure site-specific passwords in production.

9. Image Preparation

Online:

bash
docker login docker.medipath.com.cn
docker compose pull

Offline:

bash
pigz -dc palgo-update.tar.gz | docker load
docker images

Use the actual image package name delivered on site.

10. Start and Check

Start prerequisite services:

bash
cd esb
docker compose up -d
docker compose ps

Start Palgo application services:

bash
cd ../palgo
docker compose up -d

Check Palgo containers:

bash
docker compose ps
docker ps

Check ports:

bash
ss -lntp

If the current version provides /health endpoints, run:

bash
curl -f http://127.0.0.1:18888/health
curl -f http://127.0.0.1:28888/health
curl -f http://127.0.0.1:38888/health
curl -f http://127.0.0.1:48888/health
curl -f http://127.0.0.1:58888/health
curl -f http://127.0.0.1:59999/health
curl -f http://127.0.0.1:18082/health

If a service has no /health endpoint, use running container status, listening port, and logs without continuous errors as the acceptance criteria.

11. Business Acceptance

  1. Open the Palgo system URL or proxy URL.
  2. Log in with a test account.
  3. Create or open tenant, project, and case data.
  4. Upload or select test data files.
  5. Run one algorithm analysis.
  6. Run one search or view search results.
  7. If training is enabled, submit one training task and verify status changes.
  8. Confirm logs do not show continuous errors.

12. Common Operations Commands

bash
docker compose ps
docker compose logs -f --tail=200 backend-service
docker compose logs -f --tail=200 tenant-service
docker compose logs -f --tail=200 project-service
docker compose logs -f --tail=200 search-service
docker compose logs -f --tail=200 alg-service
docker compose logs -f --tail=200 train-service
docker compose logs -f --tail=200 case-service
docker compose restart backend-service tenant-service project-service
docker compose restart search-service alg-service train-service case-service
docker compose down
docker compose pull
docker compose up -d
docker stats
nvidia-smi

13. Logs and Troubleshooting

File log directory:

bash
./log

Container logs:

bash
docker logs backend-service
docker logs tenant-service
docker logs project-service
docker logs search-service
docker logs palgo-alg
docker logs train-service
docker logs case-service

Search for:

text
ERROR
Exception
Connection refused
Mongo
RabbitMQ
MinIO
OSS
No such file
Permission denied
GPU
Docker socket

14. Update and Rollback

Backup before update:

bash
cp .env .env.bak.$(date +%F)
cp docker-compose.yml docker-compose.yml.bak.$(date +%F)
tar -czf palgo-log-lucene-$(date +%F).tgz log lucene

Online update:

bash
docker compose pull
docker compose up -d

Offline update:

bash
pigz -dc palgo-update.tar.gz | docker load
docker compose up -d

Rollback:

  1. Restore the previous .env and docker-compose.yml.
  2. Confirm previous images exist locally.
  3. Run:
bash
docker compose up -d
docker compose ps

15. Backup Requirements

ItemFrequency
.envBefore every release
docker-compose.ymlBefore every release
./luceneDaily or before major upgrades
./logAs needed
/mnt/data/palgo/trainBased on training data importance
MongoDB dataDaily or before major upgrades
MinIO dataDaily or before major upgrades
RabbitMQ dataAs needed

16. Common Troubleshooting

IssueCommon CauseAction
Service exits immediatelyWrong .env configuration or unreachable dependencyCheck corresponding docker logs and .env
Backend cannot access databaseMongoDB not running, wrong credentials, network issueCheck PALGO_MONGO_URI and MongoDB status
Tasks cannot be deliveredRabbitMQ not running or wrong credentialsCheck PALGO_MQ_* and CASE_MQ_*
File upload/read failsMinIO configuration error or missing /mnt dataCheck PALGO_OSS_* and /mnt mount
Algorithm returns no resultPALGO_ALG_ENDPOINTS unreachable or base algorithm container abnormalCheck algorithm service on 8080 and logs
Search abnormalsearch-service abnormal or ./lucene permission issueCheck search-service logs and lucene permissions
Training task failsInsufficient GPU, Docker socket unavailable, training directory permission issueCheck nvidia-smi, /var/run/docker.sock, and /mnt/data/palgo/train
Port conflictHost network port already occupiedUse ss -lntp to find the process

17. Final Delivery Checklist

  • [ ] Docker works.
  • [ ] .env is configured for the site.
  • [ ] The esb prerequisite service stack is running.
  • [ ] MongoDB, MinIO, RabbitMQ, Keycloak, and base algorithm service are available.
  • [ ] docker compose ps shows services running.
  • [ ] Ports 18888/28888/38888/48888/58888/59999/18082 are listening.
  • [ ] Login works.
  • [ ] Project, case, and file access work.
  • [ ] Algorithm analysis returns results.
  • [ ] Search service works.
  • [ ] If training is enabled, training tasks can be submitted and run.
  • [ ] Logs do not show continuous errors.
  • [ ] Configuration and key data are backed up.