Skip to content

Commit

Permalink
Adding dev container and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
samruddhikhandale committed Feb 6, 2023
1 parent 572a12c commit 7cd9ba1
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/devcontainers/python:0-3.10

COPY requirements.txt /tmp/

RUN echo "(*) Installing tools..." \
&& su - vscode -c "pip install -r /tmp/requirements.txt" \
&& apt-get update \
&& apt-get -y install --no-install-recommends graphviz

ENV PATH="/home/vscode/.local/bin:${PATH}"

COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"build": {
"context": ".",
"dockerfile": "Dockerfile"
},

// Uncomment to install NVIDIA CUDA - required for a GPU-powered codespace
// "features": {
// "ghcr.io/devcontainers/features/nvidia-cuda:1": {
// "installCudnn": true
// }
// },

"hostRequirements": {
"storage": "64gb"
},
"runArgs": [
"--shm-size=16g"
]
}
17 changes: 17 additions & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
duckduckgo_search
fastai
fastkaggle
gradio
graphviz
ipywidgets
jupyterlab
kaggle
nbdev
plotly
seaborn
statsmodels
sympy
timm
torch
torchvision
transformers
7 changes: 7 additions & 0 deletions .devcontainer/welcome-message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
👋 Welcome to "Practical Deep Learning for Coders" in Codespaces!

🛠️ Your environment is fully setup with all the required softwares and machine learning libraries.

🚀 To get started, either open the notebook file in the VS Code editor,
or open this Codespace with "Open in Jupyterlab" at https://github.com/codespaces

2 changes: 1 addition & 1 deletion 01-jupyter-notebook-101.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 05-linear-model-and-neural-net-from-scratch.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ This is where you'll find the notebooks, slides, and spreadsheets for the 2022 e
- `xl`: Excel spreadsheets
- `slides`: Jeremy's slide decks
- `tools`: Ignore (tools for creating this repo)
- `getting-started-with-codespaces`: A document to help run the notebooks in a GitHub Codespace
30 changes: 30 additions & 0 deletions getting-started-with-codespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Using Codespaces to work with the "Practical Deep Learning for Coders" course


To get started, create a codespace for this repository by clicking this 👇

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=485606685)

A codespace will open in a web-based version of Visual Studio Code.

**Note**: Dev containers is now an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other supporting tools](https://containers.dev/supporting).

## Opening a notebook

The [dev container](.devcontainer/devcontainer.json) is fully configured with softwares and [machine learning libraries](.devcontainer/requirements.txt) needed for this course.

In the VS Code editor, open any notebook file and start executing the notebook's cells.

## Opening your codespace in JupyterLab

You can open your codespace in JupyterLab from the "Your codespaces" page at [github.com/codespaces](https://github.com/codespaces), or by using [GitHub CLI](https://docs.github.com/en/codespaces/developing-in-codespaces/opening-an-existing-codespace?tool=cli#opening-an-existing-codespace) with `gh codespace jupyter`. For more information, see "[Opening an existing codespace](https://docs.github.com/en/codespaces/developing-in-codespaces/opening-an-existing-codespace)".

## GPU-powered Codespaces

GPU-powered Codespaces are now available in limited beta. Having access to a GPU from within a codespace allows developers to run complex Machine Learning models much more quickly.

To request access to the GPU machine types, or any additional machine type, [please complete the sign up form](https://github.surveymonkey.com/r/Y75GX9T).

Once, GPU is enabled and configured for your codespace, uncomment [this section](.devcontainer/devcontainer.json#L9-L13) which installs NVIDIA CUDA.

**Note**: Notebooks [09-small-models-road-to-the-top-part-2](09-small-models-road-to-the-top-part-2.ipynb) and [10-scaling-up-road-to-the-top-part-3](10-scaling-up-road-to-the-top-part-3.ipynb) requires a powerful machine to ensure that the kernel does not crash. Hence, some notebook cells for these two notebooks might not execute without a GPU-powered codespace.
3 changes: 2 additions & 1 deletion slides/nlp-intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "dc2e32d4",
"metadata": {},
"source": [
"Kaggle limits your weekly time using a GPU machine. The limits are very generous, but you may well still find it's not enough! In that case, you'll want to use your own GPU server, or a cloud server such as Colab, Paperspace Gradient, or SageMaker Studio Lab (all of which have free options). To do so, you'll need to be able to download Kaggle datasets.\n",
"Kaggle limits your weekly time using a GPU machine. The limits are very generous, but you may well still find it's not enough! In that case, you'll want to use your own GPU server, or a cloud server such as GitHub Codespaces, Colab, Paperspace Gradient, or SageMaker Studio Lab (all of which have free options). To do so, you'll need to be able to download Kaggle datasets.\n",
"\n",
"The easiest way to download Kaggle datasets is to use the Kaggle API. You can install this using `pip` by running this in a notebook cell:\n",
"\n",
Expand Down

0 comments on commit 7cd9ba1

Please sign in to comment.