Skip to content

Commit

Permalink
[installer]: refactor the workspace component with ide ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms authored and roboquat committed Dec 20, 2021
1 parent d29b14e commit 55549e8
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 19 deletions.
3 changes: 2 additions & 1 deletion installer/pkg/components/blobserve/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/gitpod-io/gitpod/common-go/util"
"github.com/gitpod-io/gitpod/installer/pkg/common"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace/ide"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -35,7 +36,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Port: ContainerPort,
Timeout: util.Duration(time.Second * 5),
Repos: map[string]blobserve.Repo{
common.RepoName(ctx.Config.Repository, workspace.CodeIDEImage): {
common.RepoName(ctx.Config.Repository, ide.CodeIDEImage): {
PrePull: []string{},
Workdir: "/ide",
Replacements: []blobserve.StringReplacement{{
Expand Down
19 changes: 10 additions & 9 deletions installer/pkg/components/server/ide/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/gitpod-io/gitpod/installer/pkg/common"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace/ide"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -30,14 +31,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Type: typeBrowser,
Logo: "invalid",
Hidden: pointer.Bool(true),
Image: common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, workspace.CodeIDEImageStableVersion),
Image: common.ImageName(ctx.Config.Repository, ide.CodeIDEImage, ide.CodeIDEImageStableVersion),
},
"code": {
OrderKey: pointer.String("00"),
Title: "VS Code",
Type: typeBrowser,
Logo: "vscode",
Image: common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, workspace.CodeIDEImageStableVersion),
Image: common.ImageName(ctx.Config.Repository, ide.CodeIDEImage, ide.CodeIDEImageStableVersion),
},
"code-latest": {
OrderKey: pointer.String("01"),
Expand All @@ -46,15 +47,15 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Logo: "vscode-insiders",
Tooltip: pointer.String("Early access version, still subject to testing."),
Label: pointer.String("Insiders"),
Image: common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, ctx.VersionManifest.Components.Workspace.CodeImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.CodeIDEImage, ctx.VersionManifest.Components.Workspace.CodeImage.Version),
ResolveImageDigest: pointer.Bool(true),
},
"code-desktop": {
OrderKey: pointer.String("02"),
Title: "VS Code",
Type: typeDesktop,
Logo: "vscode",
Image: common.ImageName(ctx.Config.Repository, workspace.CodeDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.CodeDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImage.Version),
},
"code-desktop-insiders": {
OrderKey: pointer.String("03"),
Expand All @@ -63,39 +64,39 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
Logo: "vscode-insiders",
Tooltip: pointer.String("Visual Studio Code Insiders for early adopters."),
Label: pointer.String("Insiders"),
Image: common.ImageName(ctx.Config.Repository, workspace.CodeDesktopInsidersIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImageInsiders.Version),
Image: common.ImageName(ctx.Config.Repository, ide.CodeDesktopInsidersIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImageInsiders.Version),
},
"intellij": {
OrderKey: pointer.String("04"),
Title: "IntelliJ IDEA",
Type: typeDesktop,
Logo: "intellij-idea",
Notes: []string{"While in beta, when you open a workspace with IntelliJ IDEA you will need to use the password “gitpod”."},
Image: common.ImageName(ctx.Config.Repository, workspace.IntelliJDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.IntelliJDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJImage.Version),
},
"goland": {
OrderKey: pointer.String("05"),
Title: "GoLand",
Type: typeDesktop,
Logo: "goland",
Notes: []string{"While in beta, when you open a workspace with GoLand you will need to use the password “gitpod”."},
Image: common.ImageName(ctx.Config.Repository, workspace.GoLandDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.GoLandDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandImage.Version),
},
"pycharm": {
OrderKey: pointer.String("06"),
Title: "PyCharm",
Type: typeDesktop,
Logo: "https://upload.wikimedia.org/wikipedia/commons/1/1d/PyCharm_Icon.svg", // TODO(clu): Serve logo from our own components instead of using this wikimedia URL.
Notes: []string{"While in beta, when you open a workspace with PyCharm you will need to use the password “gitpod”."},
Image: common.ImageName(ctx.Config.Repository, workspace.PyCharmDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PyCharmImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.PyCharmDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PyCharmImage.Version),
},
"phpstorm": {
OrderKey: pointer.String("07"),
Title: "PhpStorm",
Type: typeDesktop,
Logo: "https://upload.wikimedia.org/wikipedia/commons/c/c9/PhpStorm_Icon.svg", // TODO(clu): Serve logo from our own components instead of using this wikimedia URL.
Notes: []string{"While in beta, when you open a workspace with PhpStorm you will need to use the password “gitpod”."},
Image: common.ImageName(ctx.Config.Repository, workspace.PhpStormDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PhpStormImage.Version),
Image: common.ImageName(ctx.Config.Repository, ide.PhpStormDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PhpStormImage.Version),
},
},
DefaultIDE: "code",
Expand Down
9 changes: 9 additions & 0 deletions installer/pkg/components/workspace/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

options:
no_parent_owners: true

approvers:
- engineering-workspace

labels:
- "team: workspace"
8 changes: 0 additions & 8 deletions installer/pkg/components/workspace/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ const (
ContainerPort = 23000
DefaultWorkspaceImage = "gitpod/workspace-full"
DefaultWorkspaceImageVersion = "latest"
CodeIDEImage = "ide/code"
CodeIDEImageStableVersion = "commit-0d1e8cc5dcc8ccb38efcc2cd6404316b6e7bf4e9" // stable version that will be updated manually on demand
CodeDesktopIDEImage = "ide/code-desktop"
CodeDesktopInsidersIDEImage = "ide/code-desktop-insiders"
IntelliJDesktopIDEImage = "ide/intellij"
GoLandDesktopIdeImage = "ide/goland"
PyCharmDesktopIdeImage = "ide/pycharm"
PhpStormDesktopIdeImage = "ide/phpstorm"
DockerUpImage = "docker-up"
SupervisorImage = "supervisor"
WorkspacekitImage = "workspacekit"
Expand Down
9 changes: 9 additions & 0 deletions installer/pkg/components/workspace/ide/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

options:
no_parent_owners: true

approvers:
- engineering-ide

labels:
- "team: IDE"
16 changes: 16 additions & 0 deletions installer/pkg/components/workspace/ide/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

package ide

const (
CodeIDEImage = "ide/code"
CodeIDEImageStableVersion = "commit-0d1e8cc5dcc8ccb38efcc2cd6404316b6e7bf4e9" // stable version that will be updated manually on demand
CodeDesktopIDEImage = "ide/code-desktop"
CodeDesktopInsidersIDEImage = "ide/code-desktop-insiders"
IntelliJDesktopIDEImage = "ide/intellij"
GoLandDesktopIdeImage = "ide/goland"
PyCharmDesktopIdeImage = "ide/pycharm"
PhpStormDesktopIdeImage = "ide/phpstorm"
)
3 changes: 2 additions & 1 deletion installer/pkg/components/ws-scheduler/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/gitpod-io/gitpod/common-go/util"
"github.com/gitpod-io/gitpod/installer/pkg/common"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace"
"github.com/gitpod-io/gitpod/installer/pkg/components/workspace/ide"
wsmanager "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager"
"github.com/gitpod-io/gitpod/ws-scheduler/pkg/scaler"
"github.com/gitpod-io/gitpod/ws-scheduler/pkg/scheduler"
Expand Down Expand Up @@ -84,7 +85,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
},
},
WorkspaceImage: common.ImageName("", workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion),
IDEImage: common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, workspace.CodeIDEImageStableVersion),
IDEImage: common.ImageName(ctx.Config.Repository, ide.CodeIDEImage, ide.CodeIDEImageStableVersion),
SupervisorImage: common.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version),
FeatureFlags: nil,
MaxGhostWorkspaces: 0,
Expand Down

0 comments on commit 55549e8

Please sign in to comment.