Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[installer]: separate server and IDE components #7200

Merged
merged 3 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions installer/pkg/components/server/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"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

package server
package ide

import (
"encoding/json"
Expand All @@ -17,22 +17,10 @@ import (
"k8s.io/utils/pointer"
)

func ideconfigmap(ctx *common.RenderContext) ([]runtime.Object, error) {
func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
typeBrowser := "browser"
typeDesktop := "desktop"
idecfg := IDEConfig{
IDEVersion: workspace.CodeIDEImageStableVersion,
IDEImageRepo: common.RepoName(ctx.Config.Repository, workspace.CodeIDEImage),
IDEImageAliases: map[string]string{
"code": common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, workspace.CodeIDEImageStableVersion),
"code-latest": common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, ctx.VersionManifest.Components.Workspace.CodeImage.Version),
},
DesktopIDEImageAliases: map[string]string{
"code-desktop": common.ImageName(ctx.Config.Repository, workspace.CodeDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImage.Version),
"code-desktop-insiders": common.ImageName(ctx.Config.Repository, workspace.CodeDesktopInsidersIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImageInsiders.Version),
"intellij": common.ImageName(ctx.Config.Repository, workspace.IntelliJDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJImage.Version),
"goland": common.ImageName(ctx.Config.Repository, workspace.GoLandDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandImage.Version),
},
SupervisorImage: common.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version),
IDEOptions: IDEOptions{
Options: map[string]IDEOption{
Expand Down
13 changes: 13 additions & 0 deletions installer/pkg/components/server/ide/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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

import (
"github.com/gitpod-io/gitpod/installer/pkg/common"
)

const (
Component = common.ServerComponent
)
15 changes: 15 additions & 0 deletions installer/pkg/components/server/ide/objects.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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.

// Logically, this package belongs to the server component. However,
// from an ownership sense, this package belongs to a different team
// to the server so it's separated out

package ide

import "github.com/gitpod-io/gitpod/installer/pkg/common"

var Objects = common.CompositeRenderFunc(
configmap,
)
34 changes: 34 additions & 0 deletions installer/pkg/components/server/ide/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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

// These types are from TypeScript files

// IDEConfig RawIDEConfig interface from components/server/src/ide-config.ts
type IDEConfig struct {
SupervisorImage string `json:"supervisorImage"`
IDEOptions IDEOptions `json:"ideOptions"`
}

// IDEOptions interface from components/gitpod-protocol/src/ide-protocol.ts
type IDEOptions struct {
Options map[string]IDEOption `json:"options"`
DefaultIDE string `json:"defaultIde"`
DefaultDesktopIDE string `json:"defaultDesktopIde"`
}

// IDEOption interface from components/gitpod-protocol/src/ide-protocol.ts
type IDEOption struct {
OrderKey *string `json:"orderKey,omitempty"`
Title string `json:"title"`
Type string `json:"type"`
Logo string `json:"logo"`
Tooltip *string `json:"tooltip,omitempty"`
Label *string `json:"label,omitempty"`
Notes []string `json:"notes,omitempty"`
Hidden *bool `json:"hidden,omitempty"`
Image string `json:"image"`
ResolveImageDigest *bool `json:"resolveImageDigest,omitempty"`
}
3 changes: 2 additions & 1 deletion installer/pkg/components/server/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package server

import (
"github.com/gitpod-io/gitpod/installer/pkg/common"
"github.com/gitpod-io/gitpod/installer/pkg/components/server/ide"
)

var Objects = common.CompositeRenderFunc(
configmap,
deployment,
ideconfigmap,
ide.Objects,
networkpolicy,
role,
rolebinding,
Expand Down
35 changes: 0 additions & 35 deletions installer/pkg/components/server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,6 @@ import "github.com/gitpod-io/gitpod/installer/pkg/config/v1"

// These types are from TypeScript files

// IDEConfig RawIDEConfig interface from components/server/src/ide-config.ts
type IDEConfig struct {
// Deprecated
IDEVersion string `json:"ideVersion"`
// Deprecated
IDEImageRepo string `json:"ideImageRepo"`
// Deprecated
IDEImageAliases map[string]string `json:"ideImageAliases"`
// Deprecated
DesktopIDEImageAliases map[string]string `json:"desktopIdeImageAliases"`
SupervisorImage string `json:"supervisorImage"`
IDEOptions IDEOptions `json:"ideOptions"`
}

// IDEOptions interface from components/gitpod-protocol/src/ide-protocol.ts
type IDEOptions struct {
Options map[string]IDEOption `json:"options"`
DefaultIDE string `json:"defaultIde"`
DefaultDesktopIDE string `json:"defaultDesktopIde"`
}

// IDEOption interface from components/gitpod-protocol/src/ide-protocol.ts
type IDEOption struct {
OrderKey *string `json:"orderKey,omitempty"`
Title string `json:"title"`
Type string `json:"type"`
Logo string `json:"logo"`
Tooltip *string `json:"tooltip,omitempty"`
Label *string `json:"label,omitempty"`
Notes []string `json:"notes,omitempty"`
Hidden *bool `json:"hidden,omitempty"`
Image string `json:"image"`
ResolveImageDigest *bool `json:"resolveImageDigest,omitempty"`
}

// ConfigSerialized interface from components/server/src/config.ts
type ConfigSerialized struct {
Version string `json:"version"`
Expand Down
15 changes: 15 additions & 0 deletions installer/pkg/config/versions/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

options:
no_parent_owners: true

approvers:
- engineering-ide
- engineering-meta
- engineering-self-hosted
- engineering-workspace

labels:
- "team: IDE"
- "team: meta"
- "team: self-hosted"
- "team: workspace"