abhishekkrthakur / colabcode

Run VSCode (codeserver) on Google Colab or Kaggle Notebooks
MIT License
2.06k stars 275 forks source link

Google Colab has started banning colabcode #109

Open ar8372 opened 2 years ago

ar8372 commented 2 years ago

colabcode is really an awesome tool, especially for someone who has very low local compute. But recently after the policy update of Google Colab (https://research.google.com/colaboratory/faq.html) , it has started banning use of tunneling.

colabcode

Now Google Colab gets timeout after 10-15 minutes. Is there any solution to this @abhishekkrthakur ? any other alternative library,

thanks.

JapinderSandhu commented 2 years ago

This is really unfortunate. Why would they do this? I think the same thing is happening with Kaggle now. Very sad. Ive been using this for so long I actually don't know what to do now. I cant import my code into cells this is so terrible. Importing files into Kaggle is a nightmare.

kuro7766 commented 2 years ago

This is really unfortunate. Why would they do this? I think the same thing is happening with Kaggle now. Very sad. Ive been using this for so long I actually don't know what to do now. I cant import my code into cells this is so terrible. Importing files into Kaggle is a nightmare.

Yes , kaggle editor is terrible. Is there any other ways to connect to kaggle jupyter server remotely?

JapinderSandhu commented 2 years ago

I dont know, I tried looking into this method briefly.

https://towardsdatascience.com/how-to-kaggle-the-engineer-way-act-1-vs-code-containers-b3279970c029

https://code.visualstudio.com/docs/remote/containers

I dont know a lot about containers so im going to have to try and learn this method.

I definitely want to avoid using kaggle cells. Kaggle cells are an absurd way to code.

ar8372 commented 2 years ago

Hi @kuro7766 , @JapinderSandhu , I found a workaround for this, not the best but the closest I could get to vs code like env on google-Colab. First mount the drive where your code is available and then run below code. [Make sure you disable the add blocker if you are using brave]

!pip install colab-xterm
%load_ext colabxterm
%xterm

It will open a terminal for you. You can edit all your .py files or any other file by just double clicking on it and a tab will open for it. terminal

Another option is using GitHub Codespaces . GitHub provides with vs code env to write your code on fly. To open a project in vs-code just open the project on GitHub and press . key on your keyboard.

JapinderSandhu commented 2 years ago

@ar8372 thanks for the response. I see that colab-xterm however this does not work with Kaggle. I will have to swtich to google colab then which is still better than nothing.

Thank you so much for this help ! I had some issues installing anaconda on the google colab env but I figured it out. Hoping for smooth sailing from here.

I dont understand why Kaggle and Google Colab are doing this and banning ngrok tunnels. It is a way more effective method of programming with VS CODE and actual files, rather than coding in cells.

Dont know why they are making our lives harder.

JapinderSandhu commented 2 years ago

@ar8372 This is really terrible, the runtime on google colab disconnects randomly after 45 minutes. Google colab seems very unreliable compared to kaggle.

this is not good

JapinderSandhu commented 2 years ago

colabcode is really an awesome tool, especially for someone who has very low local compute. But recently after the policy update of Google Colab (https://research.google.com/colaboratory/faq.html) , it has started banning use of tunneling.

colabcode

Now Google Colab gets timeout after 10-15 minutes. Is there any solution to this @abhishekkrthakur ? any other alternative library,

thanks.

UPDATE: S After some digging and guidance this stackoverflow : https://stackoverflow.com/questions/48350226/methods-for-using-git-with-google-colab

showed me a better method of using github and cloning my repository in the kaggle runtime using the !git clone command. I was unaware you could clone a github repository and run a python file in this method. I was even able to create an anaconda environment and run everything smoothly. So everything is running smoothly again :D <3 <3 :D

nickchomey commented 2 years ago

The method shared in this article seems to work quite well for creating a publicly accessible FastAPI endpoint from Colab. I'm only doing it for very brief periods to test the endpoints, so don't anticipate any issues from Colab with it...

https://medium.datadriveninvestor.com/flask-on-colab-825d2099d9d8

Similar info here:

https://stackoverflow.com/questions/63833593/how-to-run-fastapi-uvicorn-in-google-colab