22using System ;
33using System . Collections . Generic ;
44using PoolName = System . String ;
5+ using Region = System . String ;
6+ using Container = System . String ;
57
68namespace Microsoft . OneFuzz . Service ;
79
@@ -29,9 +31,15 @@ public enum HeartbeatType
2931 TaskAlive ,
3032}
3133
32- public record HeartbeatData ( HeartbeatType type ) ;
34+ public record HeartbeatData ( HeartbeatType Type ) ;
3335
34- public record NodeHeartbeatEntry ( Guid NodeId , HeartbeatData [ ] data ) ;
36+ public record TaskHeartbeatEntry (
37+ Guid TaskId ,
38+ Guid ? JobId ,
39+ Guid MachineId ,
40+ HeartbeatData [ ] Data
41+ ) ;
42+ public record NodeHeartbeatEntry ( Guid NodeId , HeartbeatData [ ] Data ) ;
3543
3644public record NodeCommandStopIfFree ( ) ;
3745
@@ -79,7 +87,7 @@ public enum NodeState
7987
8088public record ProxyHeartbeat
8189(
82- string Region ,
90+ Region Region ,
8391 Guid ProxyId ,
8492 List < ProxyForward > Forwards ,
8593 DateTimeOffset TimeStamp
@@ -102,35 +110,35 @@ bool DebugKeepNode
102110
103111
104112public partial record ProxyForward
105- (
106- [ PartitionKey ] string Region ,
113+ (
114+ [ PartitionKey ] Region Region ,
107115 [ RowKey ] int DstPort ,
108- int SrcPort ,
116+ int SrcPort ,
109117 string DstIp
110118) : EntityBase ( ) ;
111119
112- public partial record ProxyConfig
113- (
114- Uri Url ,
115- string Notification ,
116- string Region ,
117- Guid ? ProxyId ,
118- List < ProxyForward > Forwards ,
119- string InstanceTelemetryKey ,
120+ public partial record ProxyConfig
121+ (
122+ Uri Url ,
123+ string Notification ,
124+ Region Region ,
125+ Guid ? ProxyId ,
126+ List < ProxyForward > Forwards ,
127+ string InstanceTelemetryKey ,
120128 string MicrosoftTelemetryKey
121129
122130) ;
123131
124132public partial record Proxy
125133(
126- [ PartitionKey ] string Region ,
134+ [ PartitionKey ] Region Region ,
127135 [ RowKey ] Guid ProxyId ,
128136 DateTimeOffset ? CreatedTimestamp ,
129- VmState State ,
130- Authentication Auth ,
131- string ? Ip ,
132- Error ? Error ,
133- string Version ,
137+ VmState State ,
138+ Authentication Auth ,
139+ string ? Ip ,
140+ Error ? Error ,
141+ string Version ,
134142 ProxyHeartbeat ? heartbeat
135143) : EntityBase ( ) ;
136144
@@ -148,23 +156,102 @@ String InstanceName
148156) : EntityBase ( ) ;
149157
150158
151- //record AnyHttpUrl(AnyUrl):
152- // allowed_schemes = {'http', 'https
153- //
154-
155-
159+ public record TaskDetails (
160+
161+ TaskType Type ,
162+ int Duration ,
163+ string ? TargetExe ,
164+ Dictionary < string , string > ? TargetEnv ,
165+ List < string > ? TargetOptions ,
166+ int ? TargetWorkers ,
167+ bool ? TargetOptionsMerge ,
168+ bool ? CheckAsanLog ,
169+ bool ? CheckDebugger ,
170+ int ? CheckRetryCount ,
171+ bool ? CheckFuzzerHelp ,
172+ bool ? ExpectCrashOnFailure ,
173+ bool ? RenameOutput ,
174+ string ? SupervisorExe ,
175+ Dictionary < string , string > ? SupervisorEnv ,
176+ List < string > ? SupervisorOptions ,
177+ string ? SupervisorInputMarker ,
178+ string ? GeneratorExe ,
179+ Dictionary < string , string > ? GeneratorEnv ,
180+ List < string > ? GeneratorOptions ,
181+ string ? AnalyzerExe ,
182+ Dictionary < string , string > ? AnalyzerEnv ,
183+ List < string > AnalyzerOptions ,
184+ ContainerType ? WaitForFiles ,
185+ string ? StatsFile ,
186+ StatsFormat ? StatsFormat ,
187+ bool ? RebootAfterSetup ,
188+ int ? TargetTimeout ,
189+ int ? EnsembleSyncDelay ,
190+ bool ? PreserveExistingOutputs ,
191+ List < string > ? ReportList ,
192+ int ? MinimizedStackDepth ,
193+ string ? CoverageFilter
194+ ) ;
156195
196+ public record TaskVm (
197+ Region Region ,
198+ string Sku ,
199+ string Image ,
200+ int Count ,
201+ bool SpotInstance ,
202+ bool ? RebootAfterSetup
203+ ) ;
157204
205+ public record TaskPool (
206+ int Count ,
207+ PoolName PoolName
208+ ) ;
158209
159- //public record TaskConfig(
160- // Guid jobId,
161- // List<Guid> PrereqTasks,
162- // TaskDetails Task,
163- // TaskVm? vm,
164- // TaskPool pool: Optional[]
165- // containers: List[TaskContainers]
166- // tags: Dict[str, str]
167- // debug: Optional[List[TaskDebugFlag]]
168- // colocate: Optional[bool]
169- // ): EntityBase();
210+ public record TaskContainers (
211+ ContainerType Type ,
212+ Container Name
213+ ) ;
214+ public record TaskConfig (
215+ Guid JobId ,
216+ List < Guid > ? PrereqTasks ,
217+ TaskDetails Task ,
218+ TaskVm ? Vm ,
219+ TaskPool ? Pool ,
220+ List < TaskContainers > ? Containers ,
221+ Dictionary < string , string > ? Tags ,
222+ List < TaskDebugFlag > ? Debug ,
223+ bool ? Colocate
224+ ) ;
225+
226+
227+ public record TaskEventSummary (
228+ DateTimeOffset ? Timestamp ,
229+ string EventData ,
230+ string EventType
231+ ) ;
232+
233+
234+ public record NodeAssignment (
235+ Guid NodeId ,
236+ Guid ? ScalesetId ,
237+ NodeTaskState State
238+ ) ;
239+
240+
241+ public record Task (
242+ // Timestamp: Optional[datetime] = Field(alias="Timestamp")
243+ [ PartitionKey ] Guid JobId ,
244+ [ RowKey ] Guid TaskId ,
245+ TaskState State ,
246+ Os Os ,
247+ TaskConfig Config ,
248+ Error ? Error ,
249+ Authentication ? Auth ,
250+ DateTimeOffset ? Heartbeat ,
251+ DateTimeOffset ? EndTime ,
252+ UserInfo ? UserInfo ) : EntityBase ( )
253+ {
254+ List < TaskEventSummary > Events { get ; set ; } = new List < TaskEventSummary > ( ) ;
255+ List < NodeAssignment > Nodes { get ; set ; } = new List < NodeAssignment > ( ) ;
170256
257+ }
0 commit comments