Skip to content

feat: 新增 例如任务失败处理逻辑  #2

Open

Description

@googs1025
No description provided.

Activity

  1. googs1025 commented on Jan 14, 2024

    @googs1025
    ContributorAuthor
    apiVersion: api.practice.com/v1alpha1
    kind: JobFlow
    metadata:
      name: jobflow-example
    spec:
      jobs:
        - name: job1
          dependencies: []
          template:
            spec:
              containers:
                - image: busybox:1.28
                  command:
                    - sh
                    - -c
                    - exit 1  # 模拟作业失败
                  imagePullPolicy: IfNotPresent
                  name: nginx
        - name: job2
          template:
            spec:
              containers:
                - image: busybox:1.28
                  command:
                    - sh
                    - -c
                    - echo "Job 2 executed"
                  imagePullPolicy: IfNotPresent
                  name: nginx
          dependencies:
            - job1
        - name: job3
          template:
            spec:
              containers:
                - image: busybox:1.28
                  command:
                    - sh
                    - -c
                    - echo "Job 3 executed"
                  imagePullPolicy: IfNotPresent
                  name: nginx
          dependencies:
            - job1
            - job2
        - name: job4
          template:
            spec:
              containers:
                - image: busybox:1.28
                  command:
                    - sh
                    - -c
                    - echo "Job 4 executed"
                  imagePullPolicy: IfNotPresent
                  name: nginx
          dependencies:
            - job1
        - name: job5
          dependencies:
            - job4
            - job2
          template:
            spec:
              containers:
                - image: busybox:1.28
                  command:
                    - sh
                    - -c
                    - echo "Job 5 executed"
                  imagePullPolicy: IfNotPresent
                  name: nginx
      errorHandler:  # 可设计为 当任一一个任务出错时,进行的业务逻辑
        template:
          spec:
            containers:
              - image: <your-error-handler-image>
                # 调整为你的错误处理镜像
                command:
                  - sh
                  - -c
                  - echo "Error handler executed"
                imagePullPolicy: IfNotPresent
                name: error-handler
  2. googs1025 commented on Jan 14, 2024

    @googs1025
    ContributorAuthor

    设计为 image or scipt type 类型

  3. self-assigned this
    on Jan 14, 2024
  4. removed their assignment
    on Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions