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

Sg tidyup #58

Merged
merged 4 commits into from
Oct 13, 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
90 changes: 89 additions & 1 deletion .github/workflows/ddn-test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
name: Axiom auto-test + auto-deploy

permissions:
contents: read
pull-requests: write

on:
pull_request:
branches:
Expand All @@ -6,10 +12,83 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up DDN CLI and Login
uses: hasura/ddn-deployment@main
with:
hasura-pat: ${{ secrets.HASURA_PAT }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq

- name: Create .env.cloud.default
run: |
echo "${{ secrets.ENV_CLOUD_DEFAULT }}" > .env.cloud.default

- name: Detect Connector Changes
id: detect_changes
run: |
# Check if any changes occurred in the connector directories
if git diff --name-only ${{ github.sha }}~1 ${{ github.sha }} | grep -q 'connector/'; then
echo "connector_changes=true" >> $GITHUB_ENV
else
echo "connector_changes=false" >> $GITHUB_ENV
fi

- name: Build supergraph
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
if [ "${{ env.connector_changes }}" = "true" ]; then
echo "Building connectors..."
ddn supergraph build create \
--supergraph ./supergraph-with-mutations.yaml \
--context default \
--description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] Test build for commit $GITHUB_SHA" \
--out=json > build_output.json
else
echo "Skipping connector build."
ddn supergraph build create --no-build-connectors \
--supergraph ./supergraph-with-mutations.yaml \
--context default \
--description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] Test build for commit $GITHUB_SHA" \
--out=json > build_output.json
fi

- name: Extract URLs from JSON
id: extract_urls
run: |
BUILD_URL=$(jq -r '.build_url' build_output.json)
CONSOLE_URL=$(jq -r '.console_url' build_output.json)
echo "build_url=$BUILD_URL" >> $GITHUB_ENV
echo "console_url=$CONSOLE_URL" >> $GITHUB_ENV

- name: Add PR comment with build details
uses: actions/github-script@v7
with:
script: |
const buildUrl = process.env.build_url;
const consoleUrl = process.env.console_url;
const prNumber = context.payload.pull_request.number;
const commitId = context.sha;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Supergraph build was successful! 🎉\n\n**Build URL:** [${buildUrl}](${buildUrl})\n**Console URL:** [${consoleUrl}](${consoleUrl})\n**Commit ID:** ${commitId}`
})

test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up DDN CLI and Login
uses: hasura/ddn-deployment@main
Expand Down Expand Up @@ -46,6 +125,15 @@ jobs:
--env-file .env \
up --build --pull always -d

- name: Wait for GraphQL Service to Be Ready
run: |
echo "Waiting for GraphQL service to start..."
until curl -s http://localhost:3000/graphql -o /dev/null; do
echo "Service not ready, retrying in 5 seconds..."
sleep 5
done
echo "Service is up!"

- name: Query DDN Endpoint and Validate Response
run: |
QUERY='{
Expand Down
33 changes: 23 additions & 10 deletions .hasura/context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,34 @@ definition:
scripts:
docker-start:
bash: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
powershell: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
powershell: Write-Output "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
build-local-s1:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
build-local-s2:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
build-local-s3:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
build-local-s4:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
build-local-au-dbs:
bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
build-local-eu-dbs:
bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
build-local-sg-dbs:
bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
build-local-us-east-dbs:
bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
build-local-us-west-dbs:
bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
docker-start-local:
bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d
Expand All @@ -81,9 +90,13 @@ definition:
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d
docker-stop:
bash: docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v
powershell: docker compose -f compose.yaml down -v; docker compose -f .data/compose.yaml down -v
demo-telco:
bash: DATASET=telco docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d
powershell: $Env:DATASET = "telco"; docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d
demo-healthcare:
bash: echo "not yet implemented"
powershell: Write-Output "not yet implemented"
demo-banking:
bash: echo "not yet implemented"
powershell: Write-Output "not yet implemented"
39 changes: 26 additions & 13 deletions .hasura/context.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,37 @@ definition:
scripts:
docker-start:
bash: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
powershell: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
powershell: Write-Output "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]"
build-local-s1:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml
build-local-s2:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml
build-local-s3:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml
build-local-s4:
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml
build-local-au-dbs:
bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml
build-local-eu-dbs:
bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml
build-local-sg-dbs:
bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml
build-local-us-east-dbs:
bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml
build-local-us-west-dbs:
bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
powershell: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml
docker-start-local:
bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local up --build --pull always -d
bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d
docker-start-au:
bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.cloud.au --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.au --env-file .env up --build --pull always -d
Expand All @@ -80,10 +89,14 @@ definition:
bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d
powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d
docker-stop:
bash: echo "docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v"
bash: docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v
powershell: docker compose -f compose.yaml down -v; docker compose -f .data/compose.yaml down -v
demo-telco:
bash: DATASET=telco docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d
powershell: $Env:DATASET = "telco"; docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d
demo-healthcare:
bash: echo "not yet implemented"
powershell: Write-Output "not yet implemented"
demo-banking:
bash: echo "not yet implemented"
powershell: Write-Output "not yet implemented"
8 changes: 0 additions & 8 deletions customer/metadata-domain/mongo.hml
Original file line number Diff line number Diff line change
Expand Up @@ -933,14 +933,6 @@ definition:
unique_columns:
- _id
foreign_keys: {}
- name: userProfiles
arguments: {}
type: userProfiles
uniqueness_constraints:
userProfiles_id:
unique_columns:
- _id
foreign_keys: {}
functions: []
procedures: []
capabilities:
Expand Down
10 changes: 0 additions & 10 deletions network/metadata/clickhouse.hml
Original file line number Diff line number Diff line change
Expand Up @@ -583,16 +583,6 @@ definition:
type: named
name: Float32
collections:
- name: .inner_id.ebe5f199-643d-44a5-9775-d2babedc4a8f
description: ""
arguments: {}
type: .inner_id.ebe5f199-643d-44a5-9775-d2babedc4a8f
uniqueness_constraints:
CDR_Timestamp, CDR_GUID:
unique_columns:
- CDR_GUID
- CDR_Timestamp
foreign_keys: {}
- name: cdr
description: ""
arguments: {}
Expand Down
8 changes: 0 additions & 8 deletions support/metadata/atlas.hml
Original file line number Diff line number Diff line change
Expand Up @@ -925,14 +925,6 @@ definition:
type: named
name: String
collections:
- name: customerPreferences
arguments: {}
type: customerPreferences
uniqueness_constraints:
customerPreferences_id:
unique_columns:
- _id
foreign_keys: {}
- name: userProfiles
arguments: {}
type: userProfiles
Expand Down
Loading