2

嗨,我正在学习 dagster,我需要有关启动计划的帮助我可以在 dagit 中添加和启动计划,但我想自动启动计划,而不是从 dagit 打开每个计划。

#这是我的代码

@solid()
def test(context):
   context.log.info("test")
  
@pipeline()
def testPipeline():
    test()

@schedule(
    cron_schedule="* * * * *", pipeline_name="testPipeline", execution_timezone="Asia/Kolkata"
)
def scheduleTest():
    return {}

@repository()
def testRepo():
    return [testPipeline, scheduleTest]
4

2 回答 2

2

Dagster GraphQL API有一个startSchedule突变,它有一个 Python 客户端。我不知道如何调用它来开始您的具体日程安排,但我认为这条路线是一个不错的选择。

于 2021-09-07T16:56:33.077 回答
1

我对 dagster slack 有一个非常相同的问题,所以我转发 Daniel Gibson 的答案,这可能会有所帮助。

  • 从 0.14.0 版本开始,可以创建已经启用的计划(将在一周内发布)。

  • 此外,还有一个dagster schedule start --start-all命令行命令,每次添加计划时调用它都是一种解决方法

于 2022-02-08T20:18:09.947 回答