Skip to content

Commit

Permalink
Merge pull request #2339 from BoCloud/jobflow-desgin
Browse files Browse the repository at this point in the history
add jobflow desgin docs
  • Loading branch information
volcano-sh-bot authored Jul 25, 2022
2 parents 2ecf008 + 6eb9439 commit 1b26306
Show file tree
Hide file tree
Showing 9 changed files with 582 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ are looking forward to your participation.
**NOTE**: the scheduler is built based on [kube-batch](https://github.com/kubernetes-sigs/kube-batch);
refer to [#241](https://github.com/volcano-sh/volcano/issues/241) and [#288](https://github.com/volcano-sh/volcano/pull/288) for more detail.

[JobFlow](./docs/design/jobflow/jobflow.md) is a workflow engine based on volcano Job. It proposes two concepts to automate running multiple batch jobs, named JobTemplate and JobFlow, so end users can easily declare their jobs and run them using complex control primitives such as sequential or parallel execution, if-then -else statement, switch-case statement, loop execution, etc.

![cncf_logo](docs/images/cncf-logo.png)

Volcano is an incubating project of the [Cloud Native Computing Foundation](https://cncf.io/) (CNCF). Please consider joining the CNCF if you are an organization that wants to take an active role in supporting the growth and evolution of the cloud native ecosystem.
Expand All @@ -38,6 +40,8 @@ Volcano is an incubating project of the [Cloud Native Computing Foundation](http

![volcano](docs/images/volcano-architecture.png)

![jobflow-1.png](./docs/design/images/jobflow-1.png)

## Talks

- [Intro: Kubernetes Batch Scheduling @ KubeCon 2019 EU](https://sched.co/MPi7)
Expand Down Expand Up @@ -110,6 +114,10 @@ job.batch/volcano-admission-init 1/1 48s 96s
```

### Disable JobFlow

Disable JobFlow related components if necessary. You need to add --forbid-jobflow=true to the startup parameters of the controller and admission respectively. The default is false to enable the state.

### Install from code

If you don't have a kubernetes cluster, try one-click install from code base:
Expand Down
Binary file added docs/design/images/jobflow-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/images/jobflow-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/images/jobflow-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/images/jobflow-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/design/images/jobflow.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
368 changes: 368 additions & 0 deletions docs/design/jobflow/jobflow.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions example/jobflow/JobFlow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: flow.volcano.sh/v1alpha1
kind: JobFlow
metadata:
name: test
namespace: default
spec:
jobRetainPolicy: delete # After jobflow runs, keep the generated job. Otherwise, delete it.
flows:
- name: a
- name: b
dependsOn:
targets: ['a']
- name: c
dependsOn:
targets: ['b']
- name: d
dependsOn:
targets: ['b']
- name: e
dependsOn:
targets: ['c','d']

184 changes: 184 additions & 0 deletions example/jobflow/JobTemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: a
spec:
minAvailable: 1
schedulerName: volcano
priorityClassName: high-priority
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
tasks:
- replicas: 1
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx:1.14.2
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: b
spec:
minAvailable: 1
schedulerName: volcano
priorityClassName: high-priority
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
tasks:
- replicas: 1
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx:1.14.2
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: c
spec:
minAvailable: 1
schedulerName: volcano
priorityClassName: high-priority
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
tasks:
- replicas: 1
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx:1.14.2
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: d
spec:
minAvailable: 1
schedulerName: volcano
priorityClassName: high-priority
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
tasks:
- replicas: 1
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx:1.14.2
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure
---
apiVersion: flow.volcano.sh/v1alpha1
kind: JobTemplate
metadata:
name: e
spec:
minAvailable: 1
schedulerName: volcano
priorityClassName: high-priority
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 5
queue: default
tasks:
- replicas: 1
name: "default-nginx"
template:
metadata:
name: web
spec:
containers:
- image: nginx:1.14.2
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
resources:
requests:
cpu: "1"
restartPolicy: OnFailure

0 comments on commit 1b26306

Please sign in to comment.