graphql-engine/server/tests-py/docker-compose.yml
Samir Talwar 36031d62d2 server/tests-py: Fix the run.sh and run-new.sh scripts to work with our new server-builder image.
This updates _docker-compose.yml_ to use the new image tags, and updates _run.sh_ accordingly.

While I was at it, I also added a `docker compose pull` instruction to make sure that we don't have surprises half-way through the script, and a few `echo` lines for clarity.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6235
GitOrigin-RevId: 3855f6898bd3e906c5f423d9d0d6a7031de3777a
2022-10-06 19:04:58 +00:00

158 lines
4.5 KiB
YAML

# These services are brought up in 'run.sh' (see that file)
version: "3.6"
services:
cabal-update:
image: hasura/graphql-engine-server-builder:${PLATFORM:-}-${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- cabal
- update
volumes:
- .:/src
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
hge-build:
image: hasura/graphql-engine-server-builder:${PLATFORM:-}-${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- cabal
- build
- graphql-engine:exe:graphql-engine
volumes:
- ../..:/src
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
depends_on:
cabal-update:
condition: service_completed_successfully
tests-py:
build:
context: ../..
dockerfile: ./.buildkite/dockerfiles/server-pytest-runner/Dockerfile
image: hasura/graphql-engine-server-pytest-runner:${HASURA_GRAPHQL_ENGINE_SERVER_PYTEST_RUNNER_SHA}
command:
- ./oss-.circleci/test-server.sh
environment:
- CIRCLE_NODE_INDEX=1
- CIRCLE_NODE_TOTAL=1
- OUTPUT_FOLDER=/output
- GRAPHQL_ENGINE=/src/dist-newstyle/build/x86_64-linux/ghc-9.2.4.20220919/graphql-engine-1.0.0/x/graphql-engine/noopt/build/graphql-engine/graphql-engine
- HASURA_GRAPHQL_DATABASE_URL=postgresql://postgres:hasura@tests-py-postgres-1/postgres
- HASURA_GRAPHQL_DATABASE_URL_2=postgresql://postgres:hasura@tests-py-postgres-2/postgres
- HASURA_GRAPHQL_CITUS_SOURCE_URL=postgresql://postgres:hasura@citus/postgres
- HASURA_GRAPHQL_MSSQL_SOURCE_URL=DRIVER={ODBC Driver 17 for SQL Server};SERVER=mssql,1433;Uid=sa;Pwd=Password!;
- HASURA_GRAPHQL_PG_SOURCE_URL_1=postgresql://postgres:hasura@tests-py-postgres-1/postgres
- HASURA_GRAPHQL_PG_SOURCE_URL_2=postgresql://postgres:hasura@tests-py-postgres-2/postgres
- HASURA_BIGQUERY_PROJECT_ID
- HASURA_BIGQUERY_SERVICE_KEY
- SERVER_TEST_TO_RUN
volumes:
- ../..:/src
- hge-dist:/src/dist-newstyle
- output:/output
working_dir: /src
depends_on:
citus:
condition: service_healthy
mssql-healthcheck:
condition: service_healthy
postgres:
condition: service_healthy
citus:
image: citusdata/citus:10.1@sha256:7e497e5ca18d7f2ae2a66c1d5d676b548e9221b7e6294adfb03006adad85502c
ports:
- 5432
environment:
POSTGRES_PASSWORD: "hasura"
healthcheck:
test:
- CMD-SHELL
- psql -U postgres < /dev/null && sleep 5 && psql -U postgres < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
volumes:
- /var/lib/postgresql/data
citus-healthy:
image: busybox
command:
- 'true'
depends_on:
citus:
condition: service_healthy
mssql:
# Uses a different image for arm64.
image: ${MSSQL_IMAGE:-mcr.microsoft.com/mssql/server:2019-latest@sha256:a098c9ff6fbb8e1c9608ad7511fa42dba8d22e0d50b48302761717840ccc26af}
ports:
- 1433
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Password!"
MSSQL_SA_PASSWORD: "Password!"
volumes:
- /var/opt/mssql
# This is necessary because on macOS on amd64, the `mssql/server` image is not available.
# We use the `azure-sql-edge` image instead, which does not ship with `sqlcmd` on amd64.
mssql-healthcheck:
image: mcr.microsoft.com/mssql-tools
command:
- sleep
- inf
init: true # handle signals correctly
healthcheck:
test:
- CMD-SHELL
- |
/opt/mssql-tools/bin/sqlcmd -S 'mssql,1433' -U SA -P "Password!"
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
depends_on:
mssql:
condition: service_started
postgres:
image: cimg/postgres:14.4-postgis@sha256:492a389895568e2f89a03c0c45c19350888611001123514623551a014e83a625
command:
- -F # turn fsync off for speed
- -N 1000 # increase max connections from 100 so we can run more HGEs
ports:
- 5432
environment:
POSTGRES_PASSWORD: "hasura"
healthcheck:
test:
- CMD-SHELL
- psql -U postgres < /dev/null && sleep 5 && psql -U postgres < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
volumes:
- /var/lib/postgresql/data
deploy:
replicas: 2
postgres-healthy:
image: busybox
command:
- 'true'
depends_on:
postgres:
condition: service_healthy
volumes:
cabal-cache:
hge-dist:
output: