Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added DATA605/Spring2025/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Tutorial Template: Two Docker Approaches

- This directory provides two versions of the same tutorial setup to help you
work with Jupyter notebooks and Python scripts inside Docker environments

- Both versions run the same code but use different Docker approaches, with
different level of complexity and maintainability

## 1. `data605_style` (Simple Docker Environment)

- This version is modeled after the setup used in DATA605 tutorials
- This template provides a ready-to-run environment, including scripts to build,
run, and clean the Docker container.

- For your specific project, you should:
- Modify the Dockerfile to add project-specific dependencies
- Update bash/scripts accordingly
- Expose additional ports if your project requires them

## 2. `causify_style` (Causify AI dev-system)

- This setup reflects the approach commonly used in Causify AI dev-system
- **Recommended** for students familiar with Docker or those wishing to explore a
production-like setup
- Pros
- Docker layer written in Python to make it easy to extend and test
- Less redundant since code is factored out
- Used for real-world development, production workflows
- Used for all internships, RA / TA, full-time at UMD DATA605 / MSML610 /
Causify
- Cons
- It is more complex to use and configure
- More dependencies from the
- For thin environment setup instructions, refer to:
[How to Set Up Development on Laptop](https://github.com/causify-ai/helpers/blob/master/docs/onboarding/intern.set_up_development_on_laptop.how_to_guide.md)

## Reference Tutorials

- The `tutorial_github` example has been implemented in both environments for you
to refer to:
- `tutorial_github_data605_style` uses the simpler DATA605 approach
- `tutorial_github_causify_style` uses the more complex Causify approach

- Choose the approach that best fits your comfort level and project needs. Both
are valid depending on your use case.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update
RUN apt-get -y upgrade

# Install system utilities.
RUN apt install -y --no-install-recommends \
sudo \
curl \
systemctl \
gnupg \
git \
vim

# Install Python.
RUN apt install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev

RUN python3 -m pip install --upgrade pip

# Install Python packages.
# There is a bug:
# File "/opt/homebrew/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
# assert 0 < size <= self._size
# for tornado==6.2 and jupyter-client==8.0.2.
# https://discourse.jupyter.org/t/jupyter-notebook-zmq-message-arrived-on-closed-channel-error/17869/10
RUN pip3 install \
ipython \
tornado==6.1 \
jupyter-client==7.3.2 \
jupyter-contrib-core \
jupyter-contrib-nbextensions \
psycopg2-binary \
yapf

RUN mkdir /install

# Install Jupyter extensions.
ADD install_jupyter_extensions.sh /install
RUN /install/install_jupyter_extensions.sh

# Config.
ADD etc_sudoers /install/
COPY etc_sudoers /etc/sudoers
COPY bashrc /root/.bashrc

# Report package versions.
ADD version.sh /install/
RUN /install/version.sh 2>&1 | tee version.log

# Jupyter.
EXPOSE 8888
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -xe

REPO_NAME=umd_data605
IMAGE_NAME=umd_data605_template
FULL_IMAGE_NAME=$REPO_NAME/$IMAGE_NAME

docker image ls $FULL_IMAGE_NAME

CONTAINER_NAME=$IMAGE_NAME
docker run --rm -ti \
--name $CONTAINER_NAME \
-p 8888:8888 \
-v $(pwd):/data \
$FULL_IMAGE_NAME
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -e

GIT_ROOT=$(git rev-parse --show-toplevel)
source $GIT_ROOT/docker_common/utils.sh

REPO_NAME=umd_data605
IMAGE_NAME=umd_data605_template

# Build container.
export DOCKER_BUILDKIT=1
#export DOCKER_BUILDKIT=0
build_container_image
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Pytho3
Python 3.8.10
# pip3
pip 25.0.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)
# jupyter
Selected Jupyter core packages...
IPython : 8.12.3
ipykernel : 6.29.5
ipywidgets : not installed
jupyter_client : 7.3.2
jupyter_core : 5.7.2
jupyter_server : 1.24.0
jupyterlab : not installed
nbclient : 0.10.1
nbconvert : 7.16.6
nbformat : 5.10.4
notebook : 6.5.7
qtconsole : not installed
traitlets : 5.14.3
# Python packages
Package Version
--------------------------------- -----------
anyio 3.7.1
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
asttokens 3.0.0
attrs 25.3.0
backcall 0.2.0
beautifulsoup4 4.13.3
bleach 6.1.0
cffi 1.17.1
comm 0.2.2
debugpy 1.8.13
decorator 5.2.1
defusedxml 0.7.1
entrypoints 0.4
exceptiongroup 1.2.2
executing 2.2.0
fastjsonschema 2.21.1
idna 3.10
importlib_metadata 8.5.0
importlib_resources 6.4.5
ipykernel 6.29.5
ipython 8.12.3
ipython-genutils 0.2.0
jedi 0.19.2
Jinja2 3.1.6
jsonschema 4.23.0
jsonschema-specifications 2023.12.1
jupyter-client 7.3.2
jupyter-contrib-core 0.4.2
jupyter-contrib-nbextensions 0.7.0
jupyter_core 5.7.2
jupyter-highlight-selected-word 0.2.0
jupyter_nbextensions_configurator 0.6.4
jupyter-server 1.24.0
jupyterlab_pygments 0.3.0
lxml 5.3.1
MarkupSafe 2.1.5
matplotlib-inline 0.1.7
mistune 3.1.3
nbclassic 1.2.0
nbclient 0.10.1
nbconvert 7.16.6
nbformat 5.10.4
nest-asyncio 1.6.0
notebook 6.5.7
notebook_shim 0.2.4
packaging 24.2
pandocfilters 1.5.1
parso 0.8.4
pexpect 4.9.0
pickleshare 0.7.5
pip 25.0.1
pkgutil_resolve_name 1.3.10
platformdirs 4.3.6
prometheus_client 0.21.1
prompt_toolkit 3.0.50
psutil 7.0.0
psycopg2-binary 2.9.10
ptyprocess 0.7.0
pure_eval 0.2.3
pycparser 2.22
Pygments 2.19.1
python-dateutil 2.9.0.post0
PyYAML 6.0.2
pyzmq 26.3.0
referencing 0.35.1
rpds-py 0.20.1
Send2Trash 1.8.3
setuptools 45.2.0
six 1.17.0
sniffio 1.3.1
soupsieve 2.6
stack-data 0.6.3
terminado 0.18.1
tinycss2 1.2.1
tomli 2.2.1
tornado 6.1
traitlets 5.14.3
typing_extensions 4.13.1
wcwidth 0.2.13
webencodings 0.5.1
websocket-client 1.8.0
wheel 0.34.2
yapf 0.43.0
zipp 3.20.2
# mongo
/data/version.sh: line 11: mongod: command not found
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

GIT_ROOT=$(git rev-parse --show-toplevel)
source $GIT_ROOT/tutorial_github_simple/docker_common/utils.sh

REPO_NAME=umd_data605
IMAGE_NAME=umd_data605_template

remove_container_image
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

GIT_ROOT=$(git rev-parse --show-toplevel)
source $GIT_ROOT/tutorial_github_simple/docker_common/utils.sh

REPO_NAME=umd_data605
IMAGE_NAME=umd_data605_template

exec_container
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

GIT_ROOT=$(git rev-parse --show-toplevel)
source $GIT_ROOT/tutorial_github_simple/docker_common/utils.sh

REPO_NAME=umd_data605
IMAGE_NAME=umd_data605_template

push_container_image
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -xe

jupyter-notebook \
--port=8888 \
--no-browser --ip=0.0.0.0 \
--allow-root \
--NotebookApp.token='' --NotebookApp.password=''
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
echo "# Pytho3"
python3 --version
echo "# pip3"
pip3 --version
echo "# jupyter"
jupyter --version
echo "# Python packages"
pip3 list
echo "# mongo"
mongod --version
Loading