Skip to content

Commit

Permalink
adding jupyterLab
Browse files Browse the repository at this point in the history
  • Loading branch information
meihuisu committed Jan 15, 2025
1 parent 553ea5f commit 29cfff6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 134 deletions.
23 changes: 16 additions & 7 deletions ucvm_v22_7_quakeworx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,23 @@ BDATE=$BDATE
# and for building the model and adding the correct date into the label
RUN echo $APP_UNAME $APP_GRPNAME $APP_UID $APP_GID $MODELID $BDATE

RUN yum clean all && yum -y update && yum -y\
groupinstall "Development Tools" && yum -y\
install wget yum-utils gcc-gfortran gcc-c++ fftw-devel which python38
RUN yum clean all && \
yum -y update && \
yum -y groupinstall "Development Tools" && \
yum -y install curl wget yum-utils gcc-gfortran gcc-c++ fftw-devel which python38 python38-devel

# Create python link as root before setting user. This is needed by
# the ucvm_setup.py script which will run to the ucvm installation
# To support the python2 plotting library, we will install Anaconda with a python2
# virtual environment in this image
RUN ln -s /usr/bin/python3 /usr/bin/python

# Install JupyterLab
# RUN python -m pip install --no-cache-dir jupyterlab
# Expose the port JupyterLab will run on
EXPOSE 8888


# Create python link as root before setting user. This is needed by
# the ucvm_setup.py script which will run to the ucvm installation
# To support the python2 plotting library, we will install Anaconda with a python2
Expand All @@ -46,7 +53,7 @@ RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_6
find /usr/local/opt/conda/ -follow -type f -name '*.js.map' -delete && \
/usr/local/opt/conda/bin/conda clean -afy

RUN /usr/local/opt/conda/bin/conda create -n Python2 python=2.7.15 scipy pip numpy matplotlib basemap basemap-data-hires
RUN /usr/local/opt/conda/bin/conda create -n Python2 python=2.7.15 scipy pip numpy matplotlib basemap basemap-data-hires jupyterlab

# Setup Owners
# Documents say this groupadd is needed when you build on linux, but not on Mac
Expand Down Expand Up @@ -108,7 +115,9 @@ RUN echo "source /usr/local/opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "source /app/ucvm/conf/ucvm_env.sh" >> ~/.bashrc && \
echo "conda activate Python2" >> ~/.bashrc

SHELL ["/bin/bash", "--login", "-c"]
WORKDIR /app/target
ENTRYPOINT ["/bin/bash"]
#SHELL ["/bin/bash", "--login", "-c"]
#WORKDIR /app/target
#ENTRYPOINT ["/bin/bash"]

# Define the command to run JupyterLab
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root"]
56 changes: 0 additions & 56 deletions ucvm_v22_7_quakeworx/build_all.py

This file was deleted.

58 changes: 0 additions & 58 deletions ucvm_v22_7_quakeworx/build_one.py

This file was deleted.

13 changes: 0 additions & 13 deletions ucvm_v22_7_quakeworx/build_one_quakeworx.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@
day=dt.day
mdate="%02d%02d"%(month,day)

all_models = ["cvms5",
"cca",
"cvms",
"cvmsi",
"cencal",
"cvmh",
"albacore",
"cvlsu",
"ivlsu",
"wfcvm",
"cvmhlabn cvmhsgbn cvmhvbn cvmhibbn cvmhrbn cvmhstbn cvmhsbbn cvmhsbcbn cvmhsmbn"]

models = ["cvmh"]

for m in models:
Expand All @@ -53,6 +41,5 @@

for m in models:
print("pushing models: " + m + " with sceccode/ucvm_227_%s_quakeworx:%s" % (m,mdate))
cmd = "docker push sceccode/ucvm_227_%s_quakeworx:%s" % (m,mdate)
cmd = "docker push sceccode/ucvm_227_%s_quakeworx:latest" % (m)
os.system(cmd)

0 comments on commit 29cfff6

Please sign in to comment.