Skip to content

Commit

Permalink
[ws-manager] Add destkop_ide_image
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann committed Oct 26, 2021
1 parent 4c8638c commit 17967fb
Show file tree
Hide file tree
Showing 79 changed files with 1,107 additions and 502 deletions.
5 changes: 4 additions & 1 deletion components/ee/ws-scheduler/pkg/scaler/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ func (wspd *WorkspaceManagerPrescaleDriver) startGhostWorkspaces(ctx context.Con
Email: "[email protected]",
Username: "gitpod-ghost",
},
IdeImage: wspd.Config.IDEImage,
DeprecatedIdeImage: wspd.Config.IDEImage,
IdeImage: &api.IDEImage{
WebRef: wspd.Config.IDEImage,
},
Initializer: &csapi.WorkspaceInitializer{
Spec: &csapi.WorkspaceInitializer_Empty{
Empty: &csapi.EmptyInitializer{},
Expand Down
13 changes: 8 additions & 5 deletions components/image-builder-mk3/pkg/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,14 @@ func (o *Orchestrator) Build(req *protocol.BuildRequest, resp protocol.ImageBuil
Owner: buildWorkspaceOwnerID,
},
Spec: &wsmanapi.StartWorkspaceSpec{
CheckoutLocation: ".",
Initializer: initializer,
Timeout: maxBuildRuntime.String(),
WorkspaceImage: o.Config.BuilderImage,
IdeImage: o.Config.BuilderImage,
CheckoutLocation: ".",
Initializer: initializer,
Timeout: maxBuildRuntime.String(),
WorkspaceImage: o.Config.BuilderImage,
DeprecatedIdeImage: o.Config.BuilderImage,
IdeImage: &wsmanapi.IDEImage{
WebRef: o.Config.BuilderImage,
},
WorkspaceLocation: contextPath,
Envvars: []*wsmanapi.EnvironmentVariable{
{Name: "BOB_TARGET_REF", Value: wsrefstr},
Expand Down
6 changes: 4 additions & 2 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IAnalyticsWriter } from '@gitpod/gitpod-protocol/lib/analytics';
import { log } from '@gitpod/gitpod-protocol/lib/util/logging';
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
import { BuildRegistryAuth, BuildRegistryAuthSelective, BuildRegistryAuthTotal, BuildRequest, BuildResponse, BuildSource, BuildSourceDockerfile, BuildSourceReference, BuildStatus, ImageBuilderClientProvider, ResolveBaseImageRequest, ResolveWorkspaceImageRequest } from "@gitpod/image-builder/lib";
import { StartWorkspaceSpec, WorkspaceFeatureFlag, StartWorkspaceResponse } from "@gitpod/ws-manager/lib";
import { StartWorkspaceSpec, WorkspaceFeatureFlag, StartWorkspaceResponse, IDEImage } from "@gitpod/ws-manager/lib";
import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider";
import { AdmissionLevel, EnvironmentVariable, GitSpec, PortSpec, PortVisibility, StartWorkspaceRequest, WorkspaceMetadata, WorkspaceType } from "@gitpod/ws-manager/lib/core_pb";
import * as crypto from 'crypto';
Expand Down Expand Up @@ -723,7 +723,9 @@ export class WorkspaceStarter {
spec.setGit(this.createGitSpec(workspace, user));
spec.setPortsList(ports);
spec.setInitializer((await initializerPromise).initializer);
spec.setIdeImage(ideImage);
const startWorkspaceSpecIDEImage = new IDEImage();
startWorkspaceSpecIDEImage.setWebRef(ideImage);
spec.setIdeImage(startWorkspaceSpecIDEImage);
spec.setWorkspaceImage(instance.workspaceImage);
spec.setWorkspaceLocation(workspace.config.workspaceLocation || spec.getCheckoutLocation());
spec.setFeatureFlagsList(this.toWorkspaceFeatureFlags(featureFlags));
Expand Down
24 changes: 20 additions & 4 deletions components/ws-manager-api/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,22 @@ message WorkspaceStatus {
WorkspaceAuthentication auth = 9;
}

// IDEImage configures the IDE images a workspace will use
message IDEImage {
// web_ref is a reference to an OCI image used for serving the web-based IDE
string web_ref = 1;
// desktop_ref is an optional reference to an OCI image used for serving desktop IDEs
string desktop_ref = 2;
}

// WorkspaceSpec is the specification of a workspace at runtime
message WorkspaceSpec {
// workspace_image is the name of the Docker image this workspace runs
string workspace_image = 1;

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

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

// The intervals in which a heartbeat must be received for the workspace not to time out
string timeout = 7;

// ide_image is the name of the Docker image used as IDE
IDEImage ide_image = 8;
}

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

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

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

// admission controlls who can access the workspace and its ports.
AdmissionLevel admission = 11;

// ide_image is the Docker image name of the IDE image
IDEImage ide_image = 12;
}

// WorkspaceFeatureFlag enable non-standard behaviour in workspaces
Expand Down
Loading

0 comments on commit 17967fb

Please sign in to comment.