diff --git a/ucvm_v22_7_quakeworx/Dockerfile b/ucvm_v22_7_quakeworx/Dockerfile index d96b69c..f124795 100644 --- a/ucvm_v22_7_quakeworx/Dockerfile +++ b/ucvm_v22_7_quakeworx/Dockerfile @@ -90,12 +90,10 @@ VOLUME /app/target WORKDIR /app COPY examples /app/examples -RUN chmod -R og+rw /app/ucvm /app/examples && \ - chmod -R +x /app/examples/*.py /app/examples/*.sh && \ - chmod -R og+rw /app/target - -# Define directory that will be mounted and used for file input/output -# +# Added steps to manage home directory permissions +RUN chown -R $APP_UID:$APP_GID /app && \ + chmod -R og+rw /app/ucvm /app/examples && \ + chmod -R +x /app/examples/*.py /app/examples/*.sh # Add metadata to dockerfile using labels LABEL org.label-schema.build-date=$BDATE diff --git a/ucvm_v22_7_quakeworx/build_one_quakeworx.py b/ucvm_v22_7_quakeworx/build_one_quakeworx.py index c73fa0e..2063896 100755 --- a/ucvm_v22_7_quakeworx/build_one_quakeworx.py +++ b/ucvm_v22_7_quakeworx/build_one_quakeworx.py @@ -51,8 +51,8 @@ cmd = "docker tag ucvm_227_%s_quakeworx:%s sceccode/ucvm_227_%s_quakeworx:latest"%(m,mdate,m) os.system(cmd) -# 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) + 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) diff --git a/ucvm_v22_7_quakeworx/push_all.py b/ucvm_v22_7_quakeworx/push_all.py deleted file mode 100755 index b76ef7c..0000000 --- a/ucvm_v22_7_quakeworx/push_all.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 -# This script is used to update the inputs models and generate new docker build scripts for each configuration -# - -import os - -# Press the green button in the gutter to run the script. -if __name__ == '__main__': - - # build date tag - mdate = "0710" - - models = ["wfcvm"] - - """ - - models = ["cvms5", - "cca", - "cvms", - "cvmsi", - "cencal", - "cvmh", - "albacore", - "cvlsu", - "ivlsu", - "wfcvm", - "cvmhlabn cvmhsgbn cvmhvbn cvmhibbn cvmhrbn cvmhstbn cvmhsbbn cvmhsbcbn cvmhsmbn"] - for m in models: - print ("building model: " + m) - cmd = "docker build --no-cache=false -f Dockerfile . -t ucvm_227_%s:%s " \ - "--build-arg APP_UNAME=`id -u -nr` --build-arg APP_GRPNAME=`id -g -nr` " \ - "--build-arg APP_UID=`id -u` --build-arg APP_GID=`id -g` --build-arg MODELID=%s --build-arg BDATE=%s"%(m,mdate,m,mdate) - - # os.system(cmd) - cmd = "docker tag ucvm_227_%s:%s sceccode/ucvm_227_%s:%s"%(m,mdate,m,mdate) - #os.system(cmd) - """ - for m in models: - print("pushing models: " + m) - cmd = "docker push sceccode/ucvm_227_%s:%s" % (m, mdate) - os.system(cmd) diff --git a/ucvm_v22_7_quakeworx/r b/ucvm_v22_7_quakeworx/r index 2cd5a5a..7061f64 100755 --- a/ucvm_v22_7_quakeworx/r +++ b/ucvm_v22_7_quakeworx/r @@ -1,5 +1,8 @@ # -rm removes container on exit # -it indicates inteactive + --tty so that users are at an interactive tty command line when the container starts -docker run -p 8888:8888 --rm -it -e DISPLAY=$DISPLAY --mount type=bind,source="$(pwd)"/target,destination=/home/ucvmuser/target sceccode/ucvm_227_cvmh:0710 -#docker run -p 8888:8888 --rm -it --env=DISPLAY --mount type=bind,source="$(pwd)"/target,destination=/home/ucvmuser/target sceccode/ucvm_227_cvmh:0710 +docker run -p 8888:8888 --rm -it --mount type=bind,source="$(pwd)"/target,destination=/app/target ucvm_227_cvmh_quakeworx:0115 + +#docker run -p 8888:8888 --rm -it --mount type=bind,source="$(pwd)"/target,destination=/app/target sceccode/ucvm_227_cvmh_quakeworx:0115 + +#docker run -p 8888:8888 --rm -it --mount type=bind,source="$(pwd)"/target,destination=/home/ucvmuser/target sceccode/ucvm_227_cvmh:0710 diff --git a/ucvm_v22_7_quakeworx/tag_one.sh b/ucvm_v22_7_quakeworx/tag_one.sh deleted file mode 100755 index 8e68bca..0000000 --- a/ucvm_v22_7_quakeworx/tag_one.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -docker push sceccode/ucvm_227_cencal:0710 diff --git a/ucvm_v22_7_quakeworx/target/basic_query.sh b/ucvm_v22_7_quakeworx/target/basic_query.sh deleted file mode 100755 index b1014f4..0000000 --- a/ucvm_v22_7_quakeworx/target/basic_query.sh +++ /dev/null @@ -1 +0,0 @@ -ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvmsi < gmg_test.txt > test_results.log diff --git a/ucvm_v22_7_quakeworx/target/plot_script.sh b/ucvm_v22_7_quakeworx/target/plot_script.sh deleted file mode 100755 index da9e25d..0000000 --- a/ucvm_v22_7_quakeworx/target/plot_script.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# Script for running depth profile plots -# -# Configuration Changes: -# Set the UCVM installation, and the model config file directories -# -# The script can be re-run for different sites by -# changing the site number for each selected site -# -# -UCVM_CONF_PATH=/app/ucvm/conf - -# String to change -# gtl = off -# gtl = on -# -# -# Define resolution of profile -# -STEP=1 -START_depth=0 -END_depth=1000 -# Start with Site at USC in LA Basin -# This is the latlong for USC -# -# SITE_NUM=1 -# LAT=34.0224 -# LON=-118.2851 -# -# Re-run script with site ne -SITE_NUM=2 -LAT=35.5 -LON=-117.5 - -## Test Cases 4 -# Test cvm-si (CVM-S4.26.M01 with native gtl -# Test cvm-s4- with elygtl:ely -# - -MODEL=cvmsi -LABEL=cvmsi_default_${SITE_NUM} - -plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs,vp,density -v ${STEP} -c ${MODEL} -t ${LABEL} -o /app/target/${LABEL}.png - - -MODEL=cvmsi,elygtl:ely -LABEL=cvmsi_elygtl_ely_default_z_${SITE_NUM} - -plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs,vp,density -v ${STEP} -c ${MODEL} -t ${LABEL} -o /app/target/${LABEL}.png - -MODEL=cvmsi,elygtl:ely -LABEL=cvmsi_elygtl_ely_z_700m_${SITE_NUM} - -plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs,vp,density -v ${STEP} -c ${MODEL} -z 0,700 -t ${LABEL} -o /app/target/${LABEL}.png diff --git a/ucvm_v22_7_quakeworx/target/plot_vp.py b/ucvm_v22_7_quakeworx/target/plot_vp.py deleted file mode 100755 index 82f95a5..0000000 --- a/ucvm_v22_7_quakeworx/target/plot_vp.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/env python -import sys -import os -# Define vertical profile depth and resolution -STEP = 1 -START_depth = 0 -END_depth = 1000 - -sites_dict = { -"RIDG":[-117.5,35.5], -"USC":[-118.2851,34.0224], -"s035":[-118.840210, 34.758660], -"s117":[-118.780920, 34.474230], -"WNGC":[-118.065300, 34.041824], -"LAPD":[-118.125000, 34.557000], -"s568":[-117.470700, 34.382520], -"s650":[-117.281830, 34.293160], -"SVD":[-117.098220, 34.106470], -"SBSM":[-117.292010, 34.064986], -"PEDL":[-117.462920, 33.990140], -"MRVY":[-117.168280, 33.925270], -"PERR":[-117.249040, 33.805940], -"PIBU":[-117.850220, 34.653070], -"s211":[-118.325570, 34.780900], -"s764":[-117.375520, 33.610750] -} - - -for key,value in sites_dict.items(): - SITE_NAME = key - LAT = value[1] - LON = value[0] - - MODEL="cvmsi" - LABEL = "cvmsi_default_%s"%(SITE_NAME) - - cmd = "plot_depth_profile.py -s %f,%f -b %f -e %f -d vs,vp,density -v %s -c %s -t %s -o /app/target/%s.png"% \ - (LAT,LON,START_depth,END_depth,STEP,MODEL,LABEL,LABEL) - - print(cmd) - os.system(cmd) - - MODEL = "cvmsi,elygtl:ely" - LABEL = "cvmsi_elygtl_ely_default_z_%s"%(SITE_NAME) - - cmd = "plot_depth_profile.py -s %f,%f -b %f -e %f -d vs,vp,density -v %s -c %s -t %s -o /app/target/%s.png"% \ - (LAT,LON,START_depth,END_depth,STEP,MODEL,LABEL,LABEL) - - print(cmd) - os.system(cmd) - - MODEL = "cvmsi,elygtl:ely" - LABEL = "cvmsi_elygtl_ely_z_700m_%s"%(SITE_NAME) - - cmd = "plot_depth_profile.py -s %f,%f -b %f -e %f -d vs,vp,density -v %s -c %s -z 0,700 -t %s -o /app/target/%s.png"% \ - (LAT,LON,START_depth,END_depth,STEP,MODEL,LABEL,LABEL) - - print(cmd) - os.system(cmd) - -sys.exit(0) diff --git a/ucvm_v22_7_quakeworx/target/run_plot.sh b/ucvm_v22_7_quakeworx/target/run_plot.sh new file mode 100644 index 0000000..996d2dc --- /dev/null +++ b/ucvm_v22_7_quakeworx/target/run_plot.sh @@ -0,0 +1,2 @@ + +plot_horizontal_slice.py -d vs -c cvmh -s 0.011 -a sd -o slice_cvmh.png -i $UCVM_INSTALL_PATH -b 33.585,-118.7904 -u 34.559,-117.5492 -e 1000 diff --git a/ucvm_v22_7_quakeworx/target/show_plot.sh b/ucvm_v22_7_quakeworx/target/show_plot.sh new file mode 100644 index 0000000..a2a11bd --- /dev/null +++ b/ucvm_v22_7_quakeworx/target/show_plot.sh @@ -0,0 +1,2 @@ + +view_png.py -f slice-cvmh.png diff --git a/ucvm_v22_7_quakeworx/target/test_inputs.txt b/ucvm_v22_7_quakeworx/target/test_inputs.txt deleted file mode 100755 index b2182ac..0000000 --- a/ucvm_v22_7_quakeworx/target/test_inputs.txt +++ /dev/null @@ -1,5 +0,0 @@ --118.0 34.0 0.0 --118.0 34.0 50.0 --118.0 34.0 100.0 --118.0 34.0 500.0 --118.0 34.0 1000.0 diff --git a/ucvm_v25_2/Dockerfile b/ucvm_v25_2/Dockerfile index e5fcebe..d8077f2 100644 --- a/ucvm_v25_2/Dockerfile +++ b/ucvm_v25_2/Dockerfile @@ -3,9 +3,10 @@ FROM rockylinux:8.5 ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 -ENV UCVM_TOP_DIR=/app/ucvm +ENV UCVM_DIR=/app/ucvm ENV PLOTTING_TOP_DIR=/app/plotting -ENV CVM_LARGEDATA_DIR=/app/ucvm/cvm-large-dataset +ENV CVM_TARGET_VOLUME=/app/target +ENV CVM_LARGEDATA_DIR=/app/cvm-large-dataset # Define Build and runtime arguments ARG APP_UNAME @@ -57,8 +58,9 @@ RUN git clone https://github.com/sceccode/ucvm.git -b withSFCVM src # An external script has selected the correct model files for this image in the largefiles dir # by setting the model abbreviations in the largefile_inputs.txt file -WORKDIR /app/ucvm/largefiles -RUN ./get_largefiles.py -m $MODELID && ./stage_largefiles.py +WORKDIR /app/src/largefiles +RUN ./get_largefiles.py -m $MODELID && \ + ./stage_largefiles.py WORKDIR /app/src RUN ./ucvm_setup.py -a -d -p /app/ucvm >& ./ucvm_setup_install.log @@ -75,21 +77,26 @@ RUN git clone https://github.com/SCECcode/ucvm_metadata_utilities metadata_utili WORKDIR /app/plotting RUN git clone https://github.com/SCECcode/ucvm_plotting.git -b withAnaconda3 && \ - cd /app/ucvm/ucvm_plotting && \ + cd ucvm_plotting && \ conda install dist/ucvm_plotting-0.0.6.tar.gz # Define file input/output mounted disk -# -VOLUME /app/target +# /app/target +VOLUME $CVM_TARGET_VOLUME + +# Define cvm large dataset mounted disk +# /app/cvm-large-dataset +VOLUME $CVM_LARGEDATA_DIR # Setup user with test input files # WORKDIR /app COPY examples /app/examples -RUN chmod -R og+rw /app/ucvm /app/examples && \ +RUN chmod -R og+rw $UCVM_DIR /app/examples && \ chmod -R +x /app/examples/*.py /app/examples/*.sh && \ - chmod -R og+rw /app/target + chmod -R og+rw $CVM_TARGET_VOLUME && \ + chmod -R og+r $CVM_LARGEDATA_DIR && \ # Define directory that will be mounted and used for file input/output # @@ -105,7 +112,7 @@ LABEL version="ucvm_v25_2" USER $APP_UNAME RUN echo "source /usr/local/opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ echo "source /app/ucvm/conf/ucvm_env.sh" >> ~/.bashrc && \ - echo "export CVM_LARGEDATA_DIR=/Users/mei/scec/CVM_DATASET_DIRECTORY" >> ~/.bashrc + echo "export CVM_LARGEDATA_DIR="$CVM_LARGEDATA_DIR >> ~/.bashrc SHELL ["/bin/bash", "--login", "-c"] WORKDIR /app/target