YAML Syntax Description
Last updated
Last updated
Job is the basic unit of the Action workflow. A DAG is generated by defining multiple jobs and setting the dependencies of the jobs. The TensorBay workflow engine can automate tasks by executing DAGs. Set the following YAML file as an example.
[tasks]: Define all the jobs under this workflow.
[tasks.hello-world]: Defines a task, with the name "hello-world".
[tasks.hello-world.container]: This job is executed under the docker container.
[tasks.hello-world.container.image]: The image used by the docker container is alpine:latest.
[tasks.hello-world.container.command]: The command executed in the docker container is 991`called echo.
[tasks.hello-world.container.args]: The argument to echo is "hello world".
Job supports the following three runtime environments. Each job has only one runtime environment.
1. Container
In this environment you can use a specified image to generate a container and execute it.The job content will be defined by the image.
2. Script
In this environment, a specified script wil be excuted in the docker container.
3. Git
In this environment, a git repo code will be executed inside the docker container.
Dependencies
Jobs can define their dependencies by keywords.
Flowchart
A diamond-shaped DAG. Task A executes first, then task B and task C conduct simultaneously. Task D only starts to run when task B and task C are finished.
The name of a parameter, which is used to refer to the parameter in the code of a workflow.
The type of a parameter. The following three types of parameters are supported in Actions now.
String: string
Number: number, including integers and floating-point numbers
Boolean: boolean value, true/false
The default value of a parameter. If the default value is not specified at the beginning, the system will automatically use a preset default value.
Support to view and set the detailed parameters on the parameter details page.
Manual Parameters Setting: If a workflow is started manually, then its values can be set via the TensorBay console.
Automatic Parameters Setting: If a workflow is started automatically, then the system will use default values.
You can quote a parameter in workflow with its name.
The parameter to be quoted must be within {{}}.
The parameter name must start with workflow.parameters.
The parameter name must be the same as the preset one.
Environment defines the environment variables of the container, which can be quoted in the same way as the environment variables of the normal docker container.