# # DESCRIPTION moldyngrid New MolDynGrid portal interface # portal_usage () { echo_g "MOLDYNGRID PORTAL OPTIONS:" echo_y -e "\t--update-proxy" echo -e "\t\tdo not submit anything, just update proxy stored on portal" } portal_parse_cmd_options () { case $1 in --update-proxy) MDS_PORTAL_PROXY_UPDATE=1 MDS_PARAMS=/etc/bashrc PARSED_BY_MODULE=1 ;; esac } portal_connect_pre () { echo_g "Getting UUID for job from MolDynGrid portal..." reply=$( curl -k -s --form request=getuuid --form userproxy=@${X509_USER_PROXY} https://moldyngrid.org/mdsportal/core.php ) r4eval=$( echo "$reply" | grep MDS_UUID ) echo "$reply" | grep -v MDS_UUID eval "$r4eval" [ -z "$MDS_UUID" ] && exit_error "Failed to obtain UUID for job from MolDynGrid portal." if [ -n "$MDS_PORTAL_PROXY_UPDATE" ]; then echo_g "Proxy certificate stored on portal database has been updated" exit 0 else echo_g "Received UUID: $MDS_UUID" next_idx_var ENVIRONMENT_NAME_ ENVIRONMENT_VALUE_ MDS_UUID "$MDS_UUID" next_idx_var RUNTIME_CONDITION_ RUNTIME_VALUE_ ">=" "MOLDYNGRID/PORTAL-3.0" fi } portal_connect_post () { echo_g "Registering job on MolDynGrid portal..." reply=$( curl -k -s --form request=addjob --form userproxy=@${X509_USER_PROXY} \ --form uuid=${MDS_UUID} --form jobname="${JOBNAME}" \ --form walltime=${WALLTIME:-3600} --form cpus=${NPRC:-1} \ --form software=$MDS_SOFTWARE --form infrastructure=$MDS_INFRASTRUCTURE \ --form params=@${MDS_PARAMS} --form jobidf=@${JOBIDFILE} \ https://moldyngrid.org/mdsportal/core.php ) echo "$reply" | grep -v 'STATUS' echo "$reply" | grep -q 'STATUS=OK' [ $? -ne 0 ] && exit_error "Failed to register job on MolDynGrid portal." echo_g "Done." }