github.com/GoogleContainerTools/skaffold@v1.39.18/proto/v1/skaffold.proto (about) 1 syntax = "proto3"; 2 package proto; 3 option go_package = "github.com/GoogleContainerTools/skaffold/proto"; 4 5 import "google/api/annotations.proto"; 6 import "google/protobuf/timestamp.proto"; 7 import "google/protobuf/empty.proto"; 8 9 import public "enums/enums.proto"; 10 11 message StateResponse { 12 State state = 1; 13 } 14 15 message Response { 16 string msg = 1; 17 } 18 19 message Request { 20 string name = 1; 21 } 22 23 // `State` represents the current state of the Skaffold components 24 message State { 25 BuildState buildState = 1; 26 DeployState deployState = 2; 27 reserved 3; // field 3 is obsolete 28 map<int32, PortEvent> forwardedPorts = 4; 29 StatusCheckState statusCheckState = 5; 30 FileSyncState fileSyncState = 6; 31 repeated DebuggingContainerEvent debuggingContainers = 7; 32 Metadata metadata = 8; 33 TestState testState = 9; 34 } 35 36 message Metadata { 37 BuildMetadata build = 1; 38 DeployMetadata deploy = 2; 39 TestMetadata test = 3; 40 // Additional key value pairs to describe the build pipeline 41 map<string, string> additional = 99; 42 } 43 44 message BuildMetadata { 45 message ImageBuilder { 46 enums.BuilderType type = 1; 47 int32 count = 2; 48 } 49 int32 numberOfArtifacts = 1; 50 repeated ImageBuilder builders= 2; 51 enums.BuildType type = 3; 52 // Additional key value pairs to describe the deploy pipeline 53 map<string, string> additional = 99; 54 } 55 56 // TestMetadata describes the test pipeline 57 message TestMetadata { 58 message Tester { 59 enums.TesterType type = 1; 60 int32 count = 2; 61 } 62 repeated Tester Testers = 1; 63 } 64 65 message DeployMetadata { 66 message Deployer { 67 enums.DeployerType type = 1; 68 int32 count = 2; 69 } 70 repeated Deployer deployers = 1; 71 enums.ClusterType cluster = 2; 72 } 73 74 // `BuildState` maps Skaffold artifacts to their current build states 75 message BuildState { 76 // A map of `artifact name -> build-state`. 77 // Artifact name is defined in the `skaffold.yaml`. 78 // The `build-state` can be: <br> 79 // - `"Not started"`: not yet started <br> 80 // - `"In progress"`: build started <br> 81 // - `"Complete"`: build succeeded <br> 82 // - `"Failed"`: build failed 83 map<string, string> artifacts = 1; 84 bool autoTrigger = 2; 85 enums.StatusCode statusCode = 3; 86 } 87 88 // `TestState` describes the current state of the test 89 message TestState { 90 // Status of the current test 91 string status = 1; 92 // Teststate status code 93 enums.StatusCode statusCode = 2; 94 } 95 96 // `DeployState` describes the status of the current deploy 97 message DeployState { 98 string status = 1; 99 bool autoTrigger = 2; 100 enums.StatusCode statusCode = 3; 101 } 102 103 // `StatusCheckState` describes the state of status check of current deployed resources. 104 message StatusCheckState { 105 string status = 1; 106 // A map of `resource name -> status-check-state`. Where `resource-name` is the kubernetes resource name. 107 // The `status-check-state` can be <br> 108 // - `"Not started"`: indicates that `status-check` has just started. <br> 109 // - `"In progress"`: InProgress is sent after every resource check is complete. <br> 110 // - `"Succeeded"`: 111 // - `"Failed"`: 112 map<string, string> resources = 2; 113 // StatusCheck statusCode 114 enums.StatusCode statusCode = 3; 115 116 } 117 118 // `FileSyncState` contains the status of the current file sync 119 message FileSyncState { 120 string status = 1; 121 bool autoTrigger = 2; 122 } 123 124 // `Event` describes an event in the Skaffold process. 125 // It is one of MetaEvent, BuildEvent, TestEvent, DeployEvent, PortEvent, StatusCheckEvent, ResourceStatusCheckEvent, FileSyncEvent, or DebuggingContainerEvent. 126 message Event { 127 oneof event_type { 128 MetaEvent metaEvent = 1; // contains general information regarding Skaffold like version info 129 BuildEvent buildEvent = 2; // describes if the build status per artifact. Status could be one of "InProgress", "Completed" or "Failed". 130 DeployEvent deployEvent = 3; // describes if the deployment has started, is in progress or is complete. 131 PortEvent portEvent = 4; // describes each port forwarding event. 132 StatusCheckEvent statusCheckEvent = 5; // describes if the Status check has started, is in progress, has succeeded or failed. 133 ResourceStatusCheckEvent resourceStatusCheckEvent = 6; // indicates progress for each kubernetes deployment. 134 FileSyncEvent fileSyncEvent = 7; // describes the sync status. 135 DebuggingContainerEvent debuggingContainerEvent = 8; // describes the appearance or disappearance of a debugging container 136 DevLoopEvent devLoopEvent = 9; // describes a start and end of a dev loop. 137 TerminationEvent terminationEvent = 10; // describes a skaffold termination event 138 TestEvent TestEvent = 11; // describes if the test has started, is in progress or is complete. 139 } 140 } 141 142 // `TerminationEvent` marks the end of the skaffold session 143 message TerminationEvent { 144 string status = 1; // status oneof: Completed or Failed 145 ActionableErr err = 2; // actionable error message 146 } 147 148 // `DevLoopEvent` marks the start and end of a dev loop. 149 message DevLoopEvent { 150 int32 iteration = 1; // dev loop iteration. 0 represents initialization loop. 151 string status = 2; // dev loop status oneof: In Progress, Completed, Failed 152 ActionableErr err = 3; // actionable error message 153 } 154 155 // `ActionableErr` defines an error that occurred along with an optional list of suggestions 156 message ActionableErr { 157 enums.StatusCode errCode = 1; // error code representing the error 158 string message = 2; // message describing the error. 159 repeated Suggestion suggestions = 3; // list of suggestions 160 } 161 162 // `MetaEvent` provides general information regarding Skaffold 163 message MetaEvent { 164 // entry, for example: `"Starting Skaffold: {Version:v0.39.0-16-g5bb7c9e0 ConfigVersion:skaffold/v1 GitVersion: GitCommit:5bb7c9e078e4d522a5ffc42a2f1274fd17d75902 GitTreeState:dirty BuildDate01:29Z GoVersion:go1.13rc1 Compiler:gc Platform:linux/amd64}"` 165 string entry = 1; 166 // Metadata describing skaffold pipeline 167 Metadata metadata = 2; 168 } 169 170 // `BuildEvent` describes the build status per artifact, and will be emitted by Skaffold anytime a build starts or finishes, successfully or not. 171 // If the build fails, an error will be attached to the event. 172 message BuildEvent { 173 string artifact = 1; // artifact name 174 string status = 2; // artifact build status oneof: InProgress, Completed, Failed 175 string err = 3; // Deprecated. Use actionableErr.message. error when build status is Failed. 176 enums.StatusCode errCode = 4; // Deprecated. Use actionableErr.errCode. status code representing success or failure 177 ActionableErr actionableErr = 5; // actionable error message 178 string hostPlatform = 6; // architecture of the host machine. For example `linux/amd64` 179 string targetPlatforms = 7; // comma-delimited list of build target architectures. For example `linux/amd64,linux/arm64` 180 } 181 182 // `TestEvent` represents the status of a test, and is emitted by Skaffold 183 // anytime a test starts or completes, successfully or not. 184 message TestEvent { 185 string status = 1; // test status oneof: InProgress, Completed, Failed 186 ActionableErr actionableErr = 2; // actionable error message 187 } 188 189 // `DeployEvent` represents the status of a deployment, and is emitted by Skaffold 190 // anytime a deployment starts or completes, successfully or not. 191 message DeployEvent { 192 string status = 1; // deployment status oneof: InProgress, Completed, Failed 193 string err = 2; // Deprecated. Use actionableErr.message. error when status is Failed 194 enums.StatusCode errCode = 3; // Deprecated. Use actionableErr.errCode. status code representing success or failure 195 ActionableErr actionableErr = 4; // actionable error message 196 } 197 198 // `StatusCheckEvent` describes if the status check for kubernetes rollout has started, is in progress, has succeeded or failed. 199 message StatusCheckEvent { 200 string status = 1; 201 string message = 2; 202 string err = 3; // Deprecated. Use actionableErr.message. 203 enums.StatusCode errCode = 4; // Deprecated. Use actionableErr.errCode. status code representing success or failure 204 ActionableErr actionableErr = 5; // actionable error message 205 } 206 207 // A Resource StatusCheck Event, indicates progress for each kubernetes deployment. 208 // For every resource, there will be exactly one event with `status` *Succeeded* or *Failed* event. 209 // There can be multiple events with `status` *Pending*. 210 // Skaffold polls for resource status every 0.5 second. If the resource status changes, an event with `status` “Pending”, “Complete” and “Failed” 211 // will be sent with the new status. 212 message ResourceStatusCheckEvent { 213 string resource = 1; 214 string status = 2; 215 string message = 3; 216 string err = 4; // Deprecated. Use actionableErr.message. 217 enums.StatusCode statusCode = 5; 218 ActionableErr actionableErr = 6; // actionable error message 219 } 220 221 // PortEvent Event describes each port forwarding event. 222 message PortEvent { 223 int32 localPort = 1; // local port for forwarded resource 224 int32 remotePort = 2; // Deprecated. Uses targetPort.intVal. 225 string podName = 3; // pod name if port forwarded resourceType is Pod 226 string containerName = 4; // container name if specified in the kubernetes spec 227 string namespace = 5; // the namespace of the resource to port forward. 228 string portName = 6; 229 string resourceType = 7; // resource type e.g. "pod", "service". 230 string resourceName = 8; // name of the resource to forward. 231 string address=9; // address on which to bind 232 IntOrString targetPort = 10; // target port is the resource port that will be forwarded. 233 } 234 235 // FileSyncEvent describes the sync status. 236 message FileSyncEvent { 237 int32 fileCount = 1; // number of files synced 238 string image = 2; // the container image to which files are sycned. 239 string status = 3; // status of file sync. one of: Not Started, In progress, Succeeded, Failed. 240 string err = 4; // Deprecated. Use actionableErr.message. error in case of status failed. 241 enums.StatusCode errCode = 5; //// Deprecated. Use actionableErr.errCode. status code representing success or failure 242 ActionableErr actionableErr = 6; // actionable error message 243 } 244 245 // DebuggingContainerEvent is raised when a debugging container is started or terminated 246 message DebuggingContainerEvent { 247 string status = 1; // the container status oneof: Started, Terminated 248 string podName = 2; // the pod name with the debugging container 249 string containerName = 3; // the name of the container configured for debugging 250 string namespace = 4; // the namespace of the debugging container 251 252 string artifact = 5; // the corresponding artifact's image name 253 string runtime = 6; // the detected language runtime 254 string workingDir = 7; // the working directory in the container image 255 map<string,uint32> debugPorts = 8; // the exposed debugging-related ports 256 } 257 258 // LogEntry describes an event and a string description of the event. 259 message LogEntry { 260 google.protobuf.Timestamp timestamp = 1; // timestamp of the event. 261 Event event = 2; // the actual event that is one of 262 string entry = 3; // description of the event. 263 } 264 265 message UserIntentRequest { 266 Intent intent = 1; 267 } 268 269 message TriggerRequest { 270 TriggerState state = 1; 271 } 272 273 // TriggerState represents trigger state for a given phase. 274 message TriggerState { 275 oneof val { 276 bool enabled = 1; // enable or disable a trigger state 277 } 278 } 279 280 // Intent represents user intents for a given phase. 281 message Intent { 282 bool build = 1; // in case skaffold dev is ran with autoBuild=false, a build intent enables building once 283 bool sync = 2; // in case skaffold dev is ran with autoSync=false, a sync intent enables file sync once 284 bool deploy = 3; // in case skaffold dev is ran with autoDeploy=false, a deploy intent enables deploys once 285 bool devloop = 4; // in case skaffold dev is ran with autoDeploy=false, autoSync=false and autoBuild=false a devloop intent enables the entire dev loop once 286 } 287 288 // Suggestion defines the action a user needs to recover from an error. 289 message Suggestion { 290 enums.SuggestionCode suggestionCode = 1; // code representing a suggestion 291 string action = 2; // action represents the suggestion action 292 } 293 294 // IntOrString is a type that can hold an int32 or a string. 295 message IntOrString { 296 int32 type = 1; // type of stored value 297 int32 intVal = 2; // int value 298 string strVal = 3; // string value 299 } 300 301 // Describes all the methods for the Skaffold API 302 service SkaffoldService { 303 304 // Returns the state of the current Skaffold execution 305 rpc GetState (google.protobuf.Empty) returns (State) { 306 option (google.api.http) = { 307 get: "/v1/state" 308 }; 309 } 310 311 // DEPRECATED. Events should be used instead. 312 // TODO remove (https://github.com/GoogleContainerTools/skaffold/issues/3168) 313 rpc EventLog(stream LogEntry) returns (stream LogEntry) { 314 option (google.api.http) = { 315 get: "/v1/event_log" 316 }; 317 } 318 319 // Returns all the events of the current Skaffold execution from the start 320 rpc Events(google.protobuf.Empty) returns (stream LogEntry) { 321 option (google.api.http) = { 322 get: "/v1/events" 323 }; 324 } 325 326 // Allows for a single execution of some or all of the phases (build, sync, deploy) in case autoBuild, autoDeploy or autoSync are disabled. 327 rpc Execute (UserIntentRequest) returns (google.protobuf.Empty) { 328 option (google.api.http) = { 329 post: "/v1/execute" 330 body: "intent" 331 }; 332 } 333 334 // Allows for enabling or disabling automatic build trigger 335 rpc AutoBuild (TriggerRequest) returns (google.protobuf.Empty) { 336 option (google.api.http) = { 337 put: "/v1/build/auto_execute" 338 body: "state" 339 }; 340 } 341 342 // Allows for enabling or disabling automatic sync trigger 343 rpc AutoSync (TriggerRequest) returns (google.protobuf.Empty) { 344 option (google.api.http) = { 345 put: "/v1/sync/auto_execute" 346 body: "state" 347 }; 348 } 349 350 // Allows for enabling or disabling automatic deploy trigger 351 rpc AutoDeploy (TriggerRequest) returns (google.protobuf.Empty) { 352 option (google.api.http) = { 353 put: "/v1/deploy/auto_execute" 354 body: "state" 355 }; 356 } 357 358 // EXPERIMENTAL. It allows for custom events to be implemented in custom builders for example. 359 rpc Handle(Event) returns (google.protobuf.Empty) { 360 option (google.api.http) = { 361 post: "/v1/events/handle" 362 body: "*" 363 }; 364 } 365 366 }