From 260c831df204fee7b1bc86423ce52241bcb64f01 Mon Sep 17 00:00:00 2001 From: zq200618 <101779235+zq200618@users.noreply.github.com> Date: Fri, 27 May 2022 11:25:38 +0800 Subject: [PATCH] Fix: step group documentation update and bug fix of firstExecuteTime not record (#3975) Signed-off-by: Qiang Zheng Fix: step group documentation update and bug fix of firstExecuteTime not record Signed-off-by: Qiang Zheng Co-authored-by: Qiang Zheng --- docs/examples/workflow/step-group/README.md | 23 +++++++++++++++++++ .../step-group/{app.yaml => example.yaml} | 13 +++++++++-- pkg/workflow/workflow.go | 3 ++- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 docs/examples/workflow/step-group/README.md rename docs/examples/workflow/step-group/{app.yaml => example.yaml} (54%) diff --git a/docs/examples/workflow/step-group/README.md b/docs/examples/workflow/step-group/README.md new file mode 100644 index 000000000..be3071d0d --- /dev/null +++ b/docs/examples/workflow/step-group/README.md @@ -0,0 +1,23 @@ +# Step Group + +## How to start + +Edit a yaml file as `example.yaml`, then execute it with `vela up` command. + +## Parameter Introduction + +`step-group` has a `subSteps` parameter which is an array containing any step type whose valid parameters do not include the `step-group` step type itself. + +`step-group` doesn't support `properties` for now. + +## Execute process + +When executing the `step-group` step, the subSteps in the step group are executed in dag mode. The step group will only complete when all subSteps have been executed to completion. +SubStep has the same execution behavior as a normal step. + + + + + + + diff --git a/docs/examples/workflow/step-group/app.yaml b/docs/examples/workflow/step-group/example.yaml similarity index 54% rename from docs/examples/workflow/step-group/app.yaml rename to docs/examples/workflow/step-group/example.yaml index 0e47d6f07..4a3bca3bd 100644 --- a/docs/examples/workflow/step-group/app.yaml +++ b/docs/examples/workflow/step-group/example.yaml @@ -1,7 +1,7 @@ apiVersion: core.oam.dev/v1beta1 kind: Application metadata: - name: step-group-example + name: example namespace: default spec: components: @@ -10,13 +10,22 @@ spec: properties: image: crccheck/hello-world port: 8000 + - name: express-server2 + type: webservice + properties: + image: crccheck/hello-world + port: 8000 workflow: steps: - name: step type: step-group subSteps: - - name: apply-server + - name: apply-sub-step1 type: apply-component properties: component: express-server + - name: apply-sub-step2 + type: apply-component + properties: + component: express-server2 diff --git a/pkg/workflow/workflow.go b/pkg/workflow/workflow.go index 8efb48329..574a4aae9 100644 --- a/pkg/workflow/workflow.go +++ b/pkg/workflow/workflow.go @@ -637,7 +637,8 @@ func (e *engine) updateStepStatus(status common.StepStatus) { if index < 0 { e.status.Steps = append(e.status.Steps, common.WorkflowStepStatus{ StepStatus: common.StepStatus{ - Name: parentRunner, + Name: parentRunner, + FirstExecuteTime: now, }}) index = len(e.status.Steps) - 1 }