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

Optimize tx receipts streamline #16

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a0fc417
init setup
forgxyz Jun 7, 2023
d0dba49
disable dev refresh schedula
forgxyz Jun 7, 2023
e56ed8b
other xyz references
forgxyz Jun 7, 2023
892ee5b
Merge pull request #1 from FlipsideCrypto/init-files
forgxyz Jun 7, 2023
4e289b5
init del close tag
forgxyz Jun 7, 2023
aff590e
init dbt profile for gha
forgxyz Jun 7, 2023
1937a69
init dbt profile for gha
forgxyz Jun 7, 2023
cae6b65
add: streamline bronce blocks
WHYTEWYLL Jun 28, 2023
3fc484c
add: bronze streamline
WHYTEWYLL Jun 28, 2023
ec708c3
added the GHA
xiuy001 Jun 29, 2023
ca8e748
Merge pull request #2 from FlipsideCrypto/add-streamline-structure
xiuy001 Jun 29, 2023
a48b815
add silver
WHYTEWYLL Jun 30, 2023
6a9248b
merge streamline
WHYTEWYLL Jun 30, 2023
3c971a6
add: gold blocks
WHYTEWYLL Jun 30, 2023
985dd18
add: receipts and transactions
WHYTEWYLL Jul 1, 2023
6434919
add: logs and relevant
WHYTEWYLL Jul 2, 2023
618b31f
fix: format macro
WHYTEWYLL Jul 2, 2023
0870c1c
add: gold core receipts
WHYTEWYLL Jul 2, 2023
1880f4e
fix:macros test
WHYTEWYLL Jul 5, 2023
77787e8
fix:macros test
WHYTEWYLL Jul 5, 2023
9cbb2fa
Merge pull request #3 from WHYTEWYLL/AN-3386-curate-standard-silver-m…
WHYTEWYLL Jul 5, 2023
d1d36fe
add: test workflow for aurora
WHYTEWYLL Jul 6, 2023
5b3d55f
add: python alert
WHYTEWYLL Jul 6, 2023
bb2cc20
update to add the tx receipts method and the GHA
xiuy001 Jul 10, 2023
ace30aa
update the params
xiuy001 Jul 10, 2023
cad41c5
Merge pull request #4 from WHYTEWYLL/AN-3386-curate-standard-silver-m…
WHYTEWYLL Jul 10, 2023
9bed25b
merged from main
xiuy001 Jul 10, 2023
6e2c3df
Merge pull request #5 from FlipsideCrypto/update-node-add-methods
xiuy001 Jul 10, 2023
015dbda
fix: receipts
WHYTEWYLL Jul 11, 2023
988bfc2
fix: tx
WHYTEWYLL Jul 11, 2023
aa47579
Merge pull request #6 from WHYTEWYLL/fix_receitps
WHYTEWYLL Jul 11, 2023
bfa442c
add: ref receipts
WHYTEWYLL Jul 11, 2023
dbc1aa3
Merge pull request #7 from WHYTEWYLL/fix_receitps
WHYTEWYLL Jul 11, 2023
9aa661c
fix: receipts data
WHYTEWYLL Jul 11, 2023
449cfe6
add the backfill job and update the gha names
xiuy001 Jul 11, 2023
f3611c8
update the cron time
xiuy001 Jul 11, 2023
439a319
delete: block_number
WHYTEWYLL Jul 11, 2023
84fb641
setting back fr to false
WHYTEWYLL Jul 11, 2023
fdab696
Merge pull request #8 from WHYTEWYLL/fix_receitps
forgxyz Jul 11, 2023
10059e5
Merge pull request #9 from FlipsideCrypto/add-backfill-jobs-gha
forgxyz Jul 11, 2023
b5df7a1
fix: remove FR
WHYTEWYLL Jul 11, 2023
a659272
Merge pull request #10 from WHYTEWYLL/fix_receitps
WHYTEWYLL Jul 11, 2023
9cd4d76
fix: prelaunch
WHYTEWYLL Jul 12, 2023
442a766
fix: schedule
WHYTEWYLL Jul 12, 2023
7bc15a9
add: block_timestamp to receipts
WHYTEWYLL Jul 12, 2023
05237e3
Merge pull request #11 from WHYTEWYLL/changes_prelaunch
WHYTEWYLL Jul 12, 2023
5568f13
fix:
WHYTEWYLL Jul 12, 2023
621f06d
fixL qualify
WHYTEWYLL Jul 12, 2023
fdd3075
test blocknumber
WHYTEWYLL Jul 12, 2023
1e4a833
positions
WHYTEWYLL Jul 12, 2023
818c6b7
fix: amb
WHYTEWYLL Jul 12, 2023
e6b5a91
test transactio txhash
WHYTEWYLL Jul 12, 2023
5257631
Merge pull request #12 from WHYTEWYLL/changes_prelaunch
forgxyz Jul 12, 2023
35cc1db
add: datashare deploy
WHYTEWYLL Jul 13, 2023
6ce9565
fix: test and python url
WHYTEWYLL Jul 13, 2023
41d1715
blocknumber out of yml
WHYTEWYLL Jul 13, 2023
576f52b
add: here tag
WHYTEWYLL Jul 13, 2023
d4f61b0
Merge pull request #13 from WHYTEWYLL/changes_prelaunch
WHYTEWYLL Jul 13, 2023
80e27c4
fix: slack alert and weekly tests
WHYTEWYLL Jul 13, 2023
f316ef0
Merge pull request #14 from WHYTEWYLL/changes_prelaunch
WHYTEWYLL Jul 13, 2023
7ef7b27
fix: alert
WHYTEWYLL Jul 13, 2023
5958a46
Merge pull request #15 from WHYTEWYLL/changes_prelaunch
WHYTEWYLL Jul 13, 2023
dae2536
added
xiuy001 Jul 19, 2023
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
29 changes: 29 additions & 0 deletions .github/workflows/.dbt/profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
aurora:
target: dev
outputs:
dev:
type: snowflake
account: "{{ env_var('ACCOUNT') }}"
user: "{{ env_var('USER') }}"
password: "{{ env_var('PASSWORD') }}"
role: "{{ env_var('ROLE') }}"
schema: "{{ env_var('SCHEMA') }}"
region: "{{ env_var('REGION') }}"
database: "{{ env_var('DATABASE') }}"
warehouse: "{{ env_var('WAREHOUSE') }}"
threads: 8
client_session_keep_alive: False
prod:
type: snowflake
account: "{{ env_var('ACCOUNT') }}"
user: "{{ env_var('USER') }}"
password: "{{ env_var('PASSWORD') }}"
role: "{{ env_var('ROLE') }}"
schema: "{{ env_var('SCHEMA') }}"
region: "{{ env_var('REGION') }}"
database: "{{ env_var('DATABASE') }}"
warehouse: "{{ env_var('WAREHOUSE') }}"
threads: 8
client_session_keep_alive: False
config:
send_anonymous_usage_stats: False
48 changes: 3 additions & 45 deletions .github/workflows/dbt_docs_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,6 @@ concurrency:
group: ${{ github.workflow }}

jobs:
scheduled_run:
name: docs_update
runs-on: ubuntu-latest
environment:
name: workflow_prod

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v1
with:
python-version: "3.7.x"

- name: install dependencies
run: |
pip install dbt-snowflake==${{ vars.DBT_VERSION }}
dbt deps
- name: checkout docs branch
run: |
git checkout -b docs origin/main

- name: generate dbt docs
run: dbt docs generate -t prod

- name: move files to docs directory
run: |
mkdir -p ./docs
cp target/{catalog.json,manifest.json,index.html} docs/
- name: clean up target directory
run: dbt clean

- name: check for changes
run: git status

- name: stage changed files
run: git add .

- name: commit changed files
run: |
git config user.email "abc@xyz"
git config user.name "github-actions"
git commit -am "Auto-update docs"
- name: push changes to docs
run: |
git push -f --set-upstream origin docs
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_docs_updates.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/dbt_run_adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
dbt deps
- name: Run DBT Jobs
run: |
${{ inputs.dbt_command }}
${{ inputs.dbt_command }}
46 changes: 46 additions & 0 deletions .github/workflows/dbt_run_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: dbt_run_deployment
run-name: dbt_run_deployment

on:
workflow_dispatch:
branches:
- "main"
inputs:
warehouse:
type: choice
description: Snowflake warehouse
required: true
options:
- DBT
- DBT_CLOUD
- DBT_EMERGENCY
default: DBT
dbt_command:
type: string
description: "DBT Run Command"
required: true

env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ inputs.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"

concurrency:
group: ${{ github.workflow }}

jobs:
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_deployment_template.yml@main
with:
dbt_command: |
${{ inputs.dbt_command }}
warehouse: ${{ inputs.WAREHOUSE }}
secrets: inherit
11 changes: 6 additions & 5 deletions .github/workflows/dbt_run_dev_refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ run-name: dbt_run_dev_refresh

on:
workflow_dispatch:
# schedule:
# # Runs "at 9:00 UTC" (see https://crontab.guru)
# - cron: '0 9 * * *'

schedule:
# TODO enable schedule when ready
# Runs "at 9:00 UTC" (see https://crontab.guru)
- cron: "0 9 * * *"

env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
Expand All @@ -31,4 +32,4 @@ jobs:
dbt run-operation run_sp_create_prod_clone
environment: workflow_prod
warehouse: ${{ vars.WAREHOUSE }}
secrets: inherit
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/dbt_run_scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: dbt_run_scheduled
run-name: dbt_run_scheduled

on:
workflow_dispatch:
schedule:
# Runs "every hour" (see https://crontab.guru)
- cron: "0 */1 * * *"

env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"

concurrency:
group: ${{ github.workflow }}

jobs:
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_template.yml@main
with:
dbt_command: >
dbt run
environment: workflow_prod
warehouse: ${{ vars.WAREHOUSE }}
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/dbt_run_streamline_history.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: dbt_run_streamline_history
run-name: dbt_run_streamline_history

on:
workflow_dispatch:
schedule:
# Runs "every 4 hours" (see https://crontab.guru)
- cron: "0 */4 * * *"

env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"

concurrency:
group: ${{ github.workflow }}

jobs:
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_template.yml@main
with:
dbt_command: >
dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True, "STREAMLINE_RUN_HISTORY":True}' -m 1+models/silver/streamline/realtime/ --full-refresh
environment: workflow_prod
warehouse: ${{ vars.WAREHOUSE }}
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/dbt_run_streamline_realtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: dbt_run_streamline_realtime
run-name: dbt_run_streamline_realtime

on:
workflow_dispatch:
schedule:
# Runs "every 2 hours" (see https://crontab.guru)
- cron: "0 */2 * * *"

env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"

concurrency:
group: ${{ github.workflow }}

jobs:
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_template.yml@main
with:
dbt_command: >
dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m 1+models/silver/streamline/realtime/
environment: workflow_prod
warehouse: ${{ vars.WAREHOUSE }}
secrets: inherit
50 changes: 50 additions & 0 deletions .github/workflows/dbt_test_daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: dbt_test_daily
run-name: dbt_test_daily

on:
workflow_dispatch:
schedule:
# Run at 1600 UTC daily (see https://crontab.guru)
- cron: "0 9 * * *"
env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"

concurrency:
group: ${{ github.workflow }}

jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_prod

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v1
with:
python-version: "3.7.x"

- name: install dependencies
run: |
pip3 install dbt-snowflake==${{ env.DBT_VERSION }} cli_passthrough requests click
dbt deps
- name: Run DBT Jobs
run: |
dbt test --exclude tag:full_test --models tag:recent_test
continue-on-error: true

- name: Log test results
run: |
python python_scripts/test_alert/dbt_test_alert.py
50 changes: 50 additions & 0 deletions .github/workflows/dbt_test_weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: dbt_test_weekly
run-name: dbt_test_weekly

on:
workflow_dispatch:
schedule:
# Run at 1600 UTC Monday (see https://crontab.guru)
- cron: "0 9 * * 1"
env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"

concurrency:
group: ${{ github.workflow }}

jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_prod

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v1
with:
python-version: "3.7.x"

- name: install dependencies
run: |
pip3 install dbt-snowflake==${{ env.DBT_VERSION }} cli_passthrough requests click
dbt deps
- name: Run DBT Jobs
run: |
dbt test --exclude tag:recent_test --models tag:full_test
continue-on-error: true

- name: Log test results
run: |
python python_scripts/test_alert/dbt_test_alert.py
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ logs/
.vscode/
.env
.DS_Store
.user.yml
.user.yml

.dbt/.user.yml
.github/workflows/.dbt/.user.yml

local*
Loading