Skip to content

Commit

Permalink
Merge pull request #196 from cityofaustin/adjust-vz-ocr-dag-schedule-…
Browse files Browse the repository at this point in the history
…and-timeout

Adjust timing for VZ OCR ETL
  • Loading branch information
frankhereford authored Jan 3, 2024
2 parents 319960e + da545f9 commit cbe11ea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions dags/vz_cr3_extract_ocr_narrative.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"email_on_failure": False,
"email_on_retry": False,
"retries": 0,
"execution_timeout": duration(minutes=5),
"execution_timeout": duration(minutes=20),
"on_failure_callback": task_fail_slack_alert,
}

Expand All @@ -29,35 +29,38 @@
"HASURA_ADMIN_KEY": {
"opitem": "Vision Zero CRIS Import",
"opfield": "production.GraphQL Endpoint key",
},
},
"AWS_ACCESS_KEY_ID": {
"opitem": "Vision Zero CRIS Import",
"opfield": "production.AWS Access key",
},
"AWS_SECRET_ACCESS_KEY": {
"opitem": "Vision Zero CRIS Import",
"opfield": "production.AWS Secret key",
}
},
}

# fmt: off
with DAG(
dag_id=f"vz_cr3_ocr_narrative_extract_{DEPLOYMENT_ENVIRONMENT}",
default_args=default_args,
# Every 5 minutes, at 8A, 9A, and 10A
schedule_interval="*/5 8-10 * * *" if DEPLOYMENT_ENVIRONMENT == "production" else None,
schedule_interval="*/20 * * * *" if DEPLOYMENT_ENVIRONMENT == "production" else None,
tags=["repo:atd-vz-data", "vision-zero"],
catchup=False,
) as dag:
# fmt: on

@task(
task_id="get_env_vars",
execution_timeout=duration(seconds=30),
)
def get_env_vars():
from utils.onepassword import load_dict

return load_dict(REQUIRED_SECRETS)

env_vars = get_env_vars()

DockerOperator(
task_id="ocr_narrative_extract",
image="atddocker/atd-vz-cr3-extract:production",
Expand Down

0 comments on commit cbe11ea

Please sign in to comment.