Skip to content

Commit 1229051

Browse files
committed
fix(ci): use non conflicting port for docker compose postgres in ci
1 parent f7b90a1 commit 1229051

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/coprocessor-cargo-tests.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ jobs:
120120
run: |
121121
nohup docker compose up -d --build db-migration > /tmp/db-init.log 2>&1 &
122122
working-directory: coprocessor/fhevm-engine/tfhe-worker
123+
env:
124+
DB_HOST_PORT: 15432
123125

124126
- name: Setup Rust toolchain file
125127
run: cp coprocessor/fhevm-engine/rust-toolchain.toml .
@@ -161,7 +163,7 @@ jobs:
161163

162164
- name: Compile tests with coverage instrumentation
163165
env:
164-
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/coprocessor
166+
DATABASE_URL: postgresql://postgres:postgres@localhost:15432/coprocessor
165167
SQLX_OFFLINE: 'true'
166168
TEST_PACKAGE: ${{ matrix.package }}
167169
run: |
@@ -193,9 +195,23 @@ jobs:
193195
fi
194196
echo "Database migration completed"
195197
198+
- name: Verify database is accessible
199+
if: ${{ matrix.needs_db }}
200+
run: |
201+
echo "=== Docker containers ==="
202+
docker ps -a
203+
echo "=== Port mapping for db container ==="
204+
docker port db || true
205+
echo "=== db-init.log ==="
206+
cat /tmp/db-init.log || true
207+
echo "=== Checking localhost:15432 ==="
208+
docker exec db psql -U postgres -c '\l' || true
209+
echo "=== Checking from host ==="
210+
PGPASSWORD=postgres psql -h localhost -p 15432 -U postgres -c '\l' 2>&1 || true
211+
196212
- name: Run tests with coverage
197213
env:
198-
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/coprocessor
214+
DATABASE_URL: postgresql://postgres:postgres@localhost:15432/coprocessor
199215
SQLX_OFFLINE: 'true'
200216
COPROCESSOR_TEST_LOCALHOST: '1'
201217
TEST_GLOBAL_LOCALSTACK: ${{ matrix.needs_localstack && '1' || '0' }}

.github/workflows/coprocessor-gpu-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ jobs:
171171
run: |
172172
nohup docker compose up -d --build db-migration > /tmp/db-init.log 2>&1 &
173173
working-directory: coprocessor/fhevm-engine/tfhe-worker
174+
env:
175+
DB_HOST_PORT: 15432
174176

175177
- name: Use Node.js
176178
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
@@ -218,7 +220,7 @@ jobs:
218220
env:
219221
IS_MERGE_QUEUE: ${{ startsWith(github.head_ref, 'mergify/merge-queue/') && '1' || '0' }}
220222
run: |
221-
export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/coprocessor
223+
export DATABASE_URL=postgresql://postgres:postgres@localhost:15432/coprocessor
222224
export COPROCESSOR_TEST_LOCALHOST=1
223225
# Merge queue: leave unset so supported_types() defaults to full matrix.
224226
# PR CI: run only FHEUint64 for faster feedback.

coprocessor/fhevm-engine/tfhe-worker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
POSTGRES_USER: postgres
1010
POSTGRES_PASSWORD: postgres
1111
ports:
12-
- '5432:5432'
12+
- '${DB_HOST_PORT:-5432}:5432'
1313
healthcheck:
1414
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
1515
interval: 10s

0 commit comments

Comments
 (0)