how to terminate workflow with plugin? (Volcano Job) #13486
-
Firstly, I install plugin vcJob(https://github.com/xfyun/argo-volcano-executor-plugin), then I build a workflow: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volcano-dag-job-
spec:
entrypoint: volcano-dag-job
templates:
- name: volcano-dag-job
dag:
tasks:
- name: echo-start
template: start
arguments:
parameters: [{name: message, value: echo start}]
- name: wholesay
template: hello-tmpl
arguments:
parameters: [{name: message, value: hello2a}, {name: task, value: hello2a}]
dependencies: [echo-start]
- name: echo-end
template: end
arguments:
parameters: [{name: message, value: echo end}]
dependencies: [wholesay]
- name: start
inputs:
parameters:
- name: message
plugin:
volcano:
job:
apiVersion: batch.volcano.sh/v1alpha1
kind: Job
metadata:
namespace: "{{workflow.namespace}}"
name: "{{workflow.name}}-echo-start"
ownerReferences:
- apiVersion: argoproj.io/v1alpha1
blockOwnerDeletion: true
kind: Workflow
name: "{{workflow.name}}"
uid: "{{workflow.uid}}"
spec:
minAvailable: 1
schedulerName: volcano
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 1
queue: vc-queue
tasks:
- name: "task1"
replicas: 1
template:
metadata:
name: helloworld1
spec:
containers:
- image: alpine:3.7
name: echo
imagePullPolicy: IfNotPresent
command: [echo, "{{inputs.parameters.message}}"]
resources:
requests:
cpu: "100m"
restartPolicy: Never
- name: end
inputs:
parameters:
- name: message
plugin:
volcano:
job:
apiVersion: batch.volcano.sh/v1alpha1
kind: Job
metadata:
namespace: "{{workflow.namespace}}"
name: "{{workflow.name}}-echo-end"
ownerReferences:
- apiVersion: argoproj.io/v1alpha1
blockOwnerDeletion: true
kind: Workflow
name: "{{workflow.name}}"
uid: "{{workflow.uid}}"
spec:
minAvailable: 1
schedulerName: volcano
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 1
queue: vc-queue
tasks:
- name: "task1"
replicas: 1
template:
metadata:
name: helloworld1
spec:
containers:
- image: alpine:3.7
name: echo
imagePullPolicy: IfNotPresent
command: [echo, "{{inputs.parameters.message}}"]
resources:
requests:
cpu: "100m"
restartPolicy: Never
- name: hello-tmpl
inputs:
parameters:
- name: message
- name: task
plugin:
volcano:
job:
apiVersion: batch.volcano.sh/v1alpha1
kind: Job
metadata:
namespace: "{{workflow.namespace}}"
name: "{{workflow.name}}-main-task"
ownerReferences:
- apiVersion: argoproj.io/v1alpha1
blockOwnerDeletion: true
kind: Workflow
name: "{{workflow.name}}"
uid: "{{workflow.uid}}"
spec:
minAvailable: 1
schedulerName: volcano
policies:
- event: PodEvicted
action: RestartJob
plugins:
ssh: []
env: []
svc: []
maxRetry: 1
queue: vc-queue
tasks:
- name: "task999"
replicas: 1
template:
metadata:
name: helloworld1
spec:
containers:
- image: docker/whalesay
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args: [sleep 60]
name: hello111
resources:
requests:
cpu: "2"
memory: "8Gi"
restartPolicy: Never
- name: "task999999"
replicas: 1
template:
metadata:
name: helloworld222
spec:
containers:
- image: docker/whalesay
imagePullPolicy: IfNotPresent
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
name: hello222
resources:
requests:
cpu: "100m"
restartPolicy: Never I use I get the workflow:{
"apiVersion": "argoproj.io/v1alpha1",
"kind": "Workflow",
"metadata": {
"annotations": {
"workflows.argoproj.io/pod-name-format": "v2"
},
"creationTimestamp": "2024-08-20T02:46:18Z",
"generateName": "volcano-dag-job-",
"generation": 15,
"labels": {
"workflows.argoproj.io/completed": "true",
"workflows.argoproj.io/phase": "Succeeded",
"workflows.argoproj.io/resubmitted-from-workflow": "volcano-dag-job-7n9b5",
"workflows.argoproj.io/workflow-archiving-status": "Archived"
},
"name": "volcano-dag-job-m9w7l",
"namespace": "argo",
"resourceVersion": "124949",
"uid": "81ea0921-fee6-4073-95f0-4ac6af796e4f"
},
"spec": {
"arguments": {},
"entrypoint": "volcano-dag-job",
"shutdown": "Terminate",
"templates": [
{
"dag": {
"tasks": [
{
"arguments": {
"parameters": [
{
"name": "message",
"value": "echo start"
}
]
},
"name": "echo-start",
"template": "start"
},
{
"arguments": {
"parameters": [
{
"name": "message",
"value": "hello2a"
},
{
"name": "task",
"value": "hello2a"
}
]
},
"dependencies": [
"echo-start"
],
"name": "wholesay",
"template": "hello-tmpl"
},
{
"arguments": {
"parameters": [
{
"name": "message",
"value": "echo end"
}
]
},
"dependencies": [
"wholesay"
],
"name": "echo-end",
"template": "end"
}
]
},
"inputs": {},
"metadata": {},
"name": "volcano-dag-job",
"outputs": {}
},
{
"inputs": {
"parameters": [
{
"name": "message"
}
]
},
"metadata": {},
"name": "start",
"outputs": {},
"plugin": {
"volcano": {
"job": {
"apiVersion": "batch.volcano.sh/v1alpha1",
"kind": "Job",
"metadata": {
"name": "{{workflow.name}}-echo-start",
"namespace": "{{workflow.namespace}}",
"ownerReferences": [
{
"apiVersion": "argoproj.io/v1alpha1",
"blockOwnerDeletion": true,
"kind": "Workflow",
"name": "{{workflow.name}}",
"uid": "{{workflow.uid}}"
}
]
},
"spec": {
"maxRetry": 1,
"minAvailable": 1,
"plugins": {
"env": [],
"ssh": [],
"svc": []
},
"policies": [
{
"action": "RestartJob",
"event": "PodEvicted"
}
],
"queue": "vc-queue",
"schedulerName": "volcano",
"tasks": [
{
"name": "task1",
"replicas": 1,
"template": {
"metadata": {
"name": "helloworld1"
},
"spec": {
"containers": [
{
"command": [
"echo",
"{{inputs.parameters.message}}"
],
"image": "alpine:3.7",
"imagePullPolicy": "IfNotPresent",
"name": "echo",
"resources": {
"requests": {
"cpu": "100m"
}
}
}
],
"restartPolicy": "Never"
}
}
}
]
}
}
}
}
},
{
"inputs": {
"parameters": [
{
"name": "message"
}
]
},
"metadata": {},
"name": "end",
"outputs": {},
"plugin": {
"volcano": {
"job": {
"apiVersion": "batch.volcano.sh/v1alpha1",
"kind": "Job",
"metadata": {
"name": "{{workflow.name}}-echo-end",
"namespace": "{{workflow.namespace}}",
"ownerReferences": [
{
"apiVersion": "argoproj.io/v1alpha1",
"blockOwnerDeletion": true,
"kind": "Workflow",
"name": "{{workflow.name}}",
"uid": "{{workflow.uid}}"
}
]
},
"spec": {
"maxRetry": 1,
"minAvailable": 1,
"plugins": {
"env": [],
"ssh": [],
"svc": []
},
"policies": [
{
"action": "RestartJob",
"event": "PodEvicted"
}
],
"queue": "vc-queue",
"schedulerName": "volcano",
"tasks": [
{
"name": "task1",
"replicas": 1,
"template": {
"metadata": {
"name": "helloworld1"
},
"spec": {
"containers": [
{
"command": [
"echo",
"{{inputs.parameters.message}}"
],
"image": "alpine:3.7",
"imagePullPolicy": "IfNotPresent",
"name": "echo",
"resources": {
"requests": {
"cpu": "100m"
}
}
}
],
"restartPolicy": "Never"
}
}
}
]
}
}
}
}
},
{
"inputs": {
"parameters": [
{
"name": "message"
},
{
"name": "task"
}
]
},
"metadata": {},
"name": "hello-tmpl",
"outputs": {},
"plugin": {
"volcano": {
"job": {
"apiVersion": "batch.volcano.sh/v1alpha1",
"kind": "Job",
"metadata": {
"name": "{{workflow.name}}-main-task",
"namespace": "{{workflow.namespace}}",
"ownerReferences": [
{
"apiVersion": "argoproj.io/v1alpha1",
"blockOwnerDeletion": true,
"kind": "Workflow",
"name": "{{workflow.name}}",
"uid": "{{workflow.uid}}"
}
]
},
"spec": {
"maxRetry": 1,
"minAvailable": 1,
"plugins": {
"env": [],
"ssh": [],
"svc": []
},
"policies": [
{
"action": "RestartJob",
"event": "PodEvicted"
}
],
"queue": "vc-queue",
"schedulerName": "volcano",
"tasks": [
{
"name": "task999",
"replicas": 1,
"template": {
"metadata": {
"name": "helloworld1"
},
"spec": {
"containers": [
{
"args": [
"sleep 60"
],
"command": [
"/bin/sh",
"-c"
],
"image": "docker/whalesay",
"imagePullPolicy": "IfNotPresent",
"name": "hello111",
"resources": {
"requests": {
"cpu": "2",
"memory": "8Gi"
}
}
}
],
"restartPolicy": "Never"
}
}
},
{
"name": "task999999",
"replicas": 1,
"template": {
"metadata": {
"name": "helloworld222"
},
"spec": {
"containers": [
{
"args": [
"{{inputs.parameters.message}}"
],
"command": [
"cowsay"
],
"image": "docker/whalesay",
"imagePullPolicy": "IfNotPresent",
"name": "hello222",
"resources": {
"requests": {
"cpu": "100m"
}
}
}
],
"restartPolicy": "Never"
}
}
}
]
}
}
}
}
}
]
},
"status": {
"artifactGCStatus": {
"notSpecified": true
},
"artifactRepositoryRef": {
"artifactRepository": {
"archiveLogs": true,
"s3": {
"accessKeySecret": {
"key": "accesskey",
"name": "my-minio-cred"
},
"bucket": "my-bucket",
"endpoint": "minio:9000",
"insecure": true,
"secretKeySecret": {
"key": "secretkey",
"name": "my-minio-cred"
}
}
},
"configMap": "artifact-repositories",
"key": "default-v1",
"namespace": "argo"
},
"conditions": [
{
"status": "False",
"type": "PodRunning"
},
{
"status": "True",
"type": "Completed"
}
],
"finishedAt": "2024-08-20T02:49:01Z",
"nodes": {
"volcano-dag-job-m9w7l": {
"children": [
"volcano-dag-job-m9w7l-2186413323"
],
"displayName": "volcano-dag-job-m9w7l",
"finishedAt": "2024-08-20T02:49:01Z",
"id": "volcano-dag-job-m9w7l",
"name": "volcano-dag-job-m9w7l",
"outboundNodes": [
"volcano-dag-job-m9w7l-1934982862"
],
"phase": "Succeeded",
"progress": "3/3",
"startedAt": "2024-08-20T02:46:18Z",
"templateName": "volcano-dag-job",
"templateScope": "local/volcano-dag-job-m9w7l",
"type": "DAG"
},
"volcano-dag-job-m9w7l-1934982862": {
"boundaryID": "volcano-dag-job-m9w7l",
"displayName": "echo-end",
"finishedAt": "2024-08-20T02:49:01Z",
"id": "volcano-dag-job-m9w7l-1934982862",
"inputs": {
"parameters": [
{
"name": "message",
"value": "echo end"
}
]
},
"name": "volcano-dag-job-m9w7l.echo-end",
"phase": "Succeeded",
"progress": "1/1",
"startedAt": "2024-08-20T02:48:31Z",
"templateName": "end",
"templateScope": "local/volcano-dag-job-m9w7l",
"type": "Plugin"
},
"volcano-dag-job-m9w7l-2154563109": {
"boundaryID": "volcano-dag-job-m9w7l",
"children": [
"volcano-dag-job-m9w7l-1934982862"
],
"displayName": "wholesay",
"finishedAt": "2024-08-20T02:49:01Z",
"id": "volcano-dag-job-m9w7l-2154563109",
"inputs": {
"parameters": [
{
"name": "message",
"value": "hello2a"
},
{
"name": "task",
"value": "hello2a"
}
]
},
"name": "volcano-dag-job-m9w7l.wholesay",
"phase": "Succeeded",
"progress": "1/1",
"startedAt": "2024-08-20T02:46:58Z",
"templateName": "hello-tmpl",
"templateScope": "local/volcano-dag-job-m9w7l",
"type": "Plugin"
},
"volcano-dag-job-m9w7l-2186413323": {
"boundaryID": "volcano-dag-job-m9w7l",
"children": [
"volcano-dag-job-m9w7l-2154563109"
],
"displayName": "echo-start",
"finishedAt": "2024-08-20T02:49:01Z",
"id": "volcano-dag-job-m9w7l-2186413323",
"inputs": {
"parameters": [
{
"name": "message",
"value": "echo start"
}
]
},
"name": "volcano-dag-job-m9w7l.echo-start",
"phase": "Succeeded",
"progress": "1/1",
"startedAt": "2024-08-20T02:46:18Z",
"templateName": "start",
"templateScope": "local/volcano-dag-job-m9w7l",
"type": "Plugin"
}
},
"phase": "Succeeded",
"progress": "3/3",
"startedAt": "2024-08-20T02:46:18Z"
}
}
how to terminated workflow with plugin jobs? |
Beta Was this translation helpful? Give feedback.
Answered by
agilgur5
Aug 20, 2024
Replies: 1 comment
-
Not all actions are supported on plugins yet, see the feature request: #10476 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
agilgur5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not all actions are supported on plugins yet, see the feature request: #10476