QuantEcon / lecture-datascience.myst

Source repository for QuantEcon Datascience
https://datascience.quantecon.org
26 stars 21 forks source link

Proof of concept devcontainer #13

Open jlperla opened 3 years ago

jlperla commented 3 years ago

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

arnavs commented 3 years ago

Bumping this up the priority list

WenxinM commented 3 years ago

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.

jlperla commented 3 years ago

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.