From 32eeb065b7ee73b1a18987c6727811601ca6d5e1 Mon Sep 17 00:00:00 2001 From: Austin <93135983+austinFlipside@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:34:03 -0500 Subject: [PATCH] updates (#236) --- .github/workflows/dbt_run_abi_refresh.yml | 13 +++--- ...heduled_decoded_logs_history_user_abis.yml | 45 ------------------- .github/workflows/dbt_test_tasks.yml | 29 ------------ data/github_actions__workflows.csv | 9 ++-- .../api_udf/bronze_api__contract_abis.sql | 4 +- 5 files changed, 13 insertions(+), 87 deletions(-) delete mode 100644 .github/workflows/dbt_run_scheduled_decoded_logs_history_user_abis.yml delete mode 100644 .github/workflows/dbt_test_tasks.yml diff --git a/.github/workflows/dbt_run_abi_refresh.yml b/.github/workflows/dbt_run_abi_refresh.yml index e9a78d0..4c1af74 100644 --- a/.github/workflows/dbt_run_abi_refresh.yml +++ b/.github/workflows/dbt_run_abi_refresh.yml @@ -3,9 +3,8 @@ run-name: dbt_run_abi_refresh on: workflow_dispatch: - schedule: - # Runs “At minute 35 past every 12th hour.” (see https://crontab.guru) - - cron: '35 */12 * * *' + branches: + - "main" env: DBT_PROFILES_DIR: ./ @@ -42,9 +41,11 @@ jobs: run: | pip install -r requirements.txt dbt deps - - name: Run DBT Jobs + + - name: Update ABI models run: | dbt run -m "base_models,tag:abis" - - + - name: Kick off decoded logs history, if there are new ABIs from users + run: | + dbt run-operation run_decoded_logs_history \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_decoded_logs_history_user_abis.yml b/.github/workflows/dbt_run_scheduled_decoded_logs_history_user_abis.yml deleted file mode 100644 index 63bf5a2..0000000 --- a/.github/workflows/dbt_run_scheduled_decoded_logs_history_user_abis.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: dbt_run_scheduled_decoded_logs_history_user_abis -run-name: dbt_run_scheduled_decoded_logs_history_user_abis - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - 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: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Kick off decoded logs history, if there are new ABIs from users - run: | - dbt run-operation run_decoded_logs_history \ No newline at end of file diff --git a/.github/workflows/dbt_test_tasks.yml b/.github/workflows/dbt_test_tasks.yml deleted file mode 100644 index b2861c3..0000000 --- a/.github/workflows/dbt_test_tasks.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: dbt_test_tasks -run-name: dbt_test_tasks - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - 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_test_tasks.yml@AN-4374/upgrade-dbt-1.7 - secrets: inherit \ No newline at end of file diff --git a/data/github_actions__workflows.csv b/data/github_actions__workflows.csv index e565102..5c990b8 100644 --- a/data/github_actions__workflows.csv +++ b/data/github_actions__workflows.csv @@ -1,8 +1,7 @@ workflow_name,workflow_schedule -dbt_run_scheduled_non_realtime,"22,52 * * * *" +dbt_run_scheduled_non_realtime,"22 * * * *" dbt_run_streamline_chainhead,"15,45 * * * *" -dbt_run_streamline_decoder,"0,30 * * * *" -dbt_run_scheduled_curated,"40 * * * *" -dbt_test_tasks,"15 * * * *" +dbt_run_streamline_decoder,"33 * * * *" +dbt_run_scheduled_curated,"40 */4 * * *" dbt_run_streamline_decoded_logs_history,"45 7 * * 6" -dbt_run_scheduled_decoded_logs_history_user_abis,"39 23 * * *" \ No newline at end of file +dbt_run_abi_refresh,"32 23 * * *" \ No newline at end of file diff --git a/models/bronze/api_udf/bronze_api__contract_abis.sql b/models/bronze/api_udf/bronze_api__contract_abis.sql index a3ae52b..92735e0 100644 --- a/models/bronze/api_udf/bronze_api__contract_abis.sql +++ b/models/bronze/api_udf/bronze_api__contract_abis.sql @@ -25,7 +25,7 @@ WHERE {% endif %} order by total_interaction_count desc LIMIT - 50 + 400 ), all_contracts AS ( SELECT contract_address @@ -47,7 +47,7 @@ row_nos AS ( FROM all_contracts ), -batched AS ({% for item in range(55) %} +batched AS ({% for item in range(501) %} SELECT rn.contract_address, live.udf_api('GET', CONCAT('https://api.basescan.org/api?module=contract&action=getabi&address=', rn.contract_address, '&apikey={key}'),{ 'User-Agent': 'FlipsideStreamline' },{}, 'Vault/prod/block_explorers/base_scan') AS abi_data, SYSDATE() AS _inserted_timestamp FROM