Skip to content

Commit 50fd438

Browse files
committed
Add devcontainer configuration.
1 parent abff8f5 commit 50fd438

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG VARIANT=2
2+
FROM mcr.microsoft.com/devcontainers/universal:${VARIANT}
3+
4+
# Create the conda environment
5+
COPY environment.yml /tmp/conda-tmp/
6+
RUN conda env create --file /tmp/conda-tmp/environment.yml --quiet

.devcontainer/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Welcome to the devcontainer for Introduction to Data Analysis Using Python!
2+
3+
**IMPORTANT**: Open this file using the preview option to render the images (right-click the file in the left sidebar, and click **Open Preview**).
4+
5+
---
6+
7+
You will be running through the workshop in [Visual Studio Code](https://code.visualstudio.com/) using the Jupyter extension to interact with Jupyter Notebooks. Each time you open a new Jupyter Notebook, you will need to select the kernel (specify the virtual environment to use).
8+
9+
Start by opening up the [`notebooks/0-check_your_env.ipynb`](../notebooks/0-check_your_env.ipynb) notebook and clicking the **Select Kernel** button at the top right:
10+
11+
<img width="1000px" src="../media/devcontainer-select-kernel.png" alt="selecting a kernel">
12+
13+
Select the **Python Environments...** option:
14+
15+
<img width="600px" src="../media/devcontainer-python-environments-select.png" alt="initial options in select kernel menu">
16+
17+
Select the **pandas_workshop** option:
18+
19+
<img width="600px" src="../media/devcontainer-conda-env-select.png" alt="selecting a virtual environment">
20+
21+
Use `pandas_workshop` for all subsequent notebooks. Note that you can close the bottom panel (**TERMINAL**) for more space.

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "Pandas Workshop",
3+
4+
"build": {
5+
"context": "..",
6+
"dockerfile": "Dockerfile"
7+
},
8+
9+
"hostRequirements": {
10+
"cpus": 4,
11+
"memory": "8gb",
12+
"storage": "32gb"
13+
},
14+
15+
// Configure tool-specific properties.
16+
"customizations": {
17+
18+
// Configure how codespaces will open
19+
"codespaces": {
20+
"openFiles": [
21+
".devcontainer/README.md"
22+
]
23+
},
24+
25+
// Configure properties specific to VS Code.
26+
"vscode": {
27+
// Set *default* container specific settings.json values on container create.
28+
"settings": {
29+
"python.defaultInterpreterPath": "/home/vscode/.conda/envs/pandas_workshop"
30+
},
31+
32+
// Add the IDs of extensions you want installed when the container is created.
33+
"extensions": [
34+
"ms-python.python",
35+
"ms-toolsai.jupyter"
36+
]
37+
}
38+
}
39+
40+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
41+
// "forwardPorts": [],
42+
43+
// Use 'postCreateCommand' to run commands after the container is created.
44+
// "postCreateCommand": ""
45+
}
Loading

0 commit comments

Comments
 (0)