-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
meihuisu
committed
Jan 16, 2025
1 parent
a165d79
commit 73a64a8
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Use the official Python image as a base | ||
FROM python:3.9-slim | ||
|
||
# Set environment variables to avoid writing bytecode and to make output unbuffered | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies (JupyterLab and common data science libraries) | ||
RUN pip install --no-cache-dir \ | ||
jupyterlab \ | ||
pandas \ | ||
numpy \ | ||
matplotlib \ | ||
seaborn \ | ||
scikit-learn \ | ||
scipy \ | ||
ipykernel \ | ||
jupyterhub \ | ||
notebook | ||
|
||
# Expose JupyterLab's port | ||
EXPOSE 8888 | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Start JupyterLab when the container is run | ||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# This script is used to update the inputs models and generate new docker build scripts for each configuration | ||
# | ||
|
||
import os | ||
import datetime | ||
|
||
## pip install py-cpuinfo | ||
import cpuinfo | ||
|
||
if __name__ == '__main__': | ||
|
||
## this is a bug in docker about apple's M1 chip | ||
cpudata = cpuinfo.get_cpu_info()['brand_raw'] | ||
cpuname = cpudata.split(" ")[1] | ||
|
||
# build date tag | ||
dt=datetime.datetime.today() | ||
month=dt.month | ||
day=dt.day | ||
mdate="%02d%02d"%(month,day) | ||
|
||
cmd = "docker build -t test_jupyterlab:%s ."%(mdate) | ||
os.system(cmd) | ||
|
||
cmd = "docker tag test_jupyterlab:%s mpihuisu/test_jupyterlab:latest"%(mdate) | ||
os.system(cmd) | ||
|
||
cmd = "docker push mpihuisu/test_jupyterlab:latest" | ||
os.system(cmd) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters