lecture-datascience.myst icon indicating copy to clipboard operation
lecture-datascience.myst copied to clipboard

Proof of concept devcontainer

Open jlperla opened this issue 4 years ago • 3 comments
trafficstars

@WenxinM @aadsouza Anything that @arnavs givesa you takes precendence, but on downtime we should see what it would take to get a .devcontainer working for this sort of thing, along with the appropriate vscode extensions. In particular, the python and juptyer extensions.

For this, I think the best way to do it is to create a test one in your own githubs, put in a .py file and a .ipynb notebook, etc. from a couple of the of https://github.com/QuantEcon/quantecon-notebooks-datascience And you will need some sort of environment.yml or requirements.txt file for dependencies at some point.

Then, install the remote containers extension in vscode, and use the Add Deveopment COntainer Configuration Files in https://code.visualstudio.com/docs/remote/create-dev-container#_automate-dev-container-creation to try out a "python" one. But it won't have jupyter installed. For that, you can install a conda specific one instad. See https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3-anaconda

If that anaonda one works, you can also install the vscode jupyter extension in https://github.com/microsoft/vscode-dev-containers/blob/master/containers/python-3-anaconda/.devcontainer/devcontainer.json#L26-L29 etc. when you modify it.

The idea would be that the new version of this notebook repository would have those extra folders in them, which would enable Github codespaces and vscode remote containers/etc. But if you get things working with a devcontainer for remote use in vscode, it will probably also work in the github codespaces. There aren't a lot of specific customizations required: https://code.visualstudio.com/docs/remote/codespaces

You can look into the docs for this sort of thing (e.g. https://code.visualstudio.com/docs/remote/create-dev-container) but I think that copying a preexisting one with conda setup is a better bet.

jlperla avatar Jan 15 '21 22:01 jlperla

Bumping this up the priority list

arnavs avatar Apr 08 '21 22:04 arnavs

Windows OS: the internal links do not work in the Jupyter Notebooks when being launched in vs code. This seems to be an unresolved issue: https://github.com/microsoft/vscode-jupyter/issues/1330. External links work though. Also, to successfully launch Jupyter Notebook, we need to change the setting and trust all notebooks.

WenxinM avatar Apr 13 '21 20:04 WenxinM

That is fine. The jupyter support is a littl ebuggy, so we just need to have the placeholders in there and see how it goes. Also, I think there is a chance that people would want to launch proper jupyter lab in the devctonainer or edit the .py files directly.

jlperla avatar Apr 13 '21 20:04 jlperla