-
Notifications
You must be signed in to change notification settings - Fork 10
/
booster.go
146 lines (112 loc) · 3.06 KB
/
booster.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
/*
* Copyright (c) 2021 THL A29 Limited, a Tencent company. All rights reserved
*
* This source code file is licensed under the MIT License, you may obtain a copy of the License at
*
* http://opensource.org/licenses/MIT
*
*/
package types
import (
"io"
"time"
"github.com/TencentBlueKing/bk-turbo/src/backend/booster/bk_dist/common/sdk"
)
// BoosterConfig describe the whole data that distribute workers booster should hold.
type BoosterConfig struct {
// Task type decide what kind of this task is going to be launched.
// It matters the type of executor's handler.
Type BoosterType
// ProjectID define the project which influences the remote workers settings.
ProjectID string
// BuildID provides a custom key to be associated with the task.
BuildID string
// Use BatchMode for multi boosters use the same workID.
BatchMode bool
// Args describe the actual args to be executed after initialization.
Args string
Cmd string
Works BoosterWorks
Transport BoosterTransport
Controller sdk.ControllerConfig
}
// BoosterWorks describe the works data
type BoosterWorks struct {
Degraded bool
Stdout io.Writer
Stderr io.Writer
// RunDir describe the current command running dir.
RunDir string
// User describe the current user.
User string
CommandPath string
LimitPerWorker int
Jobs int
MaxJobs int
Presetjobs int
MaxDegradedJobs int
MaxLocalTotalJobs int
MaxLocalPreJobs int
MaxLocalExeJobs int
MaxLocalPostJobs int
SupportDirectives bool
GlobalSlots bool
ExecutorLogLevel string
Environments map[string]string
HookPreloadLibPath string
HookConfigPath string
HookMode bool
NoLocal bool
Local bool
WorkerSideCache bool
LocalRecord bool
Bazel bool
BazelPlus bool
Bazel4Plus bool
Launcher bool
BazelNoLauncher bool
Preload sdk.PreloadConfig
PreloadContent string
PreloadContentRaw string
AdditionFiles []string
WorkerList []string
CheckMd5 bool
OutputEnvJSONFile []string
OutputEnvSourceFile []string
CommitSuicide bool
ToolChainJSONFile string
IOTimeoutSecs int
Pump bool
PumpDisableMacro bool
PumpIncludeSysHeader bool
PumpCheck bool
PumpCache bool
PumpCacheDir string
PumpCacheSizeMaxMB int32
PumpCacheRemoveAll bool
PumpBlackList []string
PumpMinActionNum int32
PumpDisableStatCache bool
PumpSearchLink bool
PumpSearchLinkFile string
PumpSearchLinkDir []string
PumpLstatByDir bool
ForceLocalList []string
NoWork bool
WriteMemroy bool
IdleKeepSecs int
CleanTmpFilesDayAgo int
EnableLink bool
EnableLib bool
}
// BoosterTransport describe the transport data to controller
type BoosterTransport struct {
ServerDomain string
ServerHost string
Timeout time.Duration
HeartBeatTick time.Duration
InspectTaskTick time.Duration
TaskPreparingTimeout time.Duration
PrintTaskInfoEveryTime int
CommitSuicideCheckTick time.Duration
}