@@ -354,6 +354,18 @@ func (cmd *UpCmd) Run(
354354 cmd .GitToken ,
355355 log ,
356356 )
357+ case string (config .IDEJupyterDesktop ):
358+ return startJupyterDesktop (
359+ cmd .GPGAgentForwarding ,
360+ ctx ,
361+ devPodConfig ,
362+ client ,
363+ user ,
364+ ideConfig .Options ,
365+ cmd .GitUsername ,
366+ cmd .GitToken ,
367+ log ,
368+ )
357369 }
358370 }
359371
@@ -630,6 +642,61 @@ func startJupyterNotebookInBrowser(
630642 )
631643}
632644
645+ func startJupyterDesktop (
646+ forwardGpg bool ,
647+ ctx context.Context ,
648+ devPodConfig * config.Config ,
649+ client client2.BaseWorkspaceClient ,
650+ user string ,
651+ ideOptions map [string ]config.OptionValue ,
652+ gitUsername , gitToken string ,
653+ logger log.Logger ,
654+ ) error {
655+ if forwardGpg {
656+ err := performGpgForwarding (client , logger )
657+ if err != nil {
658+ return err
659+ }
660+ }
661+
662+ // determine port
663+ jupyterAddress , jupyterPort , err := parseAddressAndPort (
664+ jupyter .Options .GetValue (ideOptions , jupyter .BindAddressOption ),
665+ jupyter .DefaultServerPort ,
666+ )
667+ if err != nil {
668+ return err
669+ }
670+
671+ // wait until reachable then open browser
672+ targetURL := fmt .Sprintf ("http://localhost:%d/lab" , jupyterPort )
673+ if jupyter .Options .GetValue (ideOptions , jupyter .OpenOption ) == "true" {
674+ go func () {
675+ err = open2 .JLabDesktop (ctx , targetURL , logger )
676+ if err != nil {
677+ logger .Errorf ("error opening jupyter desktop: %v" , err )
678+ }
679+ logger .Infof ("Successfully started jupyter desktop" )
680+ }()
681+ }
682+
683+ // start in browser
684+ logger .Infof ("Starting jupyter desktop using server %s" , targetURL )
685+ extraPorts := []string {fmt .Sprintf ("%s:%d" , jupyterAddress , jupyter .DefaultServerPort )}
686+ return startBrowserTunnel (
687+ ctx ,
688+ devPodConfig ,
689+ client ,
690+ user ,
691+ targetURL ,
692+ false ,
693+ extraPorts ,
694+ gitUsername ,
695+ gitToken ,
696+ logger ,
697+ )
698+ }
699+
633700func startFleet (ctx context.Context , client client2.BaseWorkspaceClient , logger log.Logger ) error {
634701 // create ssh command
635702 stdout := & bytes.Buffer {}
0 commit comments