rocker-versioned2 icon indicating copy to clipboard operation
rocker-versioned2 copied to clipboard

Proof-of-concept for code-server based interface

Open cboettig opened this issue 4 years ago • 11 comments

A proof-of-concept to enable users to swap in https://github.com/cdr/code-server as a possible alternative to RStudio Server.

Motivation: Rocker instances with RStudio built-in provide a natural/convenient way for users to interact with the container on a remote or local host through it's web-browser interface. code-server provides a similar browser-based environment, only built upon Visual Studio instead. In addition to just supporting the option of a different IDE interface that may be preferable to some users, the code-server approach may offer a few benefits to some of the long-standing challenges we've had, such as:

  • running the container as non-root user (particularly for podman and other docker-based options that require this)
  • built-in support for jupyter notebooks (our binder builds have some unresolved issues)
  • allowing arbitrary number of tabs to be open to different (or the same) projects running in the same instance (no need to use different browsers etc)
  • less coupling between the R session / active project and the editor and other IDE features (i.e. can restart the R session or switch projects without interrupting the active terminal, though maybe using a terminal multiplexer in RStudio is sufficient for that)
  • some convenient integrations for existing OAuth authentication options, e.g. https://www.pomerium.io/guides/code-server.html

While this would provide access to Visual Studio extensions, themes, and IDE features, note that code-server does not support the non-open-source extensions found in Visual Studio, such as LiveShare or CoPilot.

cboettig avatar Nov 24 '21 22:11 cboettig

Thanks @eitsupi !

If you want to add a script for vscode-R, you can refer to the definition I maintain for VSCode Remote-Containers or a script I wrote for rocker/r-ver. https://github.com/microsoft/vscode-dev-containers/tree/main/containers/r https://github.com/eitsupi/r-ver/blob/83e7f4d1be1bb8ec2ff1b3bfa8ce54c8f60fb3b1/scripts/install_editorsupports.sh

I admit I hadn't seen these, looks fantastic. Will have to give them a closer look.

One of the advantages of vscode is that it can be run on arm64, but it also requires multiple apt packages for source installation.

That's a good point, looks like the code-server version should run on ARM.

I also think it would be useful to separate the contents of install_rstudio.sh into the true dependencies of RStudio Server and other useful settings that can be reused when installing editors other than RStudio Server.

yup we should probably do that. some of those deps are pretty universally useful and should probably just be re-listed in, say, install_tidyverse.sh and later scripts so they are installed if rstudio is skipped? Others pretty specific to RStudio.

cboettig avatar Nov 25 '21 04:11 cboettig

@cboettig hopefully https://github.com/rocker-org/rocker-versioned2/pull/309 will fix the issues with the binder image.

yuvipanda avatar Dec 15 '21 18:12 yuvipanda

@cboettig You may be interested in https://gitlab.b-data.ch/jupyterlab/r/docker-stack, which combines https://github.com/rocker-org/rocker-versioned with https://github.com/jupyter/docker-stacks including code-server and further customisations.

See also https://demo.jupyter.b-data.ch for a minimal deployment (CPU: 2 cores, RAM: 8 GB) based on https://gitlab.com/b-data/docker/deployments/jupyter serving either registry.gitlab.b-data.ch/jupyterlab/r/verse:latest-root or registry.gitlab.b-data.ch/jupyterlab/julia/ver:latest-root.
ℹ️ Both JupyterHub and JupyterLab docker images are multi-arch (linux/amd64, linux/arm64/v8), the latter Debian-based.

benz0li avatar Jan 09 '22 14:01 benz0li

@benz0li If you like, you can mention them on the recently renewed Rocker project web site? I don't know how many people read this page, but I think it might help those interested in Docker images for R to know about them. https://rocker-project.org/images/external.html

eitsupi avatar Aug 17 '22 09:08 eitsupi

@benz0li If you like, you can mention them on the recently renewed Rocker project web site?

Thank you for that suggestion. I will open a pull request at https://github.com/rocker-org/website in due time.

benz0li avatar Aug 17 '22 10:08 benz0li

Wondering if this could be closed in favor of https://github.com/rocker-org/devcontainer-images (devcontainer-base approach). There are none at this time, but we can expect to see a code-server installation feature appear in the future.

eitsupi avatar Oct 16 '22 11:10 eitsupi

@eitsupi is it possible to self-host a vscode instance / devcontainer that a user accesses in the browser over HTTPS (as in GitHub Codespaces) rather than over ssh tunnel? My understanding is that vscode decided not to support that mechanism, and that was the main reason for https://coder.com/ 's fork of the project? So I think the objectives here are somewhat distinct?

(though we still may not want to pursue any images with coder.com based interface anyway)

cboettig avatar Oct 17 '22 14:10 cboettig

@cboettig Rather than deciding not to support it, it may be closer to saying they did not OSS it. The document of gitpod's openvscode-server, which is later than coder's code-server, mentions that. https://github.com/gitpod-io/openvscode-server/#why

Microsoft has recently announced "the" VSCode Server that will run VSCode server on any computer and allow access over https. I have not used it, but I think this is the solution you are looking for. https://code.visualstudio.com/docs/remote/vscode-server However, I have not used this and do not know if it is easy to integrate with devcontainer at this stage.

eitsupi avatar Oct 17 '22 14:10 eitsupi

@eitsupi Cool, I hadn't seen the announcement for VSCode Server!

The Visual Studio Code Server is a service you can run on a remote development machine, like your desktop PC or a virtual machine (VM). It allows you to securely connect to that remote machine from anywhere through a vscode.dev URL, without the requirement of SSH

That does seem like a nice analog to how we already package RStudio Server. Looks like currently it's only available through a sign-up system so I guess we can wait and see if that becomes an open source piece of software we'd be able to package in a public/open docker container recipe or not....

Oh yes, & thanks for the gitpod link, that's exactly what I meant. (obviously they already deploy vscode over https in proprietary systems like GitHub editor and GitHub codespaces).

cboettig avatar Oct 17 '22 14:10 cboettig

hmm... also looks like the license may preclude such use https://code.visualstudio.com/docs/remote/vscode-server#_can-i-host-the-vs-code-server-as-a-service

cboettig avatar Oct 17 '22 14:10 cboettig

Since Microsoft products are intended to work with Microsoft services, we would need to install and use coder/code-server and gitpod-io/openvscode-server on the container in order to use them freely. (As a side note, it appears that RStudio, PBC had an investment in openvscode-server) https://www.gitpod.io/blog/openvscode-server-launch

eitsupi avatar Oct 17 '22 14:10 eitsupi

I think we can close this in favor of https://github.com/rocker-org/devcontainer-features and https://github.com/loft-sh/devpod.

In other words, DevPod seems to be an alternative to GitHub Codespaces in OSS, which is what @cboettig wanted.

eitsupi avatar Sep 03 '23 07:09 eitsupi

agreed!

cboettig avatar Sep 03 '23 20:09 cboettig