天天看點

Azkaban嵌套流的依賴

Azkaban嵌套流的依賴

在Azkaban工作流的定義檔案中可以添加子工作流

檢視官方文檔

https://azkaban.readthedocs.io/en/latest/createFlows.html

給出了

Embedded Flows

定義嵌套工作流的執行個體

nodes:
  - name: jobC
    type: noop
    dependsOn:
      - embedded_flow
 
  - name: embedded_flow
    type: flow
    config:
      prop: value
    nodes:
      - name: jobB
        type: noop
        dependsOn:
          - jobA
 
      - name: jobA
        type: command
        config:
          command: pwd
           

結構如下

Azkaban嵌套流的依賴

嵌套工作流之間的依賴

為了進一步了解,對上述示例進一步加深

目錄中檔案結構如下

|groupA
|--ga_1.sh
|--gn_2.sh
|groupB
|--gb_1.sh
|--gb_2.sh
|embedded.flow
|embedded.project
           

embedded.flow

工作流定義如下

nodes:
  - name: jobA
    type: noop
    dependsOn:
      - groupA
 
  - name: groupA
    type: flow
    config:
      prop: value
    dependsOn:
      - groupB
    nodes:
      - name: jobA1
        type: command
        config:
          command: sh ./groupA/ga_1.sh
      - name: jobA2
        type: command
        config:
          command: sh ./groupA/ga_2.sh
 
  - name: groupB
    type: flow
    config:
      prop: value
    nodes:
      - name: jobB1
        type: command
        config:
          command: sh ./groupB/gb_1.sh
      - name: jobB2
        type: command
        config:
          command: sh ./groupB/gb_2.sh
           

打包上産到Azkaban的project,可以檢視工作流的結構如下

實作了不同嵌套流之間的依賴

Azkaban嵌套流的依賴

繼續閱讀