@@ -77,14 +77,9 @@ message GetWorkspaceResponse {
77
77
message CreateAndStartWorkspaceRequest {
78
78
string idempotency_token = 1 ;
79
79
80
- string context_url = 2 ;
81
-
82
- oneof prebuild {
83
- // if true, and there's a prebuild available (not running), use that prebuild
84
- bool if_available = 3 ;
85
- // uses a particular prebuild - the prebuild ID is scoped by the context URL.
86
- // Use the PrebuildService to get ahold of the prebuild_id.
87
- string prebuild_id = 4 ;
80
+ oneof source {
81
+ string context_url = 2 ;
82
+ string prebuild_id = 3 ;
88
83
}
89
84
90
85
StartWorkspaceSpec start_spec = 5 ;
@@ -224,6 +219,64 @@ message WorkspaceInstance {
224
219
225
220
// WorkspaceStatus describes a workspace status
226
221
message WorkspaceInstanceStatus {
222
+ // Phase is a simple, high-level summary of where the workspace instance is in its lifecycle.
223
+ // The phase is not intended to be a comprehensive rollup of observations of the workspace state,
224
+ // nor is it intended to be a comprehensive state machine.
225
+ // (based on https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)
226
+ enum Phase {
227
+ // Unknown indicates an issue within the workspace manager in that it cannot determine the actual phase of
228
+ // a workspace. This phase is usually accompanied by an error.
229
+ PHASE_UNSPECIFIED = 0 ;
230
+
231
+ // ImageBuild indicates that there's an image build running for this workspace.
232
+ PHASE_IMAGEBUILD = 1 ;
233
+
234
+ // Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
235
+ // some space within the cluster. If for example the cluster needs to scale up to accomodate the
236
+ // workspace, the workspace will be in Pending state until that happened.
237
+ PHASE_PENDING = 2 ;
238
+
239
+ // Creating means the workspace is currently being created. That includes downloading the images required
240
+ // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
241
+ // network speed, image size and cache states.
242
+ PHASE_CREATING = 3 ;
243
+
244
+ // Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
245
+ // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
246
+ PHASE_INITIALIZING = 4 ;
247
+
248
+ // Running means the workspace is able to actively perform work, either by serving a user through Theia,
249
+ // or as a headless workspace.
250
+ PHASE_RUNNING = 5 ;
251
+
252
+ // Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
253
+ // When in this state, we expect it to become running or stopping anytime soon.
254
+ PHASE_INTERRUPTED = 6 ;
255
+
256
+ // Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
257
+ PHASE_STOPPING = 7 ;
258
+
259
+ // Stopped means the workspace ended regularly because it was shut down.
260
+ PHASE_STOPPED = 8 ;
261
+ }
262
+
263
+ // Conditions gives more detailed information as to the state of the workspace. Which condition actually
264
+ // has a value depends on the phase the workspace is in.
265
+ message Conditions {
266
+ // failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
267
+ // This field is filled exclusively when caused by system errors.
268
+ string failed = 1 ;
269
+
270
+ // timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out.
271
+ string timeout = 2 ;
272
+
273
+ // first_user_activity is the time when MarkActive was first called on the workspace
274
+ google.protobuf.Timestamp first_user_activity = 9 ;
275
+
276
+ // stopped_by_request is true if the workspace was stopped using a StopWorkspace call
277
+ optional bool stopped_by_request = 11 ;
278
+ }
279
+
227
280
// version of the status update. Workspace instances themselves are unversioned,
228
281
// but their statuus has different versions.
229
282
// The value of this field has no semantic meaning (e.g. don't interpret it as
@@ -232,10 +285,10 @@ message WorkspaceInstanceStatus {
232
285
uint64 status_version = 1 ;
233
286
234
287
// the phase of a workspace is a simple, high-level summary of where the workspace instance is in its lifecycle
235
- WorkspaceInstancePhase phase = 2 ;
288
+ Phase phase = 2 ;
236
289
237
290
// conditions detail the current state of the workspace instance
238
- WorkspaceInstanceConditions conditions = 3 ;
291
+ Conditions conditions = 3 ;
239
292
240
293
// message is an optional human-readable message detailing the current phase
241
294
string message = 4 ;
@@ -252,65 +305,6 @@ message WorkspaceInstanceStatus {
252
305
// contentservice.GitStatus repo = 7;
253
306
}
254
307
255
-
256
- // WorkspaceInstancePhase is a simple, high-level summary of where the workspace instance is in its lifecycle.
257
- // The phase is not intended to be a comprehensive rollup of observations of the workspace state,
258
- // nor is it intended to be a comprehensive state machine.
259
- // (based on https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)
260
- enum WorkspaceInstancePhase {
261
- // Unknown indicates an issue within the workspace manager in that it cannot determine the actual phase of
262
- // a workspace. This phase is usually accompanied by an error.
263
- WORKSPACE_INSTANCE_PHASE_UNSPECIFIED = 0 ;
264
-
265
- // This will become IMAGE_BUILD
266
- reserved 1 ;
267
-
268
- // Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
269
- // some space within the cluster. If for example the cluster needs to scale up to accomodate the
270
- // workspace, the workspace will be in Pending state until that happened.
271
- WORKSPACE_INSTANCE_PHASE_PENDING = 2 ;
272
-
273
- // Creating means the workspace is currently being created. That includes downloading the images required
274
- // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
275
- // network speed, image size and cache states.
276
- WORKSPACE_INSTANCE_PHASE_CREATING = 3 ;
277
-
278
- // Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
279
- // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
280
- WORKSPACE_INSTANCE_PHASE_INITIALIZING = 4 ;
281
-
282
- // Running means the workspace is able to actively perform work, either by serving a user through Theia,
283
- // or as a headless workspace.
284
- WORKSPACE_INSTANCE_PHASE_RUNNING = 5 ;
285
-
286
- // Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
287
- // When in this state, we expect it to become running or stopping anytime soon.
288
- WORKSPACE_INSTANCE_PHASE_INTERRUPTED = 6 ;
289
-
290
- // Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
291
- WORKSPACE_INSTANCE_PHASE_STOPPING = 7 ;
292
-
293
- // Stopped means the workspace ended regularly because it was shut down.
294
- WORKSPACE_INSTANCE_PHASE_STOPPED = 8 ;
295
- }
296
-
297
- // WorkspaceInstanceConditions gives more detailed information as to the state of the workspace. Which condition actually
298
- // has a value depends on the phase the workspace is in.
299
- message WorkspaceInstanceConditions {
300
- // failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
301
- // This field is filled exclusively when caused by system errors.
302
- string failed = 1 ;
303
-
304
- // timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out.
305
- string timeout = 2 ;
306
-
307
- // first_user_activity is the time when MarkActive was first called on the workspace
308
- google.protobuf.Timestamp first_user_activity = 9 ;
309
-
310
- // stopped_by_request is true if the workspace was stopped using a StopWorkspace call
311
- optional bool stopped_by_request = 11 ;
312
- }
313
-
314
308
// Admission level describes who can access a workspace instance and its ports.
315
309
enum AdmissionLevel {
316
310
ADMISSION_LEVEL_UNSPECIFIED = 0 ;
0 commit comments