-
Notifications
You must be signed in to change notification settings - Fork 61
Change task schema doc to reflect the new implementation #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/rackhd/tasks.rst
Outdated
| - A Task Definition conforms to only one Task Schema, but different Task Definition can conform to the same Task Schema; For example, all obm-control tasks share the same obm-control schema. | ||
| - A Task Schema only describes one Job, but a Job may be described by multiple Task Schemas. For example, all of install-centos, install-ubuntu, install-esxi schemas are to describe the same install-os job. | ||
| - A Task Schema can include other schemas for the sake of schema reuse and minimizing duplication. For example, all task schemas include a common options schema. | ||
| There are totally 3 kinds of options schema: Common options schema, BaseTask options schema and Task options schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalizing for Common, BaseTask, Task is not consistent in the document, as Line 166 is using lowercase.
docs/rackhd/tasks.rst
Outdated
| There are totally 3 kinds of options schema: Common options schema, BaseTask options schema and Task options schema. | ||
|
|
||
| Below is a diagram shows the relation: | ||
| - The common options schema is to describe all those common options that shared by all tasks, such as `_taskTimeout`, the common options schema is defined in the file 'https://github.com/RackHD/on-tasks/blob/master/lib/task-data/schemas/common-task-options.json'. User doesn't have to explicitly define the common schema in Task or BaseTask definition, it is defaultly enabled for every task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that are shared by
defaultly => default
|
|
||
| You can follow below 3 steps to define a Task Schema: | ||
| - The schema in Task definition is to describe the options of corresponding task. Since a task defintion will always link to a BaseTask, so the task's schema will automatically inherit the BaseTask's schema during validation. So in practice, usually the task schema only need to describe those options that not included in BaseTask. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need => needs or to remove to
that not included => that are not included or remove that.
docs/rackhd/tasks.rst
Outdated
| - The schema in Task definition is to describe the options of corresponding task. Since a task defintion will always link to a BaseTask, so the task's schema will automatically inherit the BaseTask's schema during validation. So in practice, usually the task schema only need to describe those options that not included in BaseTask. | ||
|
|
||
| - Step 1: Create a JSON File | ||
| NOTE: The options schema is always optional for Task/BaseTask definition. If missing options schema, that means user gives up the upfront options validation before running a TaskGraph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If missing options schema => If options schema is missing
docs/rackhd/tasks.rst
Outdated
| - Schema File Reference <String>: Specify the file name of a JSON file, the JSON file is a valid JSON schema and it must be placed in the folder 'https://github.com/RackHD/on-tasks/tree/master/lib/task-data/schemas'. | ||
|
|
||
| - Step 3: Define Options | ||
| The Built-in Schema is usually used when there is few options or for those situation that is not suitable to use file reference, such as within skupack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those => the, or just remove those
docs/rackhd/tasks.rst
Outdated
| **Upfront Schema Validation** | ||
|
|
||
| The Task Schema validation will be firstly executed when user triggers a workflow. Only if all options (Combine user input and the default value) conform to schema for every task, the workflow then can be successfully triggered. | ||
| The options schema validation will be firstly executed when user triggers a workflow. Only if all options (Combine user input and the default value) conform to all kinds of above schemas for the task, the workflow then can be successfully triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all kinds of => all of, then can => can then
8acacca to
0c15092
Compare
|
Thanks @pengz1 , all your comment has been addressed. |
…schema Add redfish-obm-service schema and fix node view
I had refactored the task schema design (see RackHD/on-tasks#360), but I forgot to update the doc
@anhou @manfrednde @brianparry @iceiilin @pengz1 @lanchongyizu