Skip to content

Instantly share code, notes, and snippets.

View adamantnz's full-sized avatar
:shipit:

Adam adamantnz

:shipit:
  • Fluidly
  • London
View GitHub Profile
import airflow
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
from pathlib import Path
import boto3
# dag methods
> aws events describe-rule --name "airflow-start-scheduler-service" --profile test
{
"Name": "airflow-start-scheduler-service",
"Arn": "arn:aws:events:<region>:<accountid>:rule/airflow-start-scheduler-service",
"ScheduleExpression": "cron(0/5 * * * ? *)",
"State": "ENABLED",
"Description": "runs 'airflow scheduler --run-duration 300' on airflow server every 300 seconds to ensure scheduler is always running"
}