Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unnecessary custom Hasura config #1020

Merged
merged 5 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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
Loading