Settings

Theme

VSCode on Google Colab

amitness.com

197 points by amitness · 52 comments

Reader

15 threads
shp0ngle

Note that this is not "actual" VSCode, but its fork code-server, that takes VSCode and modifies it to run in a browser.

https://github.com/cdr/code-server

This package just installs code-server on Google Colab, whatever that is.

Hosted VSCode instances that Microsoft has on Azure and in beta on GitHub are a different thing and are not open source.

  • echelon

    > Hosted VSCode instances that Microsoft has on Azure and in beta on GitHub are a different thing and are not open source.

    I can see it now: one day all of our engineering work will happen exclusively in the cloud and we'll all be using thin clients.

    Just like smart phones, the typical desktop or laptop will become a dumb device. A Chromebook, but worse.

    Subscribe to your tools, for the low monthly cost of only... And wait, there's more. You can upgrade your storage and execution time package.

    Augh.

  • craftinator

    > This package just installs code-server on Google Colab, whatever that is.

    I laughed way too hard at this, because I have thoughts like this bounce around my head nearly every time I read about a Google product. It reminds me of Microsoft circa ~2006, when they were doing all kinds of wacky and ill-defined projects that turned into pure bloatware.

    • sigwinch28

      I have just started using Google Apps as an employee which uses it for everything

      Me: "oooh! Google Currents! That sounds cool. Is it some workflow designer tool?"

      Me: "oh, it's Google Plus."

    • shp0ngle

      It sounded more disparaging than I meant it

      I just have no idea what is Google Colab, I don't do Python/TensorFlow/jupyter, I don't know what "notebook" means in this context.

  • mbreese

    > code-server, that takes VSCode and modifies it to run in a browser

    Not only that, but it's also only the open-source parts of VSCode. Notably, you don't get access to the same extensions marketplace. Code-server does link to many open-source extensions, but certain things (e.g. Intellisense) aren't available.

tmabraham

This uses Abhishek Thakur's great package on GitHub here: https://github.com/abhishekkrthakur/colabcode

Video example by Abhishek: https://youtu.be/7kTbM3D02jU

  • abhisvnit

    The video tutorial and eventually the package was inspired by the blog post and the tweet. :) (also mentioned in the video)

square_usual

That's interesting, but do the Google Colab Terms of Service allow this? The article goes into how, but not if you're allowed to. Until you're certain it is allowed, I would suggest not using it. You don't want to be locked out of your (at best) colab or (at worst) Google account because you wanted a fancy IDE.

  • nexuist

    I think in general you can run arbitrary code on Colab. That's the entire point. Your CPU and RAM usage are monitored and rate limited; you have to pay $$$ for more powerful specs and at that point if you're paying them I doubt they care what you're doing with what you paid for.

  • srtjstjsj

    Why would this one specific library be banned from colab?

syntaxing

If everyone is uncomfortable with using an "online IDE", you can accomplish the same thing with ngrok + vscode remote ssh [1].

[1] https://imadelhanafi.com/posts/google_colal_server/

qmmmur

Gave it a try. Font's rendered incorrectly and were unusable which is an obvious deal breaker when you're trying to Code in a seriffed fallback. It was really slow which is my entire experience of all Jupyter/Collab notebook style approaches to coding. I really don't see what anyone else sees in this. If you want to collaborate with people just learn some tried and tested tools that are open and work.

johnisgood

> modifies it to run in a browser.

The future is truly horrifying. I do not want to run my text editor in my browser. Soon our text editors will be hosted by Google or something, and we will edit files with them online. Ugh. Imagine requiring Internet connection and a browser just to edit a file on your computer! I know I am exaggerating a bit, but jeez, this direction sucks.

  • wffurr

    Too late? That's essentially what Vscode, the most popular text editor for programmers, does.

    Nothing stopping you from continuing to use vim, emacs, sublime, etc though.

  • wvenable

    Browsers don't have access to local files so this isn't about editing a file on your computer.

    VS Code runs on electron so it is already an editor running in a browser locally without an Internet connection required.

    • johnisgood

      > Browsers don't have access to local files

      What do you mean by that? Mine does. Although I firejail it.

      > VS Code runs on electron so it is already an editor running in a browser

      I am sure we can push it further than that. :)

      • wvenable

        Web applications don't have access to local files -- at least not in the open/edit/save editor scenario.

        • johnisgood

          I am not up to date with it, to be honest. I know there is a WebUSB API and whatnot. Having access to files might not be that far-fetched.

          • wvenable

            I have a robot who's firmware can be updated via bluetooth from a web application running in Chrome -- so I get your point. Oddly enough, arbitrary access to files are still off limits.

  • ericcumbee

    Try playing solitaire on windows 10 with out a internet connection.

amrrs

If you don't want to use any package, it's just a few lines of code that you can run at the top of your Colab - https://youtu.be/ATif5s5peHU

quyleanh

Cool. Another online IDE for developer.

I used theia-ide of openshift.io. It's good as well but sometimes the browser tab was freeze and I had to reload. A bit annoy. An other choice is Google Cloudshell.

  • Mo3

    Not just another IDE, my friend. VS Code is truly fantastic.

    • dspillett

      As there are already other projects using vscode to produce an online IDE, I think "just another" is quite fair.

      • pjmlp

        Ironically given that VSCode was born as online IDE to start with.

        • dspillett

          Certainly the base editor did, but was it crossed over the (vague and subjectively defined) line between an advanced text editor to a full IDE by the point MS forked/integrated it for VS Code? My history is hazy here.

          • pjmlp

            Monaco was not not the basis for VSCode, still exists as basis for Github codespaces and Azure based devenvs.

brutuscat

I wonder how this is different from Eclipse Che? http://www.eclipse.org/che/

ctl0

Brilliant but it seems to me every colab hack requires ngrok or something similar to relay the traffic, which it's sadly just too slow.

zb1plus

Super cool but I'm curious if anybody has figured out how to use the VSCode Juypter notebook integration with Google Colab?

bugmen0t

> Now, we will start the VSCode server in the background at port 9000 without any authentication using the following command.

Great.

xrisk

Why not just use a service like repl.it? Is it just so you can use VSCode?

  • elcomet

    On colab you get free gpus.

  • busymichael

    I have just started playing with repl.it and am enjoying it. repl.it is using a similar IDE to the VSCode fork from the OP.

    I am trying to build a small web app using repl.it as my dev environment and deploy on google app engine. The stack is flask/mysql/html5/bootstrap.

    I have a workflow where I can commit to a dev branch inside repl.it, push to github and them merge to master. If merge is no-conflict, it uses github actions to deploy to google app engine.

    There are trade offs, but I am really enjoying the ability to just start coding by opening a browser and having my full dev environment in a tab. Really fun!

  • leetrout

    repl.it has always been slow for me for anything beyond a single file with a handful of changes.

neves

Is there similar options to run it in a Zeppelin Notebook?

babuskov

I'm curious. I know it's great for one-offs, but is anyone actually using VSCode as their main tool when so many native IDEs and text editors are available?

I would love to know what's your use case. Maybe I'm missing something big.

  • nexuist

    I use it for every project. I mainly code node.js and sometimes Python.

    Speed has never been an issue for me; VSCode boots up in under a second and easily chews through thousands of lines of code (albeit without tokenization).

    The new SSH connection mode has been a lifesaver for me - you can now sync VSCode with a server you have SSH access to, meaning you can browse/open/save files remotely, and open as many terminals as you want on the target server. This makes it super easy to e.g. test code on different hardware or view logs or edit config files and such.

  • livre

    I'm using it as my main editor for a Django codebase. It's not my favorite IDE, it's a bit slow too but it's the best I could find for what I do. Also I haven't found any good native IDE that can handle Python, Django, HTML, CSS and JS as well as VSCode. There are IDEs that can do Python (and Django) and others for HTML, CSS and JS but I don't want to be constantly switching between the two. If you know a good IDE that can replace VSCode for my use case please let me know.

    • egberts1

      Mmm, JetBrain PyCharm/CLion?

      • livre

        I've tried JetBrains for Android dev and it's the best IDE I've used so far but it suffers from the same slowness issues as VSCode and has longer startup times. I should give it a try for Python/web dev, it may be a good replacement for VSCode for long sessions (I'll still be using VSCode for shorter ones because it starts quickly).

  • ralphc

    Couple of years ago Salesforce switched from Eclipse plug-ins for development and went all in on VSCode. They have a set of plug-ins that log in to Salesforce and send configurations and code back and forth. They're even going to use "VSCode in the browser" to edit code in place in your organization.

  • tracker1

    Absolutely... directory tree view and integrated terminal are the two big killer features for me... everything else is just extra awesomeness. Support for JS projects is pretty much best in class (Though jetbrains/webstorm is decent too).

    Support for other languages like go, rust, C# (.Net Core) are pretty decent. The extensions/marketplace is incredible in terms of the breadth and depth of support for almost anything you can think of. I even have an enviornment setup with a settings file defaulting to CP437, where I use SSH remote extension in code to configure a remote telnet BBS.

    Beyond all of this, it's relatively quick to load and run, though there are faster editors, I haven't seen a (much) faster IDE really.

    The remote ssh extension is probably the third killer feature for me. I've gotten a lot of mileage out of those three things alone. I don't use some of the other features nearly as much as I rely on the console a lot, and the integrated terminal just makes it in the box as an experience.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection