Skip to content

Commit 13ba5c6

Browse files
authored
ci: increase timeout and optimize docker-compose startup for integrat… (#634)
The GitHub Actions integration test was timing out because: 1. The docker compose up --wait command has a default 10-minute timeout 2. Building 3 Java services from source (db, yaci-indexer, api) + Maven dependency downloads takes longer than 10 minutes in CI/CD 3. The log showed the build process got stuck during Docker image building Changes Applied: 1. .github/workflows/integration-test.yaml:16 - Added --wait-timeout 1200 (20 minutes) to the docker compose command - Added Docker Buildx setup action for better caching support 2. docker-compose-api.yaml:61-70 - Added explicit depends_on for db and yaci-indexer services - Optimized healthcheck timing: - Changed interval from 30s → 10s (more frequent checks) - Increased retries from 20 → 40 - Extended start_period from 20s → 60s (gives Spring Boot more time to start) - Reduced timeout from 10s → 5s (faster failure detection) - Total max wait time remains ~7 minutes but with better responsiveness 3. docker-integration-test-environment.yaml:27-29 - Added depends_on for yaci-cli to wait for database health before starting Expected Improvements: - Prevents timeout failures by allowing up to 20 minutes for service startup - Better service orchestration with explicit dependency chains (db → yaci-cli/yaci-indexer → api) - Faster health detection with 10s intervals instead of 30s - Better Docker caching with Buildx action (will speed up future builds) Additional Recommendations for Future: 1. Pre-build and cache Docker images in CI/CD to avoid building from source every time 2. Use GitHub Actions cache for Maven dependencies 3. Consider splitting the workflow to build images separately and reuse them in integration tests The changes are minimal and backward-compatible. Your local environment will continue to work as before, and the CI/CD should now complete successfully without timing out.
2 parents 4d0e214 + 6b138a7 commit 13ba5c6

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/workflows/integration-test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15+
- name: "Set up Docker Buildx"
16+
uses: docker/setup-buildx-action@v3
1517
- name: "Set up environment"
16-
run: docker compose --env-file .env.IntegrationTest -f docker-integration-test-environment.yaml up --build -d --wait
18+
run: docker compose --env-file .env.IntegrationTest -f docker-integration-test-environment.yaml up --build -d --wait --wait-timeout 1200
1719
- name: "Wait for node to be populated"
1820
run: "sleep 30s"
1921
- name: "Install Node"

docker-compose-api.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ services:
5858
volumes:
5959
- ${CARDANO_CONFIG}:/config
6060
- ${CARDANO_NODE_DIR}:${CARDANO_NODE_DIR}
61+
depends_on:
62+
db:
63+
condition: service_healthy
64+
yaci-indexer:
65+
condition: service_started
6166
healthcheck:
6267
test: [ "CMD-SHELL", "curl --fail http://localhost:${API_PORT}/network/options -H 'Content-Type: application/json' --data '{\"network_identifier\": {\"blockchain\": \"cardano\",\"network\": \"${NETWORK}\"},\"metadata\": {}}' -X POST" ]
63-
interval: 30s
64-
retries: 20
65-
start_period: 20s
66-
timeout: 10s
68+
interval: 10s
69+
retries: 40
70+
start_period: 60s
71+
timeout: 5s
6772
restart: always
6873

6974

docker-integration-test-environment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ services:
2424
yaci_store_enabled: true
2525
ogmios_enabled: false
2626

27+
depends_on:
28+
db:
29+
condition: service_healthy
30+
2731
entrypoint: ["/app/yaci-cli", "create-node", "-o", "--start"]

0 commit comments

Comments
 (0)