Difference between revisions of "Tools/Manuals/TS122"
(Created page with '{{TOC_right}} Category:FAQ ------ Back to Administration FAQ ------ = How to let jobs run in local scratch space on the WN = Today there…') |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:Op menubar}} | |||
{{Template:Doc_menubar}} | |||
[[Category:Operations Manuals]] | |||
{{TOC_right}} | {{TOC_right}} | ||
------ | ------ | ||
Back to [[Tools/Manuals/AdministrationFaq|Administration FAQ]] | Back to [[Tools/Manuals/AdministrationFaq|Administration FAQ]] | ||
Line 11: | Line 13: | ||
ensure the job starts in the right place. | ensure the job starts in the right place. | ||
== CREAM | == CREAM solution == | ||
For a CREAM CE | For a CREAM CE the site admin can easily control the desired behavior by defining the | ||
the site admin can easily control the desired behavior by defining the | |||
<font face="Courier New,Courier">GLITE_LOCAL_CUSTOMIZATION_DIR</font> environment variable on the WN (e.g. in | <font face="Courier New,Courier">GLITE_LOCAL_CUSTOMIZATION_DIR</font> environment variable on the WN (e.g. in | ||
an extra script in <font face="Courier New,Courier">/etc/profile.d</font>) and creating the necessary scripts | an extra script in <font face="Courier New,Courier">/etc/profile.d</font>) and creating the necessary scripts | ||
in the corresponding directory as explained [ | in the corresponding directory as explained | ||
[https://wiki.italiangrid.it/twiki/bin/view/CREAM/SystemAdministratorGuideForEMI3#3_21_Job_wrapper_management here]. | |||
For example, the <font face="Courier New,Courier">cp_1.sh</font> script could contain something like this: | For example, the <font face="Courier New,Courier">cp_1.sh</font> script could contain something like this: | ||
#!/bin/sh | |||
# cp_1.sh: this is _sourced_ by the CREAM/WMS job wrapper | |||
my_initial_dir=`/bin/pwd` | |||
my_local_job_dir=`mktemp -d /scratch/job-XXXXXXXXXX` || exit | |||
cd $my_local_job_dir || exit | |||
And <font face="Courier New,Courier">cp_3.sh</font> then could contain this: | And <font face="Courier New,Courier">cp_3.sh</font> then could contain this: | ||
#!/bin/sh | |||
# cp_3.sh: this is _sourced_ by the CREAM/WMS job wrapper | |||
# | |||
# move out of the area to be cleaned up; | |||
# beware the initial directory might no longer exist | |||
# | |||
[ -d "${my_initial_dir:=/}" ] && cd "$my_initial_dir" || cd / | |||
# | |||
# impose sanity check on the local job directory string... | |||
# | |||
case "$my_local_job_dir" in | |||
/scratch/job-*) | |||
[ -d "$my_local_job_dir" ] && /bin/rm -r "$my_local_job_dir" | |||
esac | |||
However, beware that the job may get killed before it executes <font face="Courier New,Courier">cp_3.sh</font>, | However, beware that the job may get killed before it executes <font face="Courier New,Courier">cp_3.sh</font>, | ||
Line 47: | Line 63: | ||
not just CREAM or WMS job submission: | not just CREAM or WMS job submission: | ||
http://www.adaptivecomputing.com/ | http://www.adaptivecomputing.com/support/documentation-index/torque-resource-manager-documentation/ | ||
Latest revision as of 16:35, 23 August 2018
Main | EGI.eu operations services | Support | Documentation | Tools | Activities | Performance | Technology | Catch-all Services | Resource Allocation | Security |
Documentation menu: | Home • | Manuals • | Procedures • | Training • | Other • | Contact ► | For: | VO managers • | Administrators |
Back to Administration FAQ
How to let jobs run in local scratch space on the WN
Today there is no commonly accepted environment variable to identify the scratch space for jobs to use on the WN. Therefore the site needs to ensure the job starts in the right place.
CREAM solution
For a CREAM CE the site admin can easily control the desired behavior by defining the GLITE_LOCAL_CUSTOMIZATION_DIR environment variable on the WN (e.g. in an extra script in /etc/profile.d) and creating the necessary scripts in the corresponding directory as explained here.
For example, the cp_1.sh script could contain something like this:
#!/bin/sh # cp_1.sh: this is _sourced_ by the CREAM/WMS job wrapper my_initial_dir=`/bin/pwd` my_local_job_dir=`mktemp -d /scratch/job-XXXXXXXXXX` || exit cd $my_local_job_dir || exit
And cp_3.sh then could contain this:
#!/bin/sh # cp_3.sh: this is _sourced_ by the CREAM/WMS job wrapper # # move out of the area to be cleaned up; # beware the initial directory might no longer exist # [ -d "${my_initial_dir:=/}" ] && cd "$my_initial_dir" || cd / # # impose sanity check on the local job directory string... # case "$my_local_job_dir" in /scratch/job-*) [ -d "$my_local_job_dir" ] && /bin/rm -r "$my_local_job_dir" esac
However, beware that the job may get killed before it executes cp_3.sh,
so the admin should also create a daily or hourly cron job that cleans up
any stale job directories.
Torque solution
For Torque one can use its "tmpdir" feature instead and let Torque handle the whole thing, which then would cover all uses of the batch system, not just CREAM or WMS job submission:
http://www.adaptivecomputing.com/support/documentation-index/torque-resource-manager-documentation/