是否可以将选项从 azkaban 工作流程传递到底层工作代码?
我有这样的东西,它适用于硬编码/预先知道的日期,但我希望可以选择在执行流程时指定日期:
from azkaban import Job, Project
import datetime
import os
from datetime import datetime, timezone, timedelta
options = {
'start.date' : today.strftime('%Y-%m-%d'), # Can we pass this as an argument to the underlying code?
'day.offset' : 1
}
project = Project('my_project',root=__file__)
project.add_file('my_shell_script.sh', 'my_shell_script.sh')
project.add_job('my_job', Job(options, {'type' : 'command' : 'bash my_shell_script <pass date here?>'}))
project.add_job('my_job', Job(options, {'type' : 'command' : 'java -jar test.jar <pass date here?>'}))
谢谢,沙拉特