Skip to content

Commit

Permalink
Implement experimental support for data spell (#1347)
Browse files Browse the repository at this point in the history
* Implement support for data spell

* Update options

* Revert goland change
  • Loading branch information
bkneis authored Nov 13, 2024
1 parent d83228f commit 92b202b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/agent/container/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ func (cmd *SetupContainerCmd) installIDE(setupInfo *config.Result, ide *provider
return jetbrains.NewRubyMineServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()
case string(config2.IDEWebStorm):
return jetbrains.NewWebStormServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()
case string(config2.IDEDataSpell):
return jetbrains.NewDataSpellServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install()
case string(config2.IDEFleet):
return fleet.NewFleetServer(config.GetRemoteUser(setupInfo), ide.Options, log).Install(setupInfo.SubstitutionContext.ContainerWorkspaceFolder)
case string(config2.IDEJupyterNotebook):
Expand Down
2 changes: 2 additions & 0 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ func (cmd *UpCmd) Run(
return jetbrains.NewRubyMineServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())
case string(config.IDEWebStorm):
return jetbrains.NewWebStormServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())
case string(config.IDEDataSpell):
return jetbrains.NewDataSpellServer(config2.GetRemoteUser(result), ideConfig.Options, log).OpenGateway(result.SubstitutionContext.ContainerWorkspaceFolder, client.Workspace())
case string(config.IDEFleet):
return startFleet(ctx, client, log)
case string(config.IDEJupyterNotebook):
Expand Down
1 change: 1 addition & 0 deletions pkg/config/ide.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
IDERubyMine IDE = "rubymine"
IDERider IDE = "rider"
IDEWebStorm IDE = "webstorm"
IDEDataSpell IDE = "dataspell"
IDEFleet IDE = "fleet"
IDEJupyterNotebook IDE = "jupyternotebook"
IDEJupyterDesktop IDE = "jupyterdesktop"
Expand Down
2 changes: 2 additions & 0 deletions pkg/driver/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ func (d *dockerDriver) RunDockerDevContainer(
args = append(args, "--mount", jetbrains.NewRubyMineServer("", ideOptions, d.Log).GetVolume())
case string(config2.IDEWebStorm):
args = append(args, "--mount", jetbrains.NewWebStormServer("", ideOptions, d.Log).GetVolume())
case string(config2.IDEDataSpell):
args = append(args, "--mount", jetbrains.NewDataSpellServer("", ideOptions, d.Log).GetVolume())
}

// labels
Expand Down
6 changes: 6 additions & 0 deletions pkg/ide/ideparse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ var AllowedIDEs = []AllowedIDE{
Options: jetbrains.WebStormOptions,
Icon: "https://devpod.sh/assets/webstorm.svg",
},
{
Name: config.IDEDataSpell,
DisplayName: "DataSpell",
Options: jetbrains.DataSpellOptions,
Icon: "https://devpod.sh/assets/dataspell.svg",
},
{
Name: config.IDEFleet,
DisplayName: "Fleet",
Expand Down
39 changes: 39 additions & 0 deletions pkg/ide/jetbrains/dataspell.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package jetbrains

import (
"github.com/loft-sh/devpod/pkg/config"
"github.com/loft-sh/devpod/pkg/ide"
"github.com/loft-sh/log"
)

const (
DataSpellProductCode = "DS"
DataSpellDownloadAmd64Template = "https://download.jetbrains.com/ds/dataspell-%s.tar.gz"
DataSpellDownloadArm64Template = "https://download.jetbrains.com/ds/dataspell-%s-aarch64.tar.gz"
)

var DataSpellOptions = ide.Options{
VersionOption: {
Name: VersionOption,
Description: "The version for the binary",
Default: "latest",
},
DownloadArm64Option: {
Name: DownloadArm64Option,
Description: "The download url for the arm64 server binary",
},
DownloadAmd64Option: {
Name: DownloadAmd64Option,
Description: "The download url for the amd64 server binary",
},
}

func NewDataSpellServer(userName string, values map[string]config.OptionValue, log log.Logger) *GenericJetBrainsServer {
amd64Download, arm64Download := getDownloadURLs(DataSpellOptions, values, DataSpellProductCode, DataSpellDownloadAmd64Template, DataSpellDownloadArm64Template)
return newGenericServer(userName, &GenericOptions{
ID: "dataspell",
DisplayName: "DataSpell",
DownloadAmd64: amd64Download,
DownloadArm64: arm64Download,
}, log)
}

0 comments on commit 92b202b

Please sign in to comment.