Skip to content

[ide] Add VS Code desktop IDE options #6671

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

Merged
merged 1 commit into from
Nov 18, 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
2 changes: 2 additions & 0 deletions chart/templates/server-ide-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ code-latest: {{ (include "insider-image-full" (dict "root" $ "gp" $gp "comp" $gp
{{- define "desktop-ide-images-aliases"}}
{{- $ := .root -}}
{{- $gp := .gp -}}
code-desktop: {{ (include "gitpod.comp.imageFull" (dict "root" $ "gp" $gp "comp" $gp.components.workspace.desktopIdeImages.codeDesktop)) }}
code-desktop-insiders: {{ (include "gitpod.comp.imageFull" (dict "root" $ "gp" $gp "comp" $gp.components.workspace.desktopIdeImages.codeDesktopInsiders)) }}
intellij: {{ (include "gitpod.comp.imageFull" (dict "root" $ "gp" $gp "comp" $gp.components.workspace.desktopIdeImages.intellij)) }}
goland: {{ (include "gitpod.comp.imageFull" (dict "root" $ "gp" $gp "comp" $gp.components.workspace.desktopIdeImages.goland)) }}
{{ end }}
Expand Down
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ components:
stableVersion: "commit-636ef165f4255931c23fb2948e81c73cc75c4fb9"
insidersVersion: "nightly"
desktopIdeImages:
codeDesktop:
imageName: "ide/code-desktop"
codeDesktopInsiders:
imageName: "ide/code-desktop-insiders"
intellij:
imageName: "ide/intellij"
goland:
Expand Down
2 changes: 2 additions & 0 deletions components/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ packages:
- components/ee/ws-scheduler:docker
- components/gitpod-db:docker
- components/ide/code:docker
- components/ide/code-desktop:docker
- components/ide/code-desktop:docker-insiders
- components/ide/jetbrains/image:intellij
- components/ide/jetbrains/image:goland
- components/ide/theia:docker
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/components/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

function CheckBox(props: {
name?: string,
title: string,
title: string | React.ReactNode,
desc: string,
checked: boolean,
disabled?: boolean,
Expand Down
37 changes: 37 additions & 0 deletions components/dashboard/src/images/vscodeInsiders.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 16 additions & 6 deletions components/dashboard/src/settings/Preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Tooltip from "../components/Tooltip";
import golandLogo from '../images/golandLogo.svg';
import ideaLogo from '../images/intellijIdeaLogo.svg';
import vscode from '../images/vscode.svg';
import vscodeInsiders from '../images/vscodeInsiders.svg';
import { getGitpodService } from "../service/service";
import { ThemeContext } from "../theme-context";
import { UserContext } from "../user-context";
Expand All @@ -36,7 +37,7 @@ export default function Preferences() {
setDefaultIde(value);
}

const [defaultDesktopIde, setDefaultDesktopIde] = useState<string>(user?.additionalData?.ideSettings?.defaultDesktopIde || 'intellij');
const [defaultDesktopIde, setDefaultDesktopIde] = useState<string>(user?.additionalData?.ideSettings?.defaultDesktopIde || 'code-desktop');
const actuallySetDefaultDesktopIde = async (value: string) => {
const additionalData = user?.additionalData || {};
const settings = additionalData.ideSettings || {};
Expand Down Expand Up @@ -83,35 +84,44 @@ export default function Preferences() {
<Tooltip content={'Early access version, still subject to testing.'} >
<SelectableCard className="w-36 h-40" title="VS Code" selected={defaultIde === 'code-latest'} onClick={() => actuallySetDefaultIde('code-latest')}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={vscode} />
<img className="w-16 filter-grayscale self-center" src={vscodeInsiders} />
</div>
<PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Insiders</PillLabel>
</SelectableCard>
</Tooltip>
</div>
<div className="mt-4 space-x-4 flex">
<CheckBox
title="Open in Desktop IDE"
title={<div>Open in Desktop IDE <PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Beta</PillLabel></div>}
desc="Choose whether you would like to open your workspace in a desktop IDE instead."
checked={useDesktopIde}
onChange={(evt) => actuallySetUseDesktopIde(evt.target.checked)} />
</div>
{useDesktopIde && <>
<div className="mt-4 space-x-4 flex">
<SelectableCard className="w-36 h-40" title="VS Code" selected={defaultDesktopIde === 'code-desktop'} onClick={() => actuallySetDefaultDesktopIde('code-desktop')}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={vscode} />
</div>
</SelectableCard>
<SelectableCard className="w-36 h-40" title="VS Code" selected={defaultDesktopIde === 'code-desktop-insiders'} onClick={() => actuallySetDefaultDesktopIde('code-desktop-insiders')}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={vscodeInsiders} />
</div>
<PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Insiders</PillLabel>
Copy link
Contributor

@gtsiolis gtsiolis Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The problem with re-using the same component (PillLabel) here is that it's now not clear to the user what's the difference between these labels. Cc @loujaybee

suggestion: Ideally, we should at least use a different style but do not want to push back from merging this as is. We can always iterate and improve this later, as you mentioned in #6485 (comment), since this is out of the scope of this PR. Let's make sure there's a follow up issue if we decide to improve the beta label later. ➿

BEFORE AFTER
label-before label-after

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to this issue: #6601 (comment)

</SelectableCard>
<SelectableCard className="w-36 h-40" title="IntelliJ IDEA" selected={defaultDesktopIde === 'intellij'} onClick={() => actuallySetDefaultDesktopIde('intellij')}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={ideaLogo} />
</div>
<PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Beta</PillLabel>
</SelectableCard>
<SelectableCard className="w-36 h-40" title="GoLand" selected={defaultDesktopIde === 'goland'} onClick={() => actuallySetDefaultDesktopIde('goland')}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={golandLogo} />
</div>
<PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Beta</PillLabel>
</SelectableCard>
</div>
<InfoBox className="my-5">While in beta, when you open a workspace using a JetBrains IDE you will need to use the following password: <CodeText>gitpod</CodeText></InfoBox>
<InfoBox className="my-5 max-w-2xl">While in beta, when you open a workspace using a JetBrains IDE you will need to use the following password: <CodeText>gitpod</CodeText></InfoBox>
<p className="text-left w-full text-gray-500">
The <strong>JetBrains desktop IDEs</strong> are currently in beta. <a href="https://github.com/gitpod-io/gitpod/issues/6576" target="gitpod-feedback-issue" rel="noopener" className="gp-link">Send feedback</a> · <a href="https://www.gitpod.io/docs/integrations/jetbrains" target="_blank" rel="noopener" className="gp-link">Documentation</a>
</p>
Expand Down
37 changes: 37 additions & 0 deletions components/ide/code-desktop/BUILD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
packages:
- name: docker
type: docker
srcs:
- "startup.sh"
- "supervisor-ide-config_stable.json"
deps:
- components/ide/code-desktop/status:app
argdeps:
- imageRepoBase
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.codeDesktop
buildArgs:
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_stable.json
image:
- ${imageRepoBase}/ide/code-desktop:${version}
- ${imageRepoBase}/ide/code-desktop:commit-${__git_commit}
- name: docker-insiders
type: docker
srcs:
- "startup.sh"
- "supervisor-ide-config_insiders.json"
deps:
- components/ide/code-desktop/status:app
argdeps:
- imageRepoBase
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.desktopIdeImages.codeDesktopInsiders
buildArgs:
SUPERVISOR_IDE_CONFIG: supervisor-ide-config_insiders.json
image:
- ${imageRepoBase}/ide/code-desktop-insiders:${version}
- ${imageRepoBase}/ide/code-desktop-insiders:commit-${__git_commit}
8 changes: 8 additions & 0 deletions components/ide/code-desktop/leeway.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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.

FROM scratch
ARG SUPERVISOR_IDE_CONFIG
COPY --chown=33333:33333 ${SUPERVISOR_IDE_CONFIG} /ide-desktop/supervisor-ide-config.json
COPY --chown=33333:33333 startup.sh components-ide-code-desktop-status--app/status /ide-desktop/
13 changes: 13 additions & 0 deletions components/ide/code-desktop/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -li
# 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.

set -euo pipefail

# kill background jobs when the script exits
trap "jobs -p | xargs -r kill" SIGINT SIGTERM EXIT

/ide-desktop/status 24000 "$1" "$2"

echo "Desktop IDE startup script exited"
14 changes: 14 additions & 0 deletions components/ide/code-desktop/status/BUILD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
packages:
- name: app
type: go
srcs:
- "**/*.go"
- "go.mod"
- "go.sum"
env:
- CGO_ENABLED=0
- GOOS=linux
deps:
- components/supervisor-api/go:lib
config:
packaging: app
20 changes: 20 additions & 0 deletions components/ide/code-desktop/status/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/gitpod-io/gitpod/code-desktop/status

go 1.17

require google.golang.org/grpc v1.42.0

require github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 // indirect

require (
github.com/gitpod-io/gitpod/supervisor/api v0.0.0-00010101000000-000000000000
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced // indirect
google.golang.org/protobuf v1.27.1 // indirect
)

replace github.com/gitpod-io/gitpod/supervisor/api => ../../../supervisor-api/go // leeway
Loading