Skip to content

Commit e7c93eb

Browse files
corneliusludmannroboquat
authored andcommitted
[ws-manager] Add destkop_ide_image
1 parent 56fe86f commit e7c93eb

File tree

79 files changed

+1107
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1107
-502
lines changed

components/ee/ws-scheduler/pkg/scaler/driver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ func (wspd *WorkspaceManagerPrescaleDriver) startGhostWorkspaces(ctx context.Con
289289
290290
Username: "gitpod-ghost",
291291
},
292-
IdeImage: wspd.Config.IDEImage,
292+
DeprecatedIdeImage: wspd.Config.IDEImage,
293+
IdeImage: &api.IDEImage{
294+
WebRef: wspd.Config.IDEImage,
295+
},
293296
Initializer: &csapi.WorkspaceInitializer{
294297
Spec: &csapi.WorkspaceInitializer_Empty{
295298
Empty: &csapi.EmptyInitializer{},

components/image-builder-mk3/pkg/orchestrator/orchestrator.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,14 @@ func (o *Orchestrator) Build(req *protocol.BuildRequest, resp protocol.ImageBuil
358358
Owner: buildWorkspaceOwnerID,
359359
},
360360
Spec: &wsmanapi.StartWorkspaceSpec{
361-
CheckoutLocation: ".",
362-
Initializer: initializer,
363-
Timeout: maxBuildRuntime.String(),
364-
WorkspaceImage: o.Config.BuilderImage,
365-
IdeImage: o.Config.BuilderImage,
361+
CheckoutLocation: ".",
362+
Initializer: initializer,
363+
Timeout: maxBuildRuntime.String(),
364+
WorkspaceImage: o.Config.BuilderImage,
365+
DeprecatedIdeImage: o.Config.BuilderImage,
366+
IdeImage: &wsmanapi.IDEImage{
367+
WebRef: o.Config.BuilderImage,
368+
},
366369
WorkspaceLocation: contextPath,
367370
Envvars: []*wsmanapi.EnvironmentVariable{
368371
{Name: "BOB_TARGET_REF", Value: wsrefstr},

components/server/src/workspace/workspace-starter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IAnalyticsWriter } from '@gitpod/gitpod-protocol/lib/analytics';
1212
import { log } from '@gitpod/gitpod-protocol/lib/util/logging';
1313
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
1414
import { BuildRegistryAuth, BuildRegistryAuthSelective, BuildRegistryAuthTotal, BuildRequest, BuildResponse, BuildSource, BuildSourceDockerfile, BuildSourceReference, BuildStatus, ImageBuilderClientProvider, ResolveBaseImageRequest, ResolveWorkspaceImageRequest } from "@gitpod/image-builder/lib";
15-
import { StartWorkspaceSpec, WorkspaceFeatureFlag, StartWorkspaceResponse } from "@gitpod/ws-manager/lib";
15+
import { StartWorkspaceSpec, WorkspaceFeatureFlag, StartWorkspaceResponse, IDEImage } from "@gitpod/ws-manager/lib";
1616
import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider";
1717
import { AdmissionLevel, EnvironmentVariable, GitSpec, PortSpec, PortVisibility, StartWorkspaceRequest, WorkspaceMetadata, WorkspaceType } from "@gitpod/ws-manager/lib/core_pb";
1818
import * as crypto from 'crypto';
@@ -723,7 +723,9 @@ export class WorkspaceStarter {
723723
spec.setGit(this.createGitSpec(workspace, user));
724724
spec.setPortsList(ports);
725725
spec.setInitializer((await initializerPromise).initializer);
726-
spec.setIdeImage(ideImage);
726+
const startWorkspaceSpecIDEImage = new IDEImage();
727+
startWorkspaceSpecIDEImage.setWebRef(ideImage);
728+
spec.setIdeImage(startWorkspaceSpecIDEImage);
727729
spec.setWorkspaceImage(instance.workspaceImage);
728730
spec.setWorkspaceLocation(workspace.config.workspaceLocation || spec.getCheckoutLocation());
729731
spec.setFeatureFlagsList(this.toWorkspaceFeatureFlags(featureFlags));

components/ws-manager-api/core.proto

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,22 @@ message WorkspaceStatus {
268268
WorkspaceAuthentication auth = 9;
269269
}
270270

271+
// IDEImage configures the IDE images a workspace will use
272+
message IDEImage {
273+
// web_ref is a reference to an OCI image used for serving the web-based IDE
274+
string web_ref = 1;
275+
// desktop_ref is an optional reference to an OCI image used for serving desktop IDEs
276+
string desktop_ref = 2;
277+
}
278+
271279
// WorkspaceSpec is the specification of a workspace at runtime
272280
message WorkspaceSpec {
273281
// workspace_image is the name of the Docker image this workspace runs
274282
string workspace_image = 1;
275283

276-
// ide_image is the name of the Docker image used as IDE
277-
string ide_image = 2;
284+
// deprecated_ide_image is a field present for backwards compatibility and the same
285+
// as IDEImage.web_ref. If both fields are present, IDEImage.web_ref takes precedence.
286+
string deprecated_ide_image = 2;
278287

279288
// headless marks this workspace a headless one - headless workspaces are not intended for users but for automation
280289
bool headless = 3;
@@ -290,6 +299,9 @@ message WorkspaceSpec {
290299

291300
// The intervals in which a heartbeat must be received for the workspace not to time out
292301
string timeout = 7;
302+
303+
// ide_image is the name of the Docker image used as IDE
304+
IDEImage ide_image = 8;
293305
}
294306

295307
// PortSpec describes a networking port exposed on a workspace
@@ -443,8 +455,9 @@ message StartWorkspaceSpec {
443455
// workspace_image is the Docker image name of the workspace container
444456
string workspace_image = 1;
445457

446-
// ide_image is the Docker image name of the IDE image
447-
string ide_image = 2;
458+
// deprecated_ide_image is a field present for backwards compatibility and the same
459+
// as IDEImage.web_ref. If both fields are present, IDEImage.web_ref takes precedence.
460+
string deprecated_ide_image = 2;
448461

449462
// feature_flags provide a means for starting variants of workspaces (e.g. a privileged one)
450463
repeated WorkspaceFeatureFlag feature_flags = 3;
@@ -472,6 +485,9 @@ message StartWorkspaceSpec {
472485

473486
// admission controlls who can access the workspace and its ports.
474487
AdmissionLevel admission = 11;
488+
489+
// ide_image is the Docker image name of the IDE image
490+
IDEImage ide_image = 12;
475491
}
476492

477493
// WorkspaceFeatureFlag enable non-standard behaviour in workspaces

0 commit comments

Comments
 (0)