Hacker News new | past | comments | ask | show | jobs | submit login
VSCode on Google Colab (amitness.com)
197 points by amitness on Oct 7, 2020 | hide | past | favorite | 51 comments



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.


> 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.


Yep. And Google Colab is a Trojan horse. Give away free GPUs for a few years to choke out any competition, guaranteed they start charging for them once they’ve done that.


I like seeing arguments like these and then I go and see people do stuff like this where people get Debian running on Kindles:

https://github.com/kathamer/DebianKindle

Whenever there is locked down hardware, invariably there is always someone trying to hack it.



> 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.


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."


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.


> 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.


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

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


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


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.


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.


Why would this one specific library be banned from colab?


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/


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.


> 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.


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.


Yeah, I am sure the workplace will be perverted first.


wat

If you don't like it, don't use it. No one is forcing you.


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.


> 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. :)


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


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.


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.


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


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


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.


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


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


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


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.


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


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


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.


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


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

Great.


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


On colab you get free gpus.


Good point, i was about to suggest google shell ass but colab is more resourcefull


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!


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


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


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.


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.


Cool. I wasn't aware of this use case. Thanks.


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.


Mmm, JetBrain PyCharm/CLion?


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).


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: