Skip to content

Commit bfb44a2

Browse files
Allow multiple subtask instantiations (#24)
1 parent e8ef957 commit bfb44a2

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

apis/workflows/v1/core.proto

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,18 @@ message Tasks {
182182

183183
// TaskSubmission is a message of a task that is just about to be submitted, either by submitting a job or as a subtask.
184184
message TaskSubmission {
185+
option (buf.validate.message).oneof = {
186+
fields: [
187+
"input",
188+
"inputs"
189+
]
190+
required: true
191+
};
192+
185193
// The cluster that this task should be run on
186194
string cluster_slug = 1;
187195
// The task identifier
188196
TaskIdentifier identifier = 2;
189-
// The serialized task instance
190-
bytes input = 3 [(buf.validate.field).bytes.max_len = 1024];
191197
// A human-readable description of the task
192198
string display = 4 [(buf.validate.field).string.min_len = 1];
193199
// A list of indices, corresponding to tasks in the list of sub_tasks that this SubTask is part of.
@@ -197,6 +203,18 @@ message TaskSubmission {
197203
}];
198204
// The maximum number of retries for this task.
199205
int64 max_retries = 6 [(buf.validate.field).int64.gte = 0];
206+
207+
// The serialized task instance, if there is only a single instance.
208+
bytes input = 3 [(buf.validate.field).bytes.max_len = 2048];
209+
210+
// A list of serialized task instances, all sharing the same task properties. This is useful for cases where we have
211+
// a larger number of very similar subtasks, but only the input parameters vary.
212+
repeated bytes inputs = 7 [(buf.validate.field).repeated = {
213+
items: {
214+
bytes: {max_len: 2048}
215+
}
216+
max_items: 100000 // maximum of 100k subtasks in a single subtask tree
217+
}];
200218
}
201219

202220
// A lease for a task.

0 commit comments

Comments
 (0)