@@ -60,6 +60,9 @@ message StatusEvent {
6060
6161 // Task Execution
6262 TaskExecution task_execution = 4 ;
63+
64+ // Task State
65+ TaskStatus.State task_state = 5 ;
6366}
6467
6568// This Task Execution field includes detail information for
@@ -98,6 +101,16 @@ message TaskStatus {
98101
99102 // Detailed info about why the state is reached.
100103 repeated StatusEvent status_events = 2 ;
104+
105+ // The resource usage of the task.
106+ TaskResourceUsage resource_usage = 3 ;
107+ }
108+
109+ // TaskResourceUsage describes the resource usage of the task.
110+ message TaskResourceUsage {
111+ // The CPU core hours the task consumes based on task requirement and run
112+ // time.
113+ double core_hours = 1 ;
101114}
102115
103116// Runnable describes instructions for executing a specific script or container
@@ -145,9 +158,23 @@ message Runnable {
145158 message Script {
146159 oneof command {
147160 // Script file path on the host VM.
161+ //
162+ // To specify an interpreter, please add a `#!<interpreter>`(also known as
163+ // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
164+ // first line of the file.(For example, to execute the script using bash,
165+ // `#!/bin/bash` should be the first line of the file. To execute the
166+ // script using`Python3`, `#!/usr/bin/env python3` should be the first
167+ // line of the file.) Otherwise, the file will by default be excuted by
168+ // `/bin/sh`.
148169 string path = 1 ;
149170
150171 // Shell script text.
172+ //
173+ // To specify an interpreter, please add a `#!<interpreter>\n` at the
174+ // beginning of the text.(For example, to execute the script using bash,
175+ // `#!/bin/bash\n` should be added. To execute the script using`Python3`,
176+ // `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
177+ // by default be excuted by `/bin/sh`.
151178 string text = 2 ;
152179 }
153180 }
@@ -228,13 +255,12 @@ message TaskSpec {
228255 int32 max_retry_count = 5 ;
229256
230257 // Lifecycle management schema when any task in a task group is failed.
231- // The valid size of lifecycle policies are [0, 10].
232- // For each lifecycle policy, when the condition is met,
233- // the action in that policy will execute.
234- // If there are multiple policies that the task execution result matches,
235- // we use the action from the first matched policy. If task execution result
236- // does not meet with any of the defined lifecycle policy, we consider it as
237- // the default policy. Default policy means if the exit code is 0, exit task.
258+ // Currently we only support one lifecycle policy.
259+ // When the lifecycle policy condition is met,
260+ // the action in the policy will execute.
261+ // If task execution result does not meet with the defined lifecycle
262+ // policy, we consider it as the default policy.
263+ // Default policy means if the exit code is 0, exit task.
238264 // If task ends with non-zero exit code, retry the task with max_retry_count.
239265 repeated LifecyclePolicy lifecycle_policies = 9 ;
240266
@@ -273,6 +299,10 @@ message LifecyclePolicy {
273299 }
274300
275301 // Action to execute when ActionCondition is true.
302+ // When RETRY_TASK is specified, we will retry failed tasks
303+ // if we notice any exit code match and fail tasks if no match is found.
304+ // Likewise, when FAIL_TASK is specified, we will fail tasks
305+ // if we notice any exit code match and retry tasks if no match is found.
276306 Action action = 1 ;
277307
278308 // Conditions that decide why a task failure is dealt with a specific action.
0 commit comments