Changelog: * Upgraded CDK version to support EFS usage * Upgraded Fargate PlatformVersion to support EFS mounts * Refacored RDS contruct as per new CDK * Created a new LogGroup for OnDemand DagTasks * Added TAG for stack, to track resources belonging to this setup * Updated sample DAG to utilize EFS. Tasks Odd and Even will publish to EFS and Numbers will read from EFS * Now you can see logs from OnDemand tasks on Airflow UI, once task run finishes
17 lines
453 B
Python
17 lines
453 B
Python
from argparse import ArgumentParser
|
|
|
|
parser = ArgumentParser(description='Airflow Fargate Example')
|
|
parser.add_argument('number', help='number', type=int)
|
|
|
|
if __name__ == '__main__':
|
|
args = parser.parse_args()
|
|
number = args.number
|
|
|
|
print("Printing Odd numbers in given range")
|
|
f = open("/shared-volume/odd.txt", "a")
|
|
for i in range(int(number)):
|
|
if(i % 2 != 0):
|
|
f.write(str(i))
|
|
print(i)
|
|
f.close()
|