graphql-engine/docker-compose/databases.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

159 lines
4.4 KiB
YAML
Raw Normal View History

version: "3.6"
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
services:
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
mariadb:
image: mariadb:10
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
ports:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- 3306
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
environment:
MARIADB_USER: "hasura"
MARIADB_PASSWORD: "hasura"
MARIADB_DATABASE: "hasura"
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: "true"
MARIADB_MYSQL_LOCALHOST_USER: "1"
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /var/lib/mysql
healthcheck:
test:
- CMD
- /usr/local/bin/healthcheck.sh
- --connect
- --innodb_initialized
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
postgres:
image: postgis/postgis:15-3.3-alpine
platform: linux/amd64
command:
- -F # turn fsync off for speed
- -N 1000 # increase max connections from 100 so we can run more HGEs
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
ports:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- 5432
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
environment:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
POSTGRES_PASSWORD: "password" # you probably want to override this
Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 ) Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool. prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911 next pr: https://github.com/hasura/graphql-engine-mono/pull/2922 This implements https://github.com/hasura/graphql-engine/issues/7801 Some points to keep in mind for review: * How state is passed to the tests. Do we like how this works? * I quite like it, with the opaque type [`State`](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/State.hs#L17), we can avoid churn when adding things. * The [setup/teardown](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Spec.hs#L19-L31) seems clean. * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change. * The various flags passed in the [ServeOptions](https://github.com/hasura/graphql-engine-mono/blob/68f33051ca6373c42988e78d069eea2a135dc190/server/tests-hspec/Harness/Constants.hs#L123) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921 GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 21:15:17 +03:00
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /var/lib/postgresql/data
healthcheck:
test:
- CMD-SHELL
- psql -U "$${POSTGRES_USER:-postgres}" < /dev/null && sleep 5 && psql -U "$${POSTGRES_USER:-postgres}" < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
citus:
image: citusdata/citus:11
platform: linux/amd64
command:
- -F # turn fsync off for speed
- -N 1000 # increase max connections from 100 so we can run more HGEs
- "-cclient_min_messages=error"
ports:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- 5432
environment:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
POSTGRES_PASSWORD: "password" # you probably want to override this
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /var/lib/postgresql/data
healthcheck:
test:
- CMD-SHELL
- psql -U "$${POSTGRES_USER:-postgres}" < /dev/null && sleep 5 && psql -U "$${POSTGRES_USER:-postgres}" < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
cockroach:
image: cockroachdb/cockroach:latest-v22.2
command:
- start-single-node
- --insecure
- --accept-sql-without-tls
init: true # doesn't shut down properly without this
ports:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- 26257
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /cockroach/cockroach-data
healthcheck:
test:
- CMD-SHELL
- cockroach sql --insecure --execute "select 1;"
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
yugabyte:
image: yugabytedb/yugabyte
command:
- bin/yugabyted
- start
- --daemon=false
- --initial_scripts_dir=/
ports:
- "65009:5433"
environment:
YSQL_USER: "hasura"
YSQL_PASSWORD: "hasura"
YSQL_DB: "hasura"
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /var/lib/postgresql/data
sqlserver:
# We cannot use this image on arm64, as it's not available.
# Instead, we use `mcr.microsoft.com/azure-sql-edge`.
# This uses an environment variable so it can be overridden by scripts to
# provide that image instead.
image: ${MSSQL_IMAGE:-mcr.microsoft.com/mssql/server:2019-latest}
init: true # azure-sql-edge doesn't shut down properly without this
ports:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- 1433
environment:
ACCEPT_EULA: "Y"
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
SA_PASSWORD: "Password!"
MSSQL_SA_PASSWORD: "Password!"
volumes:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- /var/opt/mssql
# We would prefer to attach the healthcheck directly to the `sqlserver` container.
# However, while we can do this in the `mcr.microsoft.com/mssql/server` image,
# it's not possible when running on macOS, as we don't use that image, but
# instead `mcr.microsoft.com/azure-sql-edge`.
# The `mcr.microsoft.com/azure-sql-edge` image does not provide `sqlcmd`.
# We therefore need to run it in a separate container.
# We can reconsider this once the MSSQL Server image can run on arm64.
sqlserver-healthcheck:
image: mcr.microsoft.com/mssql-tools
platform: linux/amd64
command:
- sleep
- inf
init: true # handle signals correctly
healthcheck:
test:
- CMD-SHELL
- |
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
/opt/mssql-tools/bin/sqlcmd -S 'sqlserver,1433' -U SA -P "Password!"
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
# This is commented out because this file can be extended, and dependencies don't work for extensions.
# Instead, ensure you also run this one.
# depends_on:
# sqlserver:
# condition: service_started
mysql:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: Password123#
ports:
- "3306:3306"