mirror of
https://github.com/FlipsideCrypto/ethereum-models.git
synced 2026-02-06 13:46:47 +00:00
Add workflow for user-abi-triggered decoded traces history (#982)
* add workflow * format * delete req * change timing * use 1 workflow * name * add to csv * name * name * delete
This commit is contained in:
parent
65feb9ff48
commit
7e9c2d527d
@ -1,5 +1,5 @@
|
||||
name: dbt_run_scheduled_decoded_logs_history_user_abis
|
||||
run-name: dbt_run_scheduled_decoded_logs_history_user_abis
|
||||
name: dbt_run_scheduled_decoded_history_user_abis
|
||||
run-name: dbt_run_scheduled_decoded_history_user_abis
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@ -40,6 +40,6 @@ jobs:
|
||||
pip install -r requirements.txt
|
||||
dbt deps
|
||||
|
||||
- name: Kick off decoded logs history, if there are new ABIs from users
|
||||
- name: Kick off decoded history, if there are new ABIs from users
|
||||
run: |
|
||||
dbt run-operation run_decoded_logs_history
|
||||
dbt run-operation run_decoded_history
|
||||
@ -3,9 +3,8 @@ run-name: dbt_run_streamline_decoded_traces_history
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Runs “At 22:05 every Saturday.” (see https://crontab.guru)
|
||||
- cron: '5 22 * * 6'
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
DBT_PROFILES_DIR: ./
|
||||
@ -46,5 +45,3 @@ jobs:
|
||||
- name: Decode historical traces
|
||||
run: |
|
||||
dbt run-operation decoded_traces_history --args '{"backfill_mode": false}' --vars '{"STREAMLINE_INVOKE_STREAMS":True}'
|
||||
|
||||
|
||||
|
||||
@ -8,4 +8,5 @@ dbt_run_streamline_beacon,"55 */1 * * *"
|
||||
dbt_test_tasks,"0 * * * *"
|
||||
dbt_test_intraday,"34 */4 * * *"
|
||||
dbt_run_streamline_decoded_logs_history,"42 9 * * 6"
|
||||
dbt_run_scheduled_decoded_logs_history_user_abis,"46 23 * * *"
|
||||
dbt_run_streamline_decoded_traces_history,"5 22 * * 6"
|
||||
dbt_run_scheduled_decoded_history_user_abis,"46 23 * * *"
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
) } -%}
|
||||
{% set wait_time = var(
|
||||
"DECODED_TRACES_HISTORY_WAIT_TIME",
|
||||
60
|
||||
180
|
||||
) %}
|
||||
{% set find_months_query %}
|
||||
WITH base AS (
|
||||
34
macros/decoder/run_decoded_history.sql
Normal file
34
macros/decoder/run_decoded_history.sql
Normal file
@ -0,0 +1,34 @@
|
||||
{% macro run_decoded_history() %}
|
||||
{% set check_for_new_user_abis_query %}
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
{{ ref('silver__user_verified_abis') }}
|
||||
WHERE
|
||||
_inserted_timestamp :: DATE = SYSDATE() :: DATE
|
||||
AND DAYNAME(SYSDATE()) <> 'Sat' {% endset %}
|
||||
{% set results = run_query(check_for_new_user_abis_query) %}
|
||||
{% if execute %}
|
||||
{% set new_user_abis = results.columns [0].values() [0] %}
|
||||
{% if new_user_abis %}
|
||||
{% set invoke_logs_query %}
|
||||
SELECT
|
||||
github_actions.workflow_dispatches(
|
||||
'FlipsideCrypto',
|
||||
'ethereum-models',
|
||||
'dbt_run_streamline_decoded_logs_history.yml',
|
||||
NULL
|
||||
) {% endset %}
|
||||
{% set invoke_traces_query %}
|
||||
SELECT
|
||||
github_actions.workflow_dispatches(
|
||||
'FlipsideCrypto',
|
||||
'ethereum-models',
|
||||
'dbt_run_streamline_decoded_traces_history.yml',
|
||||
NULL
|
||||
) {% endset %}
|
||||
{% do run_query(invoke_logs_query) %}
|
||||
{% do run_query(invoke_traces_query) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -1,29 +0,0 @@
|
||||
{% macro run_decoded_logs_history() %}
|
||||
|
||||
{% set check_for_new_user_abis_query %}
|
||||
select 1
|
||||
from {{ ref('silver__user_verified_abis') }}
|
||||
where _inserted_timestamp::date = sysdate()::date
|
||||
and dayname(sysdate()) <> 'Sat'
|
||||
{% endset %}
|
||||
|
||||
{% set results = run_query(check_for_new_user_abis_query) %}
|
||||
|
||||
{% if execute %}
|
||||
{% set new_user_abis = results.columns[0].values()[0] %}
|
||||
|
||||
{% if new_user_abis %}
|
||||
{% set invoke_workflow_query %}
|
||||
SELECT
|
||||
github_actions.workflow_dispatches(
|
||||
'FlipsideCrypto',
|
||||
'ethereum-models',
|
||||
'dbt_run_streamline_decoded_logs_history.yml',
|
||||
NULL
|
||||
)
|
||||
{% endset %}
|
||||
|
||||
{% do run_query(invoke_workflow_query) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
Loading…
Reference in New Issue
Block a user