or any HPC using the slurm workload manager
ssh {YOUR ROCKFISH USERNAME}@login.rockfish.jhu.edumodule purge
module load gcc/9.3.0
module load anaconda3/2022.05 # very important to pin this version as other are buggy
module load git # needed for git
module load git-lfs # git-lfs (do we still need it?)git config --global credential.helper store
git config --global user.name "{NAME SURNAME}"
git config --global user.email YOUREMAIL@EMAIL.COM
git config --global pull.rebase false # so you use merge as the default reconciliation method# install all python stuff first
conda create -c conda-forge -n flepimop-env numba pandas numpy seaborn tqdm matplotlib click confuse pyarrow sympy dask pytest scipy graphviz emcee xarray boto3 slack_sdk
# activate the enviromnment and install the R stuff
conda activate flepimop-env
conda install -c conda-forge r-readr r-sf r-lubridate r-tigris r-tidyverse r-gridextra r-reticulate r-truncnorm r-xts r-ggfortify r-flextable r-doparallel r-foreach r-arrow r-optparse r-devtools r-tidycensus r-cdltools r-cowplot cd /scratch4/struelo1/flepimop-code/
mkdir $USER
cd $USER
git clone https://github.com/HopkinsIDD/flepiMoP.git
git clone https://github.com/HopkinsIDD/Flu_USA.git
# or any other model repositoriesHost github.com
User git
IdentityFile ~/.ssh/<key_name>cd /scratch4/struelo1/flepimop-code/
mkdir $USER
cd $USER
git clone git@github.com:HopkinsIDD/flepiMoP.git
git clone git@github.com:HopkinsIDD/Flu_USA.git
# or any other model repositoriescd ~ # go in your home directory
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install -i ~/aws-cli -b ~/aws-cli/bin
./aws-cli/bin/aws --version# AWS Access Key ID [None]: Access key
# AWS Secret Access Key [None]: Secret Access key
# Default region name [None]: us-west-2
# Default output format [None]: jsonsource /scratch4/struelo1/flepimop-code/$USER/flepiMoP/batch/slurm_init.shmodule purge
module load gcc/9.3.0
module load git
module load git-lfs
module load slurm
module load anaconda3/2022.05
conda activate flepimop-env
export CENSUS_API_KEY={A CENSUS API KEY}
export FLEPI_RESET_CHIMERICS=TRUE
export FLEPI_PATH=/scratch4/struelo1/flepimop-code/$USER/flepiMoP
# And then it asks you some questions to setup some enviroment variablesexport VALIDATION_DATE="2023-01-29"
export RESUME_LOCATION=s3://idd-inference-runs/USA-20230122T145824
export FLEPI_RUN_INDEX=FCH_R16_lowBoo_modVar_ContRes_blk4_Jan29_tsvacccd /scratch4/struelo1/flepimop-code/$USER
export FLEPI_PATH=$(pwd)/flepiMoP
cd $FLEPI_PATH
git checkout main
git pull
# install dependencies ggraph and tidy graph
R
> install.packages(c("ggraph","tidygraph"))
> quit()
# install the R module
Rscript build/local_install.R # warnings are ok; there should be no error.
# install gempyor
pip install --no-deps -e flepimop/gempyor_pkg/cd /scratch4/struelo1/flepimop-code/$USER
export PROJECT_PATH=$(pwd)/COVID19_USA
export GT_DATA_SOURCE="csse_case, fluview_death, hhs_hosp"
export DELPHI_API_KEY="[YOUR API KEY]"cd /scratch4/struelo1/flepimop-code/$USER
export PROJECT_PATH=$(pwd)/Flu_USAcd $PROJECT_PATH
git pull
git checkout maingit reset --hard && git clean -f -d # this deletes everything that is not on github in this repo !!!rm -rf model_output data/us_data.csv data-truth &&
rm -rf data/mobility_territories.csv data/geodata_territories.csv &&
rm -rf data/seeding_territories.csv &&
rm -rf data/seeding_territories_Level5.csv data/seeding_territories_Level67.csv
# don't delete model_output if you have another run in //
rm -rf $PROJECT_PATH/model_output
# delete log files from previous runs
rm *.outexport CONFIG_PATH=config_FCH_R16_lowBoo_modVar_ContRes_blk4_Jan29_tsvacc.yml
Rscript $FLEPI_PATH/datasetup/build_US_setup.R
# For covid do
Rscript $FLEPI_PATH/datasetup/build_covid_data.R
# For Flu (do not do this for the scenariohub!)
R
> install.packages(c("RSocrata"))
Rscript $FLEPI_PATH/datasetup/build_flu_data.R
# build seeding
Rscript $FLEPI_PATH/datasetup/build_initial_seeding.Rexport FLEPI_MEM_PROFILE=TRUE
export FLEPI_MEM_PROF_ITERS=50flepimop-inference-main -c $CONFIG_PATH -j 1 -n 1 -k 1 rm -r model_outputpython $FLEPI_PATH/batch/inference_job_launcher.py --slurm 2>&1 | tee $FLEPI_RUN_INDEX_submission.logpython $FLEPI_PATH/batch/inference_job_launcher.py --slurm \
-c $CONFIG_PATH \
-p $FLEPI_PATH \
--data-path $PROJECT_PATH \
--upload-to-s3 True \
--id $FLEPI_RUN_INDEX \
--fs-folder /scratch4/struelo1/flepimop-runs \
--restart-from-location $RESUME_LOCATIONgit add data/
git commit -m"scenario run initial"
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
git push --set-upstream origin $branchfind . -maxdepth 1 -type d | while read -r dir
do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done rm -r /scratch4/struelo1/flepimop-runs/
rm -r model_output
cd $COVID_PATH;git pull;cd $PROJECT_PATH
rm *.outsqueue -u $USERscancel JOB_IDinteract -p defq -n 4 -m 24G -t 12:00:00cd /scratch4/struelo1/flepimop-code/
nano slack_credentials.sh
# and fill the file:
export SLACK_WEBHOOK="{THE SLACK WEBHOOK FOR CSP_PRODUCTION}"
export SLACK_TOKEN="{THE SLACK TOKEN}"