diff --git a/video_prediction_tools/env_setup/create_env.sh b/video_prediction_tools/env_setup/create_env.sh index 8d98101295b37dabda4bcf9b22eb3224d10c74e6..e5a3f4727241177f28788528e553df854d0f1ffb 100755 --- a/video_prediction_tools/env_setup/create_env.sh +++ b/video_prediction_tools/env_setup/create_env.sh @@ -41,6 +41,12 @@ ENV_DIR=${WORKING_DIR}/${ENV_NAME} # !!! Expects that a template named [script_name]_template.sh exists!!! if [[ "${HOST_NAME}" == jwlogin21* || "${HOST_NAME}" == jwlogin22* ]]; then workflow_scripts=(train_model_era5_booster) + # another sanity check for Juwels Booster -> ensure running singularity + if [[ -z "${SINGULARITY_NAME}" ]]; then + echo "ERROR: create_env.sh must be executed in a running singularity on Juwels Booster." + echo "Thus, execute 'singularity shell [my_docker_image]' first!" + return + fi else workflow_scripts=(data_extraction_era5 preprocess_data_era5_step1 preprocess_data_era5_step2 train_model_era5 visualize_postprocess_era5 preprocess_data_moving_mnist train_model_moving_mnist visualize_postprocess_moving_mnist) fi @@ -74,15 +80,26 @@ elif [[ "${HOST_NAME}" == "zam347" ]]; then unset PYTHONPATH # Juwels Booster elif [[ "${HOST_NAME}" == jwlogin21* || "${HOST_NAME}" == jwlogin22* ]]; then - echo "***** Checking modules required during the workflow on Juwels Booster... *****" - source ${ENV_SETUP_DIR}/modules_train.sh + echo "***** Note for Juwels Booster! *****" + echo "Already checked the required modules?" + echo "To do so, run 'source modules_train.sh' after exiting the singularity." + echo "***** Note for Juwels Booster! *****" fi if [[ "$ENV_EXIST" == 0 ]]; then # Activate virtual environmen and install additional Python packages. echo "Configuring and activating virtual environment on ${HOST_NAME}" - - python3 -m venv $ENV_DIR + + if [[ "${HOST_NAME}" == jwlogin21* || "${HOST_NAME}" == jwlogin22* ]]; then + # Horovod is part of the requirements on Booster since no binary module is available + # Additionally, venv needs access to the system site-packages of the running singularity + # Otherwise, TensorFlow would be missing + file_req_packages=requirements_booster.txt + python3 -m venv --system-site-packages $ENV_DIR + else + file_req_packages=requirements.txt + python3 -m venv --system-site-packages $ENV_DIR + fi activate_virt_env=${ENV_DIR}/bin/activate echo ${activate_virt_env} @@ -93,7 +110,7 @@ if [[ "$ENV_EXIST" == 0 ]]; then if [[ "${HOST_NAME}" == hdfml* || "${HOST_NAME}" == *juwels* ]]; then # check module availability for the first time on known HPC-systems echo "***** Start installing additional Python modules with pip... *****" - pip3 install --no-cache-dir --ignore-installed -r ${ENV_SETUP_DIR}/requirements.txt + pip3 install --no-cache-dir --ignore-installed -r ${ENV_SETUP_DIR}/${file_req_packages} #pip3 install --user netCDF4 #pip3 install --user numpy elif [[ "${HOST_NAME}" == "zam347" ]]; then diff --git a/video_prediction_tools/env_setup/requirements_booster.txt b/video_prediction_tools/env_setup/requirements_booster.txt new file mode 100644 index 0000000000000000000000000000000000000000..6b1717b9540ccdc6f20e4202424f7efd229c6ed6 --- /dev/null +++ b/video_prediction_tools/env_setup/requirements_booster.txt @@ -0,0 +1,7 @@ +opencv-python-headless==4.2.0.34 +horovod==0.16.2 +scipy +matplotlib==3.3.0 +scikit-image +pandas +hickle