Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: scheduler/appengine/messages/cron.proto

Issue 2986033003: [scheduler]: ACLs phase 1 - per Job ACL specification and enforcement. (Closed)
Patch Set: [WIP] ACLs into engine public API. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 syntax = "proto3"; 5 syntax = "proto3";
6 6
7 package messages; 7 package messages;
8 8
9 // A single access control rule.
10 message Acl {
11 enum Role {
12 // Can do read-only operations, such as listing invocations of a Job.
13 READER = 0;
14 // Same as READER + can modify state of a Job or Invocation such as
15 // triggering or aborting them.
16 // LUCI scheduler (this service) is an OWNER of each `Job` and `Trigger`, th us
17 // `Trigger`s are allowed to trigger all `Job`s defined in the s ame
18 // project, regardless of their respective ACLs.
19 OWNER = 1;
20 }
21 // Role denotes a list of actions that an identity can perform.
22 Role role = 1;
23 // Either email or "group:xyz" or auth service identity string "kind:name".
24 string granted_to = 2;
25 }
26
27 // A set of Acl messages. Can be referenced in a Job or Trigger by name.
28 message AclSet {
29 // A name of the ACL set, unique for a project.
30 // Required. Must match regex '^[0-9A-Za-z_\-\.]{1,100}$'.
31 string name = 1;
32 // List of access control rules.
33 // The order does not matter.
34 repeated Acl acls = 2;
35 }
9 36
10 // Job specifies a single regular job belonging to a project. 37 // Job specifies a single regular job belonging to a project.
11 // 38 //
12 // Such jobs runs on a schedule or can be triggered by some trigger. 39 // Such jobs runs on a schedule or can be triggered by some trigger.
13 message Job { 40 message Job {
14 // Id is a name of the job (unique for the project). 41 // Id is a name of the job (unique for the project).
15 // 42 //
16 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'. 43 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'.
17 string id = 1; 44 string id = 1;
18 45
19 // Schedule describes when to run the job. 46 // Schedule describes when to run the job.
20 // 47 //
21 // Supported kinds of schedules (illustrated by examples): 48 // Supported kinds of schedules (illustrated by examples):
22 // - "* 0 * * * *": standard cron-like expression. Cron engine will attempt 49 // - "* 0 * * * *": standard cron-like expression. Cron engine will attempt
23 // to start a job at specified moments in time (based on UTC clock). If 50 // to start a job at specified moments in time (based on UTC clock). If
24 // when triggering a job, previous invocation is still running, an overrun 51 // when triggering a job, previous invocation is still running, an overrun
25 // will be recorded (and next attempt to start a job happens based on the 52 // will be recorded (and next attempt to start a job happens based on the
26 // schedule, not when the previous invocation finishes). This is absolute 53 // schedule, not when the previous invocation finishes). This is absolute
27 // schedule (i.e. doesn't depend on job state). 54 // schedule (i.e. doesn't depend on job state).
28 // - "with 10s interval": runs invocations in a loop, waiting 10s after 55 // - "with 10s interval": runs invocations in a loop, waiting 10s after
29 // finishing invocation before starting a new one. This is relative 56 // finishing invocation before starting a new one. This is relative
30 // schedule. Overruns are not possible. 57 // schedule. Overruns are not possible.
31 // - "continuously" is alias for "with 0s interval", meaning the job will 58 // - "continuously" is alias for "with 0s interval", meaning the job will
32 // run in a loop without any pauses. 59 // run in a loop without any pauses.
33 // - "triggered" schedule indicates that job is always started via "Run now" 60 // - "triggered" schedule indicates that job is only started via "Run now"
34 // button or via a trigger. 61 // button or via a trigger.
35 // 62 //
36 // Default is "triggered". 63 // Default is "triggered".
37 string schedule = 2; 64 string schedule = 2;
38 65
39 // Disabled is true to disable this job. 66 // Disabled is true to disable this job.
40 bool disabled = 3; 67 bool disabled = 3;
41 68
42 // Task defines what exactly to execute. 69 // Task defines what exactly to execute.
43 // 70 //
44 // TODO(vadimsh): Remove this field once all configs are updated not to 71 // TODO(vadimsh): Remove this field once all configs are updated not to
45 // use it. 72 // use it.
46 TaskDefWrapper task = 4; 73 TaskDefWrapper task = 4;
47 74
75 // List of access control rules for the Job.
76 // The order does not matter.
77 // There can be at most 32 different acls for a Job, including those fro m
78 // acl_sets.
79 repeated Acl acls = 5;
80 // A list of ACL set names. Each ACL in each referenced ACL set will be
81 // included in this Job.
82 // The order does not matter.
83 repeated string acl_sets = 6;
84
48 // One and only one field below must be set. It defines what this job does. 85 // One and only one field below must be set. It defines what this job does.
49 86
50 // Noop is used for testing. It is "do nothing" task. 87 // Noop is used for testing. It is "do nothing" task.
51 NoopTask noop = 100; 88 NoopTask noop = 100;
52 // UrlFetch can be used to make a simple HTTP call. 89 // UrlFetch can be used to make a simple HTTP call.
53 UrlFetchTask url_fetch = 101; 90 UrlFetchTask url_fetch = 101;
54 // SwarmingTask can be used to schedule swarming job. 91 // SwarmingTask can be used to schedule swarming job.
55 SwarmingTask swarming = 102; 92 SwarmingTask swarming = 102;
56 // BuildbucketTask can be used to schedule buildbucket job. 93 // BuildbucketTask can be used to schedule buildbucket job.
57 BuildbucketTask buildbucket = 103; 94 BuildbucketTask buildbucket = 103;
(...skipping 11 matching lines...) Expand all
69 string id = 1; 106 string id = 1;
70 107
71 // Schedule describes when to run this triggering job. 108 // Schedule describes when to run this triggering job.
72 // 109 //
73 // See Job.schedule fro more info. Default is "with 30s interval". 110 // See Job.schedule fro more info. Default is "with 30s interval".
74 string schedule = 2; 111 string schedule = 2;
75 112
76 // Disabled is true to disable this job. 113 // Disabled is true to disable this job.
77 bool disabled = 3; 114 bool disabled = 3;
78 115
116 // List of access control rules for the Job.
117 // The order does not matter.
118 // There can be at most 32 different acls for a Job, including those fro m
119 // acl_sets.
120 repeated Acl acls = 4;
121 // A list of ACL set names. Each ACL in each referenced ACL set will be
122 // included in this Job.
123 // The order does not matter.
124 repeated string acl_sets = 5;
125
79 // One and only one field below must be set. It defines what this job does. 126 // One and only one field below must be set. It defines what this job does.
80 127
81 // Noop is used for testing. It is "do nothing" trigger. 128 // Noop is used for testing. It is "do nothing" trigger.
82 NoopTask noop = 100; 129 NoopTask noop = 100;
83 // Gitiles is used to trigger jobs for new commits on Gitiles. 130 // Gitiles is used to trigger jobs for new commits on Gitiles.
84 GitilesTask gitiles = 101; 131 GitilesTask gitiles = 101;
85 } 132 }
86 133
87 134
88 // NoopTask is used for testing. It is "do nothing" task. 135 // NoopTask is used for testing. It is "do nothing" task.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 211
165 212
166 // ProjectConfig defines a schema for config file that describe jobs belonging 213 // ProjectConfig defines a schema for config file that describe jobs belonging
167 // to some project. 214 // to some project.
168 message ProjectConfig { 215 message ProjectConfig {
169 // Job is a set of jobs defined in the project. 216 // Job is a set of jobs defined in the project.
170 repeated Job job = 1; 217 repeated Job job = 1;
171 218
172 // Trigger is a set of triggering jobs defined in the project. 219 // Trigger is a set of triggering jobs defined in the project.
173 repeated Trigger trigger = 2; 220 repeated Trigger trigger = 2;
221
222 // A list of ACL sets. Names must be unique.
223 repeated AclSet acl_sets = 3;
174 } 224 }
175 225
176 //////////////////////////////////////////////////////////////////////////////// 226 ////////////////////////////////////////////////////////////////////////////////
177 // Internal stuff. 227 // Internal stuff.
178 228
179 // TaskDefWrapper is a union type of all possible tasks known to the scheduler. 229 // TaskDefWrapper is a union type of all possible tasks known to the scheduler.
180 // 230 //
181 // It is used internally when storing jobs in the datastore. 231 // It is used internally when storing jobs in the datastore.
182 // 232 //
183 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer 233 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer
184 // a part of 'Job' proto. 234 // a part of 'Job' proto.
185 message TaskDefWrapper { 235 message TaskDefWrapper {
186 NoopTask noop = 1; 236 NoopTask noop = 1;
187 UrlFetchTask url_fetch = 2; 237 UrlFetchTask url_fetch = 2;
188 SwarmingTask swarming_task = 3; 238 SwarmingTask swarming_task = 3;
189 BuildbucketTask buildbucket_task = 4; 239 BuildbucketTask buildbucket_task = 4;
190 GitilesTask gitiles_task = 5; 240 GitilesTask gitiles_task = 5;
191 } 241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698