Built on the open-source Argo Workflow project, workflow clusters support CI/CD pipelines, data processing, machine learning, and simulation workloads. This topic shows how to create and submit an Argo workflow with the Argo CLI or Argo UI.workflow cluster with the Argo CLI or Argo UI.
Prerequisites
An Argo workflow cluster is created.
Workflow ServiceAccount
A workflow can use a specified ServiceAccount to access other Kubernetes resources at runtime. The workflow cluster automatically binds the necessary permissions to any custom ServiceAccount you create.
Procedure
You can create a workflow with the Argo CLI or the Argo UI.
Argo CLI
Step 1: Install the Argo CLI
The Alibaba Cloud Argo CLI is fully compatible with the open-source version and adds metrics and logging capabilities, including CPU and memory consumption, execution cost, and logs from deleted Pods.
-
Download the Alibaba Cloud Argo CLI.
These steps are for Linux. For macOS, download the Argo CLI from https://ack-one.oss-cn-hangzhou.aliyuncs.com/cli/v3.4.12/argo-cli-aliyun-darwin.
wget https://ack-one.oss-cn-hangzhou.aliyuncs.com/cli/v3.4.12/argo-cli-aliyun-linux -
Make argo-cli-aliyun-linux executable.
chmod +x argo-cli-aliyun-linux -
Move the executable to a directory in your PATH, such as
/usr/local/bin/.mv argo-cli-aliyun-linux /usr/local/bin/argo
Step 2: Create a workflow
-
Create a file named helloworld-workflow.yaml with the following content.
apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: helloworld-- # Workflow name prefix spec: entrypoint: helloworld # Specifies the entrypoint workflow template templates: - name: helloworld container: image: mirrors-ssl.aliyuncs.com/busybox:latest command: - sh - -c args: - echo "Hello, world!"; sleep 60; -
Submit the workflow.
argo submit helloworld-workflow.yaml -
Check the workflow status.
-
List workflows.
argo listExpected output:
NAME STATUS AGE DURATION PRIORITY helloworld-lgdpp Succeeded 2m 37s 0 -
Get workflow details.
argo get helloworld-lgdppExpected output:
Name: hello-world-lgdpp Namespace: default ServiceAccount: unset (will run with the default ServiceAccount) Status: Succeeded Conditions: PodRunning False Completed True .... Duration: 1 minute 46 seconds Progress: 1/1 ResourcesDuration: 17s*(1 cpu),17s*(100Mi memory) STEP TEMPLATE PODNAME DURATION MESSAGE ✔ hello-world-lgdpp helloworld hello-world-lgdpp 1m
-
Argo UI
Log on to the Argo Workflow Clusters console and click the target cluster name.
-
On the Cluster information page, click the Basic information tab, and then click Workflow console (Argo) to open the Argo UI.
-
In the left-side navigation pane, click workflow template. Enter default in the namespace field to view the predefined templates.
The predefined templates are dag-diamond, loops, and steps.
-
Select a workflow template and click SUBMIT to run the workflow.