Skip to content

Commit

Permalink
[ide] Add VS Code desktop IDE options
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann authored and roboquat committed Nov 18, 2021
1 parent 44d50bc commit c6379c8
Show file tree
Hide file tree
Showing 15 changed files with 692 additions and 7 deletions.
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-af752e2ae4ed623131e1a4f84dc6061ea2655d9e"
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>
</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

0 comments on commit c6379c8

Please sign in to comment.