如何简化阶跃函数的复杂并行分支相互依赖性 [英] How to simplify complex parallel branch interdependencies for Step Functions

查看:82
本文介绍了如何简化阶跃函数的复杂并行分支相互依赖性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是将依赖节点列表转换为AWS Step Functions.AWS Step Function定义允许并行分支,甚至嵌套到多个级别的分支.不幸的是,它不支持分支中任务之间的依赖关系,因此迫使您在两个结果都可用于步骤功能中的后续任务之前完成并行步骤.

I have the task of translating a list of dependent nodes into AWS Step Functions. The AWS Step Function definition allows for parallel branches or even branches nested to multiple levels deep. Unfortunately it does not support dependencies between tasks in the branches and therefore forces you to complete the parallel step before both results are available to subsequent tasks in the step function.

在我的图表中,步进函数很容易支持如图1所示的简单并行分支.

In my diagram delow a simple parallel branch like shown in Graph 1 is easily supported by Step Functions.

对于图2尤其是图3而言,这成为一个问题.

When it comes to Graph 2 and especially Graph 3 it becomes a problem.

作为一种简单的方法,我们可以引入其他节点以将其依存节点的结果收集在一起,如图2b和3b所示,但这现在引入了以前不存在的依存关系:

As a simple approach we could introduce additional nodes to collect the results together for their dependent nodes as demonstrated in Graphs 2b and 3b but this now introduces dependencies that didn't exist before:

  • 在图2b中,引入了这些新的依赖关系:
    • E-> A,F-> A
    • E-> A,F-> A,F-> B,C-> E

    这是一个问题,因为对于手动批准任务,这些任务的时间可能在几小时到几天之间.这将导致以后的步骤因不依赖于它们的任务而不必要地延迟.

    This is a problem because in the case of manual approval tasks the time for these tasks could be in the order of hours to days. This would cause later steps to be delayed unnecessarily by tasks that they do not have dependencies on.

    有关如何解决此问题的任何建议?也许我可以采取其他方法?也许有些花哨的图论算法可以应用?我什至不知道用什么词来解释图论中的这个问题.

    Any suggestions on how to solve this? Maybe I could take a different approach? Maybe there is some fancy graph theory algorithm I can apply? I don't even know what words to use to explain this problem in graph theory.

    这是

    Here is a url for playing with these graphs on draw.io if you need to.

    推荐答案

    从根本上讲,您要求的是 DAG,而Amazon States Language是基于状态机的.所以我认为您的问题没有解决的办法.

    Fundamentally what you asked is a DAG while the Amazon States Language is state machine based. So I don't think there is a solution for your problem.

    这篇关于如何简化阶跃函数的复杂并行分支相互依赖性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆