From 504ec4db3a407d3fc1bb54b81d7d32510429bd71 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Tue, 24 Oct 2023 22:12:48 -0400 Subject: [PATCH] Different strategy --- .github/workflows/python-integration.yml | 16 ++++++++++------ postgres/Dockerfile | 2 +- postgres/docker-compose.yml | 2 +- postgres/entrypoint.sh | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-integration.yml b/.github/workflows/python-integration.yml index e5a52acc..3f3f085a 100644 --- a/.github/workflows/python-integration.yml +++ b/.github/workflows/python-integration.yml @@ -40,13 +40,16 @@ jobs: - name: Start the Postgres service run: | docker-compose -f postgres/docker-compose.yml up --build -d - - name: Check if Postgres is ready + - name: List running containers run: | - docker run --network container:postgres_postgres_1 postgres_postgres pg_isready \ - -h postgres \ - -p 5432 \ - -U shillelagh \ - --timeout=30 + docker ps + - name: Check Postgres logs + run: | + sleep 5 + docker logs postgres_postgres_1 + - name: Wait for Postgres to become available + run: | + until docker run --network container:postgres_postgres_1 postgres_postgres pg_isready -h postgres -p 5432 -U shillelagh --timeout=90; do sleep 10; done - name: Test with pytest env: SHILLELAGH_ADAPTER_KWARGS: ${{ secrets.SHILLELAGH_ADAPTER_KWARGS }} @@ -55,4 +58,5 @@ jobs: - name: Stop the Postgres service if: always() run: | + docker logs postgres_postgres_1 docker-compose -f postgres/docker-compose.yml down diff --git a/postgres/Dockerfile b/postgres/Dockerfile index cf836fbf..12331396 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \ postgresql-server-dev-13 \ python3 \ python3-dev \ - python3-setuptools \ + #python3-setuptools \ python3-pip \ python3-venv \ wget diff --git a/postgres/docker-compose.yml b/postgres/docker-compose.yml index 89eeb956..4ab5e677 100644 --- a/postgres/docker-compose.yml +++ b/postgres/docker-compose.yml @@ -13,7 +13,7 @@ services: - ./entrypoint.sh:/usr/local/bin/custom_entrypoint.sh - ..:/src ports: - - "12345:5432" + - "5432:5432" entrypoint: /usr/local/bin/custom_entrypoint.sh volumes: diff --git a/postgres/entrypoint.sh b/postgres/entrypoint.sh index ad4cc37e..063b9f60 100755 --- a/postgres/entrypoint.sh +++ b/postgres/entrypoint.sh @@ -5,10 +5,11 @@ set -e # If any command fails, stop the script cd python3 -m venv venv source venv/bin/activate +pip3 install 'setuptools>=61' wheel # install shillelagh cd /src -pip3 install -e '.[all]' +pip3 install -v -e '.[all]' # install multicorn2 rm -rf multicorn2