Edit this page on our live server and create a PR by running command !create-pr in the console panel

Task tags

  • Difficulty level: easy
  • Time need to lean: 10 minutes or less
  • Key points:
    • Use task option tag to give additional information to tasks

Task tags

Every task is associated with one or more tags, which are simply strings assigned to the task. Tasks can be identified by their unique IDs, or by their tags with option --tags from commands such as sos status, sos kill, and sos purge.

By default, a task is tagged by step name and workflow ID. For example, three tasks are generated from the following workflow, all the tasks have a tag c43ef3b6fcb97752; the task from step 10 has a tag 10, and two tasks from step 20 have tag 20.

In [1]:
INFO: 8ae65992fde3b749 started
INFO: 285bba6cb33a5590 started
INFO: 671ff74845245f7c started

The tags can be used to identify a group of tasks. For example, the following magic (and equivalently command sos status --tags 20) displays all tasks from step 20.

In [2]:
285bba6cb33a5590	20 c43ef3b6fcb97752 user_guide	Signature checked	completed
671ff74845245f7c	20 c43ef3b6fcb97752 user_guide	Signature checked	completed

Option tags

Option tags adds additional tags to each task. A tag can contain alphabetic and numeric characters, dash (-), underscore (_), and dot (.). Tags of other types will be converted to string, and tags with other characters will still be accepted but with non-comforming characters removed.

For example, in the following workflow, by adding _input as a task tag, it becomes much easier to identify the input file that each task is handling.

In [3]:
INFO: 1dda9e28e78cc509 started
INFO: 48e93dd54880d65f started