Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
meihuisu committed Jan 16, 2025
1 parent a165d79 commit 73a64a8
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
36 changes: 36 additions & 0 deletions test_jupyterLab/Dockerfile
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"]


31 changes: 31 additions & 0 deletions test_jupyterLab/build.py
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)

2 changes: 1 addition & 1 deletion ucvm_v22_7_quakeworx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ ARG PATH="/usr/local/opt/conda/bin:${PATH}"
#ENTRYPOINT ["/bin/bash"]

# Define the command to run JupyterLab
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root"]
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser"]

0 comments on commit 73a64a8

Please sign in to comment.