Skip to content

Commit

Permalink
Moving hasura into core
Browse files Browse the repository at this point in the history
  • Loading branch information
eddygrebt committed Nov 20, 2024
1 parent 91f822b commit d9a2ad4
Show file tree
Hide file tree
Showing 103 changed files with 1,423 additions and 0 deletions.
53 changes: 53 additions & 0 deletions Server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ services:
condition: service_healthy
localstack:
condition: service_healthy
graphql-engine:
condition: service_healthy
data-connector-agent:
condition: service_healthy
ports:
- 8080:8080
- 8081:8081
Expand Down Expand Up @@ -166,6 +170,55 @@ services:
retries: 5
start_period: 30s

graphql-engine:
image: hasura/graphql-engine:v2.40.3.cli-migrations-v3
volumes:
- ./hasura-metadata:/hasura-metadata
ports:
- 8090:8080
restart: always
environment:
## postgres database to store Hasura metadata
HASURA_GRAPHQL_DATABASE_URL: postgres://citrine:citrine@host.docker.internal:5432/citrine
## enable the console served by server
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true' # set to "false" to disable console
## enable debugging mode. It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ENABLE_TELEMETRY: 'false'
## uncomment next line to run console offline (i.e load console assets from server instead of CDN)
# HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
HASURA_GRAPHQL_METADATA_DEFAULTS: '{"backend_configs":{"dataconnector":{"athena":{"uri":"http://data-connector-agent:8081/api/v1/athena"},"mariadb":{"uri":"http://data-connector-agent:8081/api/v1/mariadb"},"mysql8":{"uri":"http://data-connector-agent:8081/api/v1/mysql"},"oracle":{"uri":"http://data-connector-agent:8081/api/v1/oracle"},"snowflake":{"uri":"http://data-connector-agent:8081/api/v1/snowflake"}}}}'
depends_on:
data-connector-agent:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8080/healthz']
interval: 5s
timeout: 10s
retries: 5
start_period: 5s

data-connector-agent:
image: hasura/graphql-data-connector:v2.40.3
restart: always
ports:
- 8091:8081
environment:
QUARKUS_LOG_LEVEL: ERROR # FATAL, ERROR, WARN, INFO, DEBUG, TRACE
## https://quarkus.io/guides/opentelemetry#configuration-reference
QUARKUS_OPENTELEMETRY_ENABLED: 'false'
## QUARKUS_OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8081/api/v1/athena/health']
interval: 5s
timeout: 10s
retries: 5
start_period: 5s

volumes:
localstack-data:
driver: local
db_data:
Empty file.
6 changes: 6 additions & 0 deletions Server/hasura-metadata/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions: []
custom_types:
enums: []
input_objects: []
objects: []
scalars: []
1 change: 1 addition & 0 deletions Server/hasura-metadata/allow_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions Server/hasura-metadata/api_limits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions Server/hasura-metadata/backend_configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions Server/hasura-metadata/cron_triggers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
table:
name: AdditionalInfos
schema: public
array_relationships:
- name: IdTokenAdditionalInfos
using:
foreign_key_constraint_on:
column: additionalInfoId
table:
name: IdTokenAdditionalInfos
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: AsyncJobStatuses
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
table:
name: Authorizations
schema: public
object_relationships:
- name: IdToken
using:
foreign_key_constraint_on: idTokenId
- name: IdTokenInfo
using:
foreign_key_constraint_on: idTokenInfoId
- name: OcpiToken
using:
foreign_key_constraint_on:
column: authorization_id
table:
name: OcpiTokens
schema: public
11 changes: 11 additions & 0 deletions Server/hasura-metadata/databases/citrine/tables/public_Boots.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
table:
name: Boots
schema: public
array_relationships:
- name: VariableAttributes
using:
foreign_key_constraint_on:
column: bootConfigId
table:
name: VariableAttributes
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
table:
name: BusinessDetails
schema: public
object_relationships:
- name: ClientCredentialsRole
using:
foreign_key_constraint_on: clientCredentialsRoleId
- name: ServerCredentialsRole
using:
foreign_key_constraint_on: serverCredentialsRoleId
array_relationships:
- name: Images
using:
foreign_key_constraint_on:
column: businessDetailsId
table:
name: Images
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: CallMessages
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: Certificates
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: ChargingNeeds
schema: public
object_relationships:
- name: Evse
using:
foreign_key_constraint_on: evseDatabaseId
- name: Transaction
using:
foreign_key_constraint_on: transactionDatabaseId
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
table:
name: ChargingProfiles
schema: public
object_relationships:
- name: Transaction
using:
foreign_key_constraint_on: transactionDatabaseId
array_relationships:
- name: ChargingSchedules
using:
foreign_key_constraint_on:
column: chargingProfileDatabaseId
table:
name: ChargingSchedules
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
table:
name: ChargingSchedules
schema: public
object_relationships:
- name: ChargingProfile
using:
foreign_key_constraint_on: chargingProfileDatabaseId
array_relationships:
- name: SalesTariffs
using:
foreign_key_constraint_on:
column: chargingScheduleDatabaseId
table:
name: SalesTariffs
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: ChargingStationSecurityInfos
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
table:
name: ChargingStationSequences
schema: public
object_relationships:
- name: ChargingStation
using:
foreign_key_constraint_on: stationId
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
table:
name: ChargingStations
schema: public
object_relationships:
- name: Location
using:
foreign_key_constraint_on: locationId
array_relationships:
- name: ChargingStationSequences
using:
foreign_key_constraint_on:
column: stationId
table:
name: ChargingStationSequences
schema: public
- name: LatestStatusNotifications
using:
foreign_key_constraint_on:
column: stationId
table:
name: LatestStatusNotifications
schema: public
- name: StatusNotifications
using:
foreign_key_constraint_on:
column: stationId
table:
name: StatusNotifications
schema: public
- name: Transactions
using:
foreign_key_constraint_on:
column: stationId
table:
name: Transactions
schema: public
- name: VariableAttributes
using:
foreign_key_constraint_on:
column: stationId
table:
name: VariableAttributes
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
table:
name: ClientCredentialsRoles
schema: public
object_relationships:
- name: ClientInformation
using:
foreign_key_constraint_on: clientInformationId
- name: CpoTenant
using:
foreign_key_constraint_on: cpoTenantId
array_relationships:
- name: BusinessDetails
using:
foreign_key_constraint_on:
column: clientCredentialsRoleId
table:
name: BusinessDetails
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
table:
name: ClientInformations
schema: public
object_relationships:
- name: CpoTenant
using:
foreign_key_constraint_on: cpoTenantId
array_relationships:
- name: ClientCredentialsRoles
using:
foreign_key_constraint_on:
column: clientInformationId
table:
name: ClientCredentialsRoles
schema: public
- name: ClientVersions
using:
foreign_key_constraint_on:
column: clientInformationId
table:
name: ClientVersions
schema: public
- name: ServerVersions
using:
foreign_key_constraint_on:
column: clientInformationId
table:
name: ServerVersions
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
table:
name: ClientVersions
schema: public
object_relationships:
- name: ClientInformation
using:
foreign_key_constraint_on: clientInformationId
array_relationships:
- name: Endpoints
using:
foreign_key_constraint_on:
column: clientVersionId
table:
name: Endpoints
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: ComponentVariables
schema: public
object_relationships:
- name: Component
using:
foreign_key_constraint_on: componentId
- name: Variable
using:
foreign_key_constraint_on: variableId
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
table:
name: Components
schema: public
object_relationships:
- name: Evse
using:
foreign_key_constraint_on: evseDatabaseId
array_relationships:
- name: ComponentVariables
using:
foreign_key_constraint_on:
column: componentId
table:
name: ComponentVariables
schema: public
- name: EventData
using:
foreign_key_constraint_on:
column: componentId
table:
name: EventData
schema: public
- name: MessageInfos
using:
foreign_key_constraint_on:
column: displayComponentId
table:
name: MessageInfos
schema: public
- name: VariableAttributes
using:
foreign_key_constraint_on:
column: componentId
table:
name: VariableAttributes
schema: public
- name: VariableMonitorings
using:
foreign_key_constraint_on:
column: componentId
table:
name: VariableMonitorings
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: CompositeSchedules
schema: public
Loading

0 comments on commit d9a2ad4

Please sign in to comment.