Skip to content

Commit

Permalink
chore: Remove unnecessary custom Hasura config (#1020)
Browse files Browse the repository at this point in the history
The existing Hasura config is used for setting up the shared logs/state
tables. This is no longer needed and complicates the setup of QueryAPI,
therefore I'm removing it.
  • Loading branch information
morgsmccauley authored Sep 3, 2024
1 parent 4b46f54 commit 274b011
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 157 deletions.
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,12 @@ Runner:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`

Coordinator:
- `LAKE_AWS_ACCESS_KEY`
- `LAKE_AWS_SECRET_ACCESS_KEY`
- `QUEUE_AWS_ACCESS_KEY`
- `QUEUE_AWS_SECRET_ACCESS_KEY`
Block Streamer:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`

These should be populated with your credentials. In most cases, the same key pair can be used for all 3 sets of credentials. Just ensure the keys have permissions to access S3 for handling [Requestor Pays](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RequesterPaysBuckets.html) in Near Lake.

### Hasura Configuration
Hasura contains shared tables for e.g. logging and setting arbitrary state. These tables must be configured prior to running the entire QueryApi application. Configuration is stored in the `hasura/` directory and deployed through the Hasura CLI.

To configure Hasura, first start it with:
```sh
docker compose up hasura-graphql --detach
```

And apply the configuration with:
```sh
cd ./hasura && hasura deploy
```

### Running QueryApi
With everything configured correctly, we can now start all components of QueryApi with:
```sh
Expand Down
9 changes: 0 additions & 9 deletions hasura/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions hasura/config.yaml

This file was deleted.

Empty file removed hasura/metadata/actions.graphql
Empty file.
6 changes: 0 additions & 6 deletions hasura/metadata/actions.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/allow_list.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/cron_triggers.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions hasura/metadata/databases/databases.yaml

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions hasura/metadata/databases/default/tables/public_indexer_state.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions hasura/metadata/databases/default/tables/tables.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/query_collections.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/remote_schemas.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/rest_endpoints.yaml

This file was deleted.

1 change: 0 additions & 1 deletion hasura/metadata/version.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions hasura/migrations/default/1691364619300_init/down.sql

This file was deleted.

25 changes: 0 additions & 25 deletions hasura/migrations/default/1691364619300_init/up.sql

This file was deleted.

2 changes: 1 addition & 1 deletion runner/tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Indexer integration', () => {
postgresContainer = await (await PostgreSqlContainer.build())
.withNetwork(network)
.start();
hasuraContainer = await (await HasuraGraphQLContainer.build())
hasuraContainer = await new HasuraGraphQLContainer()
.withNetwork(network)
.withDatabaseUrl(postgresContainer.getConnectionUri(network.getName()))
.start();
Expand Down
10 changes: 2 additions & 8 deletions runner/tests/testcontainers/hasura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@ export class HasuraGraphQLContainer {

private readonly PORT = 8080;

private constructor (private readonly container: GenericContainer) {
constructor (private readonly container = new GenericContainer('hasura/graphql-engine:latest')) {
container.withExposedPorts(this.PORT)
.withWaitStrategy(Wait.forLogMessage(/.*Starting API server.*/, 2))
.withWaitStrategy(Wait.forLogMessage(/.*Starting API server.*/i))
.withLogConsumer(logConsumer)
.withStartupTimeout(120_000);
}

public static async build (): Promise<HasuraGraphQLContainer> {
const container = await GenericContainer.fromDockerfile('../hasura/').build();

return new HasuraGraphQLContainer(container);
}

public withNetwork (network: StartedNetwork): this {
this.container.withNetwork(network);
return this;
Expand Down

0 comments on commit 274b011

Please sign in to comment.