I'm a data scientist / machine learning engineer.
abhishekkrthakur / colabcode Goto Github PK
View Code? Open in Web Editor NEWRun VSCode (codeserver) on Google Colab or Kaggle Notebooks
License: MIT License
Run VSCode (codeserver) on Google Colab or Kaggle Notebooks
License: MIT License
Too Many Connections
Too many connections! The tunnel session 'ts_1uRbFxBjU6WBQdMADOpMnFpA5mZ' has violated the rate-limit policy of 20 connections per minute by initiating 31 connections in the last 60 seconds. Please decrease your inbound connection volume or upgrade to a paid plan for additional capacity.
The error encountered was: ERR_NGROK_702
When the option to mount the drive is specified;
ColabCode(port=10000, password="pass", authtoken="[ngroktoken]", mount_drive=True)
... it will only start as:
Code Server can be accessed on: NgrokTunnel: "https://[tunnelid[.ngrok.io" -> "http://localhost:10000"
... and just hang. Any idea?
Hi,
I tried running ColabCode(port=1000)
then it works fine and am able to open code server.
But, i also want to open Jupyter lab along with code server. So, i looked at the code and Found default lab=False
So, when i tried running ColabCode(port=10000, lab=True)
then code-server won't open and Jupyter lab also not opening.
Can you suggest any way?
Thanks
I was working on a kaggle competition and after sometime the code server stops and all the files created were gone.
Is there any way to save the files in the present working directory ?
Ngrok can be slow, ideally it's better to use it with the region
parameter.
As far as I know, I think there's a way on google colab to serve the code server on a URL (HTTPS). This URL is generate by google colab. This might has a huge impact on performance.
Would you like me to look into it and create a pull request if it's possible ?
I just found this issue when connect codeserver using google colab. Anybody have solution for this ? thank you
I think ngrok is too limited. I tried installing an extension, some error shown in the bottom left corner, and then error from ngrok. "No concurrent connection more than 20" or something like that.
Telebit.cloud is better for port forwarding. But I think it'll take much time to install and difficult to implement.
Tried running on AWS Notebook instance
Failed with the following error
Is something different with Sagemaker session, apart from google colab or kaggle?
<ipython-input-16-e0886fae08fe> in <module>
3
4 # run colabcode with by deafult options.
----> 5 ColabCode(password='1234')
~/anaconda3/envs/python3/lib/python3.6/site-packages/colabcode/code.py in __init__(self, port, password, authtoken, mount_drive)
21 self._mount = mount_drive
22 self._install_code()
---> 23 self._install_extensions()
24 self._start_server()
25 self._run_code()
~/anaconda3/envs/python3/lib/python3.6/site-packages/colabcode/code.py in _install_extensions(self)
33 def _install_extensions(self):
34 for ext in EXTENSIONS:
---> 35 subprocess.run(["code-server", "--install-extension", f"{ext}"])
36
37 def _start_server(self):
~/anaconda3/envs/python3/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
421 kwargs['stdin'] = PIPE
422
--> 423 with Popen(*popenargs, **kwargs) as process:
424 try:
425 stdout, stderr = process.communicate(input, timeout=timeout)
~/anaconda3/envs/python3/lib/python3.6/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
727 c2pread, c2pwrite,
728 errread, errwrite,
--> 729 restore_signals, start_new_session)
730 except:
731 # Cleanup if the child failed starting.
~/anaconda3/envs/python3/lib/python3.6/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1362 if errno_num == errno.ENOENT:
1363 err_msg += ': ' + repr(err_filename)
-> 1364 raise child_exception_type(errno_num, err_msg, err_filename)
1365 raise child_exception_type(err_msg)
1366
FileNotFoundError: [Errno 2] No such file or directory: 'code-server': 'code-server'```
We know that colab instance can mostly be in these regions "AMS / SEA / LAX / TPE" and ngrok support us, ap, jp, eu regions. If we use cloudflare access, with anycast, we can connect to the nearest tunnel.
I have an account in ngrok and I am also signed in ngrok website and as well as in the google colab. but after entering the authentication token a link by ngrok for the vs code server showed up, but after clicking it, its taking for ever for loading. I have a good internet connection but still this thing is happening.
And if anybody can help me with saving the installed extensions by me, every time I run the server for vs code. Then it would be very helpful.
Thank you
Hi,
I am encountering the following error when I try to run colabcode
`
Too many connections! The tunnel session 'ts_1haqep9AXrK0M55zyQFF0HgWbVH' has violated the rate-limit policy of 20 connections per minute by initiating 36 connections in the last 60 seconds. Please decrease your inbound connection volume or upgrade to a paid plan for additional capacity.
The error encountered was: ERR_NGROK_702
`
Kindly suggest how to resolve it.
Hi @abhishekkrthakur
Learned this trick of running VSCODE in colab, from your LinkedIN post, great stuff.
I have a question, is there a way to run vscode in standard Juypter Notebook (non Colab ?). In our company we have hosted Juypter service, where we as data scientist can span juypter. I wanted to run VSCODE from those juypter notebooks.
So wanted to ask if this tool will also work on Juypter Notebooks.
open existing notebook in google drive is not working..
any suggestion?
Please add support for secure ngrok tunnels using https
instead of http
I am using ColabCode from the last 3, 4 months and I have never encountered the problem with colab disconnecting while I was writing code. Recently, Colab is getting disconnecting within an hour after I run colabcode even when I am writing the code. Can anyone help me with this.
I am using Colab Pro.
I have been having many problems with this extension
when i try to set the interpreter via the Command Palette I get -
"Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found)"
I can execute the python code in the terminal and the python extension looks like it's installed but I can't get it to work. I've tried installing older versions of python after finding some others with the same issue but this didn't resolve the issue either.
Anyone else with this issue or with a workaround?
Hello,
I have a new problem I have not encountered before with Colabcode and I hope to find help here. I am running
from google.colab import drive
drive.mount('/content/drive')
!pip install colabcode
from colabcode import ColabCode
ColabCode(port=10000)
in Colab and usually was able to access the Colab VSCode environment with an Ngrok tunnel there (2 weeks ago), however since yesterday it shows a blank screen. The output of the Colab cell is the same as before. Only difference is I get prompted to restart the runtime after which the output is the same as before when it ran smoothly.
Colabcode 0.2.0 was used but same problem persists with colabcode 0.1.0
Code Server can be accessed on: NgrokTunnel: "http://(id).ngrok.io" -> "http://localhost:10000"
[2021-02-04T09:28:44.663Z] info code-server 3.7.4 (id)
[2021-02-04T09:28:44.664Z] info Using user-data-dir ~/.local/share/code-server
[2021-02-04T09:28:44.673Z] info Using config file ~/.config/code-server/config.yaml
[2021-02-04T09:28:44.673Z] info HTTP server listening on http://127.0.0.1:10000
[2021-02-04T09:28:44.673Z] info - Authentication is disabled
[2021-02-04T09:28:44.673Z] info - Not serving HTTPS
Does anyone have any idea what the problem could be? Would appreciate any help, many thanks
I have been using this regularly since yesterday it says the password is wrong every time.
(using the password I set in colabcode initialization)
I'm using amazing ColabCode by Abhishek Thakur. It uses ngrok as backbone. But when I try to debug Python script (via F5 button), it doesn't launch any debug action even when I set a breakpoint. Script runs in terminal only. launch.json is empty. When I fill it with next:
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
I've got next error:
Couldn't find a debug adapter descriptor for debug type 'python' (extension might have failed to activate)
How can I debug Python script on ngrok code-server?
I can use terminal in vscode-server to run my python file ,but I wanna try to debug my py file ,it failed.
did anyone succeed to debug on vscode-server?
Hi, Abhishek, Thanks for the great module. I am wondering if there is any way to resolve this challenge.
python code auto fill not working
Having a black / drak background is useful
error vscode [UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character
error vscode Error: [UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character
at /usr/lib/code-server/lib/vscode/out/vs/server/entry.js:124:875
at new u (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:125:166)
at new d (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:126:773)
at Function.from (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:126:213)
at n (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:546:1003)
at t.Vscode.initialize (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:547:174)
at async process. (/usr/lib/code-server/lib/vscode/out/vs/server/entry.js:553:517)
[2021-04-09T19:50:18.382Z] error VS Code exited unexpectedly with code 1
First of all, this library is simply amazing.
Lately, I've been facing an issue where the when I try to use VScode on GoogleColab using colabcode
, it disconnects and the connection is terminated on GoogleColab.
Here is the screenshot of the error:
Any resolution on this issue will be higly appreciated.
ipynb file is opened in text editor by default and re-openning the notebook with Jupyter seems to take forever
Hi, great tool, would it be possible to connect also some other local/remote IDE like PyCharm?
If so, could we add it also to the readme... ๐ฐ
Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found)
versions:
This could also be an issue of the code server 3.7.1 there have been lots of issues on it.
so maybe being able to specify the code server version could be a solution...?
This is an issue that my friend faced. So basically, if you run a ColabCode instance, and you get a blank terminal in VSCode,
Solution: Go to File -> Preferences -> Setting -> Features -> Terminal -> Split Cwd and change it to 'initial' and your terminal should work now.
Hi, @abhishekkrthakur, @ahtyamovdanil, @Skander-hadjromdhan !
First of all thanks for your package, I found it very useful!
Unfortunately, I have some problems with cloning GitHub repositories.
I tried to clone repo in VSCode via official instructions and then VSCode asked me to authorise in my account by this message
After clicking Continue
I faced with this:
I already tried do SAME steps of authorising in my desktop VSCode and it was successful.
Is it possible to work with git via your package? Maybe I've done something wrong...
Thank you
P.S.
I followed all instructions in Abhishek's video
I don't know why, but the ngrok not showing the codeserver. It said "Tunnel 7d647a92dxxx.ngrok.io not found". But it still work at kaggle notebook.
Started colabcode from the colab_starter.ipynb notebook.
I ran this code on the vscode session in browser:
from tensorflow.python.client import device_lib
import os
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
print(get_available_gpus())
and got this output:
2020-09-22 06:04:37.823495: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2020-09-22 06:04:38.942761: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2249995000 Hz
2020-09-22 06:04:38.943092: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x22f8a00 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-09-22 06:04:38.943117: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-09-22 06:04:38.944475: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1
2020-09-22 06:04:38.947013: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2020-09-22 06:04:38.947042: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (6018e5e49baf): /proc/driver/nvidia/version does not exist
Hi Abhishek,
I hope you are fine. I don't know if you are aware of, or if it's just a bug for me, but when a add GPU acceleration to Kaggle or Colab notebooks it no longer works. I think google restricted their use but am not sure.
Are you aware of that it's not possible to have a GPU ?
Do you know a workaround to still use GPU ?
It's so convenient to use vs-code. Thank you in advance.
I have never used ngrok before, after I followed the tutorial on youtube, clicking on the link did not work. It asked for the password and after that all I could see is a blank page. Is ngrok installed in colab machine by default? What is the solution? I also tried to create an account on ngrok, but that also did not help
I tried to run Docker on Colabcode terminal but It showed error "cannot connect to the docker daemon at unix:/var/run/docker.sock. is the docker daemon running colab" ? It seems like we can not run Docker on Google Colab , am I right ? Thank you very much
ngrok http -region=jp -hostname= myhostname 80
I opened colabcode JupyterLab with
import colabcode as cc
cc.ColabCode(port = 10000, lab = True , authtoken=authtoken, mount_drive=True)
and run the code below.
from jupyter_dash import JupyterDash
import dash_html_components as html
app = JupyterDash(__name__)
app.layout = html.Div('Minimal')
app.run_server(mode='external')
It does show the sentence Dash app running on:
followed by nothing without any error.
I run the same code on the JupyterLab with a local venv and it works.
Is there any way to solve this?
Can't manually select the Python Interpreter as well
Too Many Connections
Too many connections! The tunnel session 'ts_1hlqlpmaWrbJN1bOTucLT1dsx2M' has violated the rate-limit policy of 20 connections per minute by initiating 26 connections in the last 60 seconds. Please decrease your inbound connection volume or upgrade to a paid plan for additional capacity.
The error encountered was: ERR_NGROK_702
What does this even mean?
I tried using code server as always. Throws unprecedented error.
Hi,
Recently whenever i have tried to use and Run the Collab ... then i go to *.ngrok.io site... It does not show any thing after login page.... I've tried in multiple browsers...
Can anyone check ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.