Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
googs1025 opened this issue Jan 13, 2024 · 2 comments
Open

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

googs1025 opened this issue Jan 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@googs1025
Copy link
Member

No description provided.

@googs1025
Copy link
Member Author

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

@googs1025
Copy link
Member Author

设计为 image or scipt type 类型

@googs1025 googs1025 self-assigned this Jan 14, 2024
@googs1025 googs1025 added the enhancement New feature or request label Jan 14, 2024
@googs1025 googs1025 removed their assignment Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant