Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2253 Add healthchecks and conditional service startup based on service health in docker compose #1232

Merged
merged 19 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/docker-compose-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: >-
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v7.0.0
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v8.1.0
with:
compose_file_path: docker-compose/community-compose.yaml
postman_path: test/postman/docker-compose
postman_json: acs-test-docker-compose-collection.json
pmacius marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 3 additions & 1 deletion .github/workflows/docker-compose-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ jobs:
steps:
- name: Verify docker-compose
uses: >-
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v7.0.0
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/verify-compose@v8.1.0
timeout-minutes: 10
with:
postman_path: test/postman/docker-compose
postman_json: acs-test-docker-compose-collection.json
compose_file_path: docker-compose/${{ matrix.compose_file }}
quay_username: ${{ secrets.QUAY_USERNAME }}
quay_password: ${{ secrets.QUAY_PASSWORD }}
84 changes: 80 additions & 4 deletions docker-compose/7.1.N-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ services:
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
-XX:MaxRAM=1900m
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/probes/-ready-"]
interval: 30s
timeout: 3s
retries: 5
start_period: 1m
labels:
- "traefik.enable=true"
- "traefik.http.routers.alfresco.rule=PathPrefix(`/`)"
Expand All @@ -80,8 +86,17 @@ services:
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
ports:
- "8095:8095"
links:
- activemq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8095/actuator/health"]
interval: 10s
timeout: 2s
retries: 3
start_period: 20s
depends_on:
activemq:
condition: service_healthy
shared-file-store:
condition: service_healthy
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:3.1.2
mem_limit: 1536m
Expand All @@ -95,8 +110,17 @@ services:
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
ports:
- "8090:8090"
links:
- activemq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/ready"]
interval: 20s
timeout: 10s
retries: 3
start_period: 10s
depends_on:
activemq:
condition: service_healthy
shared-file-store:
condition: service_healthy
shared-file-store:
image: quay.io/alfresco/alfresco-shared-file-store:2.1.2
mem_limit: 512m
Expand All @@ -109,6 +133,12 @@ services:
scheduler.cleanup.interval: 86400000
ports:
- "8099:8099"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8099/ready"]
interval: 20s
timeout: 2s
retries: 3
start_period: 10s
volumes:
- shared-file-store-volume:/tmp/Alfresco/sfs
share:
Expand All @@ -127,6 +157,15 @@ services:
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/share"]
interval: 20s
timeout: 2s
retries: 3
start_period: 15s
depends_on:
alfresco:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.share.rule=PathPrefix(`/share`)"
Expand All @@ -144,6 +183,12 @@ services:
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
solr6:
image: quay.io/alfresco/search-services:2.0.2.2
mem_limit: 2g
Expand All @@ -168,6 +213,12 @@ services:
- "5672:5672" # AMQP
- "61616:61616" # OpenWire
- "61613:61613" # STOMP
healthcheck:
test: ["CMD", "/opt/activemq/bin/activemq", "query", "--objname", "type=Broker,brokerName=*,service=Health", "|", "grep", "Good"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
digital-workspace:
image: quay.io/alfresco/alfresco-digital-workspace:4.4.1
mem_limit: 128m
Expand All @@ -183,6 +234,12 @@ services:
- "traefik.http.middlewares.adwforceslash.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.adwchain.chain.middlewares=adwforceslash,adwroot"
- "traefik.http.routers.adw.middlewares=adwchain@docker"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 1s
retries: 3
start_period: 1s
proxy:
image: traefik:3.1
mem_limit: 128m
Expand All @@ -193,9 +250,17 @@ services:
- "--entryPoints.traefik.address=:8888"
- "--accesslog=true"
- "--providers.docker.exposedByDefault=false"
- "--ping.entrypoint=web"
- "--ping=true"
ports:
- "8080:8080"
- "8888:8888"
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 20s
timeout: 10s
retries: 3
start_period: 10s
security_opt:
- label=disable # Required for accessing the Docker socket on Selinux enabled systems
volumes:
Expand All @@ -218,6 +283,17 @@ services:
-XX:MaxRAM=1g
ports:
- "9090:9090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/alfresco/healthcheck"]
interval: 30s
timeout: 2s
retries: 5
start_period: 40s
depends_on:
postgres:
condition: service_healthy
alfresco:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.syncservice.rule=PathPrefix(`/syncservice`)"
Expand Down
90 changes: 86 additions & 4 deletions docker-compose/7.2.N-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ services:
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
-XX:MaxRAM=1900m
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/probes/-ready-"]
interval: 30s
timeout: 3s
retries: 5
start_period: 1m
labels:
- "traefik.enable=true"
- "traefik.http.routers.alfresco.rule=PathPrefix(`/`)"
Expand All @@ -81,8 +87,17 @@ services:
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
ports:
- "8095:8095"
links:
- activemq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8095/actuator/health"]
interval: 10s
timeout: 2s
retries: 3
start_period: 20s
depends_on:
activemq:
condition: service_healthy
shared-file-store:
condition: service_healthy
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:3.1.2
mem_limit: 1536m
Expand All @@ -96,8 +111,17 @@ services:
http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file
ports:
- "8090:8090"
links:
- activemq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/ready"]
interval: 20s
timeout: 2s
retries: 3
start_period: 10s
depends_on:
activemq:
condition: service_healthy
shared-file-store:
condition: service_healthy
shared-file-store:
image: quay.io/alfresco/alfresco-shared-file-store:2.1.2
mem_limit: 512m
Expand All @@ -112,6 +136,12 @@ services:
- "8099:8099"
volumes:
- shared-file-store-volume:/tmp/Alfresco/sfs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8099/ready"]
interval: 20s
timeout: 2s
retries: 3
start_period: 10s
share:
image: quay.io/alfresco/alfresco-share:7.2.2.5
mem_limit: 1g
Expand All @@ -128,6 +158,15 @@ services:
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/share"]
interval: 20s
timeout: 2s
retries: 3
start_period: 15s
depends_on:
alfresco:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.share.rule=PathPrefix(`/share`)"
Expand All @@ -145,6 +184,12 @@ services:
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
solr6:
image: quay.io/alfresco/search-services:2.0.12
mem_limit: 2g
Expand Down Expand Up @@ -172,13 +217,25 @@ services:
- "5672:5672" # AMQP
- "61616:61616" # OpenWire
- "61613:61613" # STOMP
healthcheck:
test: ["CMD", "/opt/activemq/bin/activemq", "query", "--objname", "type=Broker,brokerName=*,service=Health", "|", "grep", "Good"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
digital-workspace:
image: quay.io/alfresco/alfresco-digital-workspace:4.4.1
mem_limit: 128m
environment:
APP_CONFIG_AUTH_TYPE: "BASIC"
BASE_PATH: ./
APP_BASE_SHARE_URL: "http://localhost:8080/workspace/#/preview/s"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 1s
retries: 3
start_period: 1s
labels:
- "traefik.enable=true"
- "traefik.http.routers.adw.rule=PathPrefix(`/workspace`)"
Expand All @@ -195,6 +252,12 @@ services:
APP_CONFIG_PROVIDER: "ECM"
APP_CONFIG_AUTH_TYPE: "BASIC"
BASE_PATH: ./
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 1s
retries: 3
start_period: 1s
labels:
- "traefik.enable=true"
- "traefik.http.routers.acc.rule=PathPrefix(`/control-center`) || PathPrefix(`/admin`)"
Expand All @@ -213,9 +276,17 @@ services:
- "--entryPoints.traefik.address=:8888"
- "--accesslog=true"
- "--providers.docker.exposedByDefault=false"
- "--ping.entrypoint=web"
- "--ping=true"
ports:
- "8080:8080"
- "8888:8888"
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 20s
timeout: 10s
retries: 3
start_period: 10s
security_opt:
- label=disable # Required for accessing the Docker socket on Selinux enabled systems
volumes:
Expand All @@ -238,6 +309,17 @@ services:
-XX:MaxRAM=1g
ports:
- "9090:9090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/alfresco/healthcheck"]
interval: 30s
timeout: 2s
retries: 5
start_period: 40s
depends_on:
postgres:
condition: service_healthy
alfresco:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.syncservice.rule=PathPrefix(`/syncservice`)"
Expand Down
Loading
Loading