-
Notifications
You must be signed in to change notification settings - Fork 184
/
task.pb.go
1786 lines (1596 loc) · 70.1 KB
/
task.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.12.2
// source: google/cloud/batch/v1alpha/task.proto
package batch
import (
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Task states.
type TaskStatus_State int32
const (
// unknown state
TaskStatus_STATE_UNSPECIFIED TaskStatus_State = 0
// The Task is created and waiting for resources.
TaskStatus_PENDING TaskStatus_State = 1
// The Task is assigned to at least one VM.
TaskStatus_ASSIGNED TaskStatus_State = 2
// The Task is running.
TaskStatus_RUNNING TaskStatus_State = 3
// The Task has failed.
TaskStatus_FAILED TaskStatus_State = 4
// The Task has succeeded.
TaskStatus_SUCCEEDED TaskStatus_State = 5
)
// Enum value maps for TaskStatus_State.
var (
TaskStatus_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "PENDING",
2: "ASSIGNED",
3: "RUNNING",
4: "FAILED",
5: "SUCCEEDED",
}
TaskStatus_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"PENDING": 1,
"ASSIGNED": 2,
"RUNNING": 3,
"FAILED": 4,
"SUCCEEDED": 5,
}
)
func (x TaskStatus_State) Enum() *TaskStatus_State {
p := new(TaskStatus_State)
*p = x
return p
}
func (x TaskStatus_State) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (TaskStatus_State) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_batch_v1alpha_task_proto_enumTypes[0].Descriptor()
}
func (TaskStatus_State) Type() protoreflect.EnumType {
return &file_google_cloud_batch_v1alpha_task_proto_enumTypes[0]
}
func (x TaskStatus_State) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use TaskStatus_State.Descriptor instead.
func (TaskStatus_State) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{3, 0}
}
// Action on task failures based on different conditions.
type LifecyclePolicy_Action int32
const (
// Action unspecified.
LifecyclePolicy_ACTION_UNSPECIFIED LifecyclePolicy_Action = 0
// Action that tasks in the group will be scheduled to re-execute.
LifecyclePolicy_RETRY_TASK LifecyclePolicy_Action = 1
// Action that tasks in the group will be stopped immediately.
LifecyclePolicy_FAIL_TASK LifecyclePolicy_Action = 2
)
// Enum value maps for LifecyclePolicy_Action.
var (
LifecyclePolicy_Action_name = map[int32]string{
0: "ACTION_UNSPECIFIED",
1: "RETRY_TASK",
2: "FAIL_TASK",
}
LifecyclePolicy_Action_value = map[string]int32{
"ACTION_UNSPECIFIED": 0,
"RETRY_TASK": 1,
"FAIL_TASK": 2,
}
)
func (x LifecyclePolicy_Action) Enum() *LifecyclePolicy_Action {
p := new(LifecyclePolicy_Action)
*p = x
return p
}
func (x LifecyclePolicy_Action) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (LifecyclePolicy_Action) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_batch_v1alpha_task_proto_enumTypes[1].Descriptor()
}
func (LifecyclePolicy_Action) Type() protoreflect.EnumType {
return &file_google_cloud_batch_v1alpha_task_proto_enumTypes[1]
}
func (x LifecyclePolicy_Action) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use LifecyclePolicy_Action.Descriptor instead.
func (LifecyclePolicy_Action) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{6, 0}
}
// Compute resource requirements
type ComputeResource struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The milliCPU count.
CpuMilli int64 `protobuf:"varint,1,opt,name=cpu_milli,json=cpuMilli,proto3" json:"cpu_milli,omitempty"`
// Memory in MiB.
MemoryMib int64 `protobuf:"varint,2,opt,name=memory_mib,json=memoryMib,proto3" json:"memory_mib,omitempty"`
// The GPU count.
//
// [NotImplemented]
GpuCount int64 `protobuf:"varint,3,opt,name=gpu_count,json=gpuCount,proto3" json:"gpu_count,omitempty"`
// Extra boot disk size in MiB for each task.
BootDiskMib int64 `protobuf:"varint,4,opt,name=boot_disk_mib,json=bootDiskMib,proto3" json:"boot_disk_mib,omitempty"`
}
func (x *ComputeResource) Reset() {
*x = ComputeResource{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ComputeResource) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ComputeResource) ProtoMessage() {}
func (x *ComputeResource) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ComputeResource.ProtoReflect.Descriptor instead.
func (*ComputeResource) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{0}
}
func (x *ComputeResource) GetCpuMilli() int64 {
if x != nil {
return x.CpuMilli
}
return 0
}
func (x *ComputeResource) GetMemoryMib() int64 {
if x != nil {
return x.MemoryMib
}
return 0
}
func (x *ComputeResource) GetGpuCount() int64 {
if x != nil {
return x.GpuCount
}
return 0
}
func (x *ComputeResource) GetBootDiskMib() int64 {
if x != nil {
return x.BootDiskMib
}
return 0
}
// Status event
type StatusEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Type of the event.
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
// Description of the event.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
// The time this event occurred.
EventTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"`
// Task Execution
TaskExecution *TaskExecution `protobuf:"bytes,4,opt,name=task_execution,json=taskExecution,proto3" json:"task_execution,omitempty"`
}
func (x *StatusEvent) Reset() {
*x = StatusEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatusEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusEvent) ProtoMessage() {}
func (x *StatusEvent) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusEvent.ProtoReflect.Descriptor instead.
func (*StatusEvent) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{1}
}
func (x *StatusEvent) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *StatusEvent) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *StatusEvent) GetEventTime() *timestamppb.Timestamp {
if x != nil {
return x.EventTime
}
return nil
}
func (x *StatusEvent) GetTaskExecution() *TaskExecution {
if x != nil {
return x.TaskExecution
}
return nil
}
// This Task Execution field includes detail information for
// task execution procedures, based on StatusEvent types.
type TaskExecution struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// When task is completed as the status of FAILED or SUCCEEDED,
// exit code is for one task execution result, default is 0 as success.
ExitCode int32 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
}
func (x *TaskExecution) Reset() {
*x = TaskExecution{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TaskExecution) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TaskExecution) ProtoMessage() {}
func (x *TaskExecution) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TaskExecution.ProtoReflect.Descriptor instead.
func (*TaskExecution) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{2}
}
func (x *TaskExecution) GetExitCode() int32 {
if x != nil {
return x.ExitCode
}
return 0
}
// Status of a task
type TaskStatus struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task state
State TaskStatus_State `protobuf:"varint,1,opt,name=state,proto3,enum=google.cloud.batch.v1alpha.TaskStatus_State" json:"state,omitempty"`
// Detailed info about why the state is reached.
StatusEvents []*StatusEvent `protobuf:"bytes,2,rep,name=status_events,json=statusEvents,proto3" json:"status_events,omitempty"`
}
func (x *TaskStatus) Reset() {
*x = TaskStatus{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TaskStatus) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TaskStatus) ProtoMessage() {}
func (x *TaskStatus) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead.
func (*TaskStatus) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{3}
}
func (x *TaskStatus) GetState() TaskStatus_State {
if x != nil {
return x.State
}
return TaskStatus_STATE_UNSPECIFIED
}
func (x *TaskStatus) GetStatusEvents() []*StatusEvent {
if x != nil {
return x.StatusEvents
}
return nil
}
// Runnable describes instructions for executing a specific script or container
// as part of a Task.
type Runnable struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The script or container to run.
//
// Types that are assignable to Executable:
// *Runnable_Container_
// *Runnable_Script_
// *Runnable_Barrier_
Executable isRunnable_Executable `protobuf_oneof:"executable"`
// Normally, a non-zero exit status causes the Task to fail. This flag allows
// execution of other Runnables to continue instead.
IgnoreExitStatus bool `protobuf:"varint,3,opt,name=ignore_exit_status,json=ignoreExitStatus,proto3" json:"ignore_exit_status,omitempty"`
// This flag allows a Runnable to continue running in the background while the
// Task executes subsequent Runnables. This is useful to provide services to
// other Runnables (or to provide debugging support tools like SSH servers).
Background bool `protobuf:"varint,4,opt,name=background,proto3" json:"background,omitempty"`
// By default, after a Runnable fails, no further Runnable are executed. This
// flag indicates that this Runnable must be run even if the Task has already
// failed. This is useful for Runnables that copy output files off of the VM
// or for debugging.
//
// The always_run flag does not override the Task's overall max_run_duration.
// If the max_run_duration has expired then no further Runnables will execute,
// not even always_run Runnables.
AlwaysRun bool `protobuf:"varint,5,opt,name=always_run,json=alwaysRun,proto3" json:"always_run,omitempty"`
// Environment variables for this Runnable (overrides variables set for the
// whole Task or TaskGroup).
Environment *Environment `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"`
// Timeout for this Runnable.
Timeout *durationpb.Duration `protobuf:"bytes,8,opt,name=timeout,proto3" json:"timeout,omitempty"`
// Labels for this Runnable.
Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *Runnable) Reset() {
*x = Runnable{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Runnable) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Runnable) ProtoMessage() {}
func (x *Runnable) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Runnable.ProtoReflect.Descriptor instead.
func (*Runnable) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{4}
}
func (m *Runnable) GetExecutable() isRunnable_Executable {
if m != nil {
return m.Executable
}
return nil
}
func (x *Runnable) GetContainer() *Runnable_Container {
if x, ok := x.GetExecutable().(*Runnable_Container_); ok {
return x.Container
}
return nil
}
func (x *Runnable) GetScript() *Runnable_Script {
if x, ok := x.GetExecutable().(*Runnable_Script_); ok {
return x.Script
}
return nil
}
func (x *Runnable) GetBarrier() *Runnable_Barrier {
if x, ok := x.GetExecutable().(*Runnable_Barrier_); ok {
return x.Barrier
}
return nil
}
func (x *Runnable) GetIgnoreExitStatus() bool {
if x != nil {
return x.IgnoreExitStatus
}
return false
}
func (x *Runnable) GetBackground() bool {
if x != nil {
return x.Background
}
return false
}
func (x *Runnable) GetAlwaysRun() bool {
if x != nil {
return x.AlwaysRun
}
return false
}
func (x *Runnable) GetEnvironment() *Environment {
if x != nil {
return x.Environment
}
return nil
}
func (x *Runnable) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
func (x *Runnable) GetLabels() map[string]string {
if x != nil {
return x.Labels
}
return nil
}
type isRunnable_Executable interface {
isRunnable_Executable()
}
type Runnable_Container_ struct {
// Container runnable.
Container *Runnable_Container `protobuf:"bytes,1,opt,name=container,proto3,oneof"`
}
type Runnable_Script_ struct {
// Script runnable.
Script *Runnable_Script `protobuf:"bytes,2,opt,name=script,proto3,oneof"`
}
type Runnable_Barrier_ struct {
// Barrier runnable.
Barrier *Runnable_Barrier `protobuf:"bytes,6,opt,name=barrier,proto3,oneof"`
}
func (*Runnable_Container_) isRunnable_Executable() {}
func (*Runnable_Script_) isRunnable_Executable() {}
func (*Runnable_Barrier_) isRunnable_Executable() {}
// Spec of a task
type TaskSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The sequence of scripts or containers to run for this Task. Each Task using
// this TaskSpec executes its list of runnables in order. The Task succeeds if
// all of its runnables either exit with a zero status or any that exit with a
// non-zero status have the ignore_exit_status flag.
//
// Background runnables are killed automatically (if they have not already
// exited) a short time after all foreground runnables have completed. Even
// though this is likely to result in a non-zero exit status for the
// background runnable, these automatic kills are not treated as Task
// failures.
Runnables []*Runnable `protobuf:"bytes,8,rep,name=runnables,proto3" json:"runnables,omitempty"`
// ComputeResource requirements.
ComputeResource *ComputeResource `protobuf:"bytes,3,opt,name=compute_resource,json=computeResource,proto3" json:"compute_resource,omitempty"`
// Maximum duration the task should run.
// The task will be killed and marked as FAILED if over this limit.
MaxRunDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=max_run_duration,json=maxRunDuration,proto3" json:"max_run_duration,omitempty"`
// Maximum number of retries on failures.
// The default, 0, which means never retry.
// The valid value range is [0, 10].
MaxRetryCount int32 `protobuf:"varint,5,opt,name=max_retry_count,json=maxRetryCount,proto3" json:"max_retry_count,omitempty"`
// Lifecycle management schema when any task in a task group is failed.
// The valid size of lifecycle policies are [0, 10].
// For each lifecycle policy, when the condition is met,
// the action in that policy will be executed.
// If there are multiple policies that the task execution result matches,
// we use the action from the first matched policy. If task execution result
// does not meet with any of the defined lifecycle policy, we consider it as
// the default policy. Default policy means if the exit code is 0, exit task.
// If task ends with non-zero exit code, retry the task with max_retry_count.
LifecyclePolicies []*LifecyclePolicy `protobuf:"bytes,9,rep,name=lifecycle_policies,json=lifecyclePolicies,proto3" json:"lifecycle_policies,omitempty"`
// Environment variables to set before running the Task.
// You can set up to 100 environments.
Environments map[string]string `protobuf:"bytes,6,rep,name=environments,proto3" json:"environments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Volumes to mount before running Tasks using this TaskSpec.
Volumes []*Volume `protobuf:"bytes,7,rep,name=volumes,proto3" json:"volumes,omitempty"`
// Environment variables to set before running the Task.
Environment *Environment `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"`
}
func (x *TaskSpec) Reset() {
*x = TaskSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TaskSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TaskSpec) ProtoMessage() {}
func (x *TaskSpec) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TaskSpec.ProtoReflect.Descriptor instead.
func (*TaskSpec) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{5}
}
func (x *TaskSpec) GetRunnables() []*Runnable {
if x != nil {
return x.Runnables
}
return nil
}
func (x *TaskSpec) GetComputeResource() *ComputeResource {
if x != nil {
return x.ComputeResource
}
return nil
}
func (x *TaskSpec) GetMaxRunDuration() *durationpb.Duration {
if x != nil {
return x.MaxRunDuration
}
return nil
}
func (x *TaskSpec) GetMaxRetryCount() int32 {
if x != nil {
return x.MaxRetryCount
}
return 0
}
func (x *TaskSpec) GetLifecyclePolicies() []*LifecyclePolicy {
if x != nil {
return x.LifecyclePolicies
}
return nil
}
func (x *TaskSpec) GetEnvironments() map[string]string {
if x != nil {
return x.Environments
}
return nil
}
func (x *TaskSpec) GetVolumes() []*Volume {
if x != nil {
return x.Volumes
}
return nil
}
func (x *TaskSpec) GetEnvironment() *Environment {
if x != nil {
return x.Environment
}
return nil
}
// LifecyclePolicy describes how to deal with task failures
// based on different conditions.
type LifecyclePolicy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Action to execute when ActionCondition is true.
Action LifecyclePolicy_Action `protobuf:"varint,1,opt,name=action,proto3,enum=google.cloud.batch.v1alpha.LifecyclePolicy_Action" json:"action,omitempty"`
// Conditions that decide why a task failure is dealt with a specific action.
ActionCondition *LifecyclePolicy_ActionCondition `protobuf:"bytes,2,opt,name=action_condition,json=actionCondition,proto3" json:"action_condition,omitempty"`
}
func (x *LifecyclePolicy) Reset() {
*x = LifecyclePolicy{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LifecyclePolicy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LifecyclePolicy) ProtoMessage() {}
func (x *LifecyclePolicy) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LifecyclePolicy.ProtoReflect.Descriptor instead.
func (*LifecyclePolicy) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{6}
}
func (x *LifecyclePolicy) GetAction() LifecyclePolicy_Action {
if x != nil {
return x.Action
}
return LifecyclePolicy_ACTION_UNSPECIFIED
}
func (x *LifecyclePolicy) GetActionCondition() *LifecyclePolicy_ActionCondition {
if x != nil {
return x.ActionCondition
}
return nil
}
// A Cloud Batch task.
type Task struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task name.
// The name is generated from the parent TaskGroup name and 'id' field.
// For example:
// "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01".
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Task Status.
Status *TaskStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
}
func (x *Task) Reset() {
*x = Task{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Task) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Task) ProtoMessage() {}
func (x *Task) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
func (*Task) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{7}
}
func (x *Task) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Task) GetStatus() *TaskStatus {
if x != nil {
return x.Status
}
return nil
}
// An Environment describes a collection of environment variables to set when
// executing Tasks.
type Environment struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A map of environment variable names to values.
Variables map[string]string `protobuf:"bytes,1,rep,name=variables,proto3" json:"variables,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// A map of environment variable names to Secret Manager secret names.
// The VM will access the named secrets to set the value of each environment
// variable.
SecretVariables map[string]string `protobuf:"bytes,2,rep,name=secret_variables,json=secretVariables,proto3" json:"secret_variables,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// An encrypted JSON dictionary where the key/value pairs correspond to
// environment variable names and their values.
EncryptedVariables *Environment_KMSEnvMap `protobuf:"bytes,3,opt,name=encrypted_variables,json=encryptedVariables,proto3" json:"encrypted_variables,omitempty"`
}
func (x *Environment) Reset() {
*x = Environment{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Environment) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Environment) ProtoMessage() {}
func (x *Environment) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Environment.ProtoReflect.Descriptor instead.
func (*Environment) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{8}
}
func (x *Environment) GetVariables() map[string]string {
if x != nil {
return x.Variables
}
return nil
}
func (x *Environment) GetSecretVariables() map[string]string {
if x != nil {
return x.SecretVariables
}
return nil
}
func (x *Environment) GetEncryptedVariables() *Environment_KMSEnvMap {
if x != nil {
return x.EncryptedVariables
}
return nil
}
// Container runnable.
type Runnable_Container struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The URI to pull the container image from.
ImageUri string `protobuf:"bytes,1,opt,name=image_uri,json=imageUri,proto3" json:"image_uri,omitempty"`
// Overrides the `CMD` specified in the container. If there is an ENTRYPOINT
// (either in the container image or with the entrypoint field below) then
// commands are appended as arguments to the ENTRYPOINT.
Commands []string `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"`
// Overrides the `ENTRYPOINT` specified in the container.
Entrypoint string `protobuf:"bytes,3,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
// Volumes to mount (bind mount) from the host machine files or directories
// into the container, formatted to match docker run's --volume option,
// e.g. /foo:/bar, or /foo:/bar:ro
Volumes []string `protobuf:"bytes,7,rep,name=volumes,proto3" json:"volumes,omitempty"`
// Arbitrary additional options to include in the "docker run" command when
// running this container, e.g. "--network host".
Options string `protobuf:"bytes,8,opt,name=options,proto3" json:"options,omitempty"`
// If set to true, external network access to and from container will be
// blocked. The container will use the default internal network
// 'goog-internal'.
BlockExternalNetwork bool `protobuf:"varint,9,opt,name=block_external_network,json=blockExternalNetwork,proto3" json:"block_external_network,omitempty"`
// Optional username for logging in to a docker registry. If username
// matches "projects/*/secrets/*/versions/*" then Batch will read the
// username from the Secret Manager.
Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"`
// Optional password for logging in to a docker registry. If password
// matches "projects/*/secrets/*/versions/*" then Batch will read the
// password from the Secret Manager;
Password string `protobuf:"bytes,11,opt,name=password,proto3" json:"password,omitempty"`
}
func (x *Runnable_Container) Reset() {
*x = Runnable_Container{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Runnable_Container) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Runnable_Container) ProtoMessage() {}
func (x *Runnable_Container) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_batch_v1alpha_task_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Runnable_Container.ProtoReflect.Descriptor instead.
func (*Runnable_Container) Descriptor() ([]byte, []int) {
return file_google_cloud_batch_v1alpha_task_proto_rawDescGZIP(), []int{4, 0}
}
func (x *Runnable_Container) GetImageUri() string {
if x != nil {
return x.ImageUri
}
return ""
}
func (x *Runnable_Container) GetCommands() []string {
if x != nil {
return x.Commands
}
return nil
}
func (x *Runnable_Container) GetEntrypoint() string {
if x != nil {
return x.Entrypoint
}
return ""
}
func (x *Runnable_Container) GetVolumes() []string {