Skip to content

Commit 45ded54

Browse files
authored
Merge pull request #18 from ttngu207/master
Introducing devcontainer and Github Codespace as the primary method to run the interactive tutorial
2 parents a760205 + 6ad17d9 commit 45ded54

23 files changed

+413
-2597
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.7-bullseye
2+
3+
RUN \
4+
apt update && \
5+
apt-get install bash-completion graphviz default-mysql-client -y && \
6+
pip install flake8 black faker ipykernel
7+
8+
ENV DJ_HOST fakeservices.datajoint.io
9+
ENV DJ_USER root
10+
ENV DJ_PASS simple

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// For format details, see https://aka.ms/devcontainer.json.
2+
{
3+
"name": "DataJoint Tutorial",
4+
"dockerComposeFile": "docker-compose.yaml",
5+
"service": "app",
6+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7+
// Use this environment variable if you need to bind mount your local source code into a new container.
8+
"remoteEnv": {
9+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
10+
},
11+
// https://containers.dev/features
12+
"features": {
13+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
14+
"ghcr.io/devcontainers/features/git:1": {},
15+
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {},
16+
"ghcr.io/guiyomh/features/vim:0": {}
17+
},
18+
"onCreateCommand": "pip install -e .",
19+
"postStartCommand": "MYSQL_VER=8.0 docker compose down && MYSQL_VER=8.0 docker compose up --build --wait",
20+
"hostRequirements": {
21+
"cpus": 2,
22+
"memory": "4gb"
23+
},
24+
"forwardPorts": [
25+
3306
26+
],
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"ms-python.python"
31+
]
32+
}
33+
}
34+
}

.devcontainer/docker-compose.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3"
2+
services:
3+
app:
4+
build: .
5+
extra_hosts:
6+
- fakeservices.datajoint.io:127.0.0.1
7+
volumes:
8+
- ../..:/workspaces:cached
9+
entrypoint: /usr/local/share/docker-init.sh
10+
command: tail -f /dev/null

.gitignore

Lines changed: 129 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,131 @@
1-
# OSX and python intermediate files
1+
# Byte-compiled / optimized / DLL files
22
__pycache__/
3-
.DS_Store
4-
~*
5-
*~
6-
*.pyc
7-
.ipynb_checkpoints/
8-
debug.log
9-
10-
# DataJoint and setup files
11-
dj_local_con*.json
12-
julia/setup.jl
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
1326
.idea/
14-
temp*
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
/tests/user_data
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
scratchpaper.*
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# dotenv
85+
docker/standard_worker/.env
86+
87+
# virtualenv
88+
.venv
89+
venv/
90+
ENV/
91+
92+
# Spyder project settings
93+
.spyderproject
94+
.spyproject
95+
96+
# Rope project settings
97+
.ropeproject
98+
99+
# mkdocs documentation
100+
/site
101+
102+
# mypy
103+
.mypy_cache/
104+
105+
# datajoint
106+
dj_local_conf.json
107+
dj_local_conf_old.json
108+
109+
# emacs
110+
**/*~
111+
**/#*#
112+
**/.#*
113+
docker-compose.yml
114+
Diagram.ipynb
115+
116+
# docker
117+
docker/standard_worker/.env
118+
119+
# vscode
120+
.vscode/settings.json
121+
122+
# ssh
123+
*.ssh
124+
*.pem
125+
126+
# github actions
127+
.github/.test/*
128+
!.github/.test/README.md
129+
130+
# Mac
131+
.DS_Store

00-Getting_started/00-Getting started.ipynb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,15 @@
105105
]
106106
},
107107
{
108+
"attachments": {},
108109
"cell_type": "markdown",
109110
"metadata": {},
110111
"source": [
111-
"For this workshop, some of the configuration values are pre-filled (e.g. `database.host` already points to the workshop database). Let's complete the configuration by specifying the username and password.\n",
112+
"For this workshop, some of the configuration values are pre-filled (e.g. `database.host` already points to the workshop database or the local database if you are using Github Codespace). Let's complete the configuration by specifying the username and password.\n",
112113
"\n",
113-
"Go ahead and enter the username and password of your [datajoint.io](https://datajoint.io) account below."
114+
"Go ahead and enter the username and password of your [datajoint.io](https://datajoint.io) account below.\n",
115+
"\n",
116+
"***NOTE***: If you are running this tutorial with GitHub Codespace, you can skip this credentials setting step, as they are already preconfigured correctly for you."
114117
]
115118
},
116119
{
@@ -347,7 +350,12 @@
347350
"name": "python",
348351
"nbconvert_exporter": "python",
349352
"pygments_lexer": "ipython3",
350-
"version": "3.7.3"
353+
"version": "3.7.16"
354+
},
355+
"vscode": {
356+
"interpreter": {
357+
"hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1"
358+
}
351359
}
352360
},
353361
"nbformat": 4,

0 commit comments

Comments
 (0)