Skip to content

Commit

Permalink
support multiple types of OS. closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Feb 9, 2017
1 parent 5680a9f commit 637dbc5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Binary file removed docs/list_of_requirements.png
Binary file not shown.
17 changes: 13 additions & 4 deletions glidein_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,20 @@ export _condor_UPDATE_COLLECTOR_WITH_TCP="True"
export _campusfactory_CAMPUSFACTORY_LOCATION=$PWD
export _condor_USER_JOB_WRAPPER=$PWD/user_job_wrapper.sh

if [ ! -e $GLIDEIN_DIR/glidein.tar.gz ]; then
wget -nv http://prod-exe.icecube.wisc.edu/glidein.tar.gz
GLIDEIN_DIR=$PWD
# detect CVMFS and get the OS type
OS_ARCH="RHEL_6_x86_64"
. $GLIDEIN_DIR/os_arch.sh

if [ -e $GLIDEIN_DIR/glidein.tar.gz ]; then
tar xzf $GLIDEIN_DIR/glidein.tar.gz
else
if wget -nv http://prod-exe.icecube.wisc.edu/glidein-$OS_ARCH.tar.gz ; then
tar xzf glidein-$OS_ARCH.tar.gz
else
wget -nv http://prod-exe.icecube.wisc.edu/glidein.tar.gz
tar xzf glidein.tar.gz
fi
fi
tar xzf $GLIDEIN_DIR/glidein.tar.gz

export campus_factory_dir=$PWD

Expand Down
9 changes: 8 additions & 1 deletion submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ def write_glidein_part(self, f, local_dir=None, glidein_tarball=None,
glidein_loc = os.getcwd()
if glidein_tarball:
self.write_line(f, 'ln -fs %s %s' % (glidein_tarball, os.path.basename(glidein_tarball)))
self.write_line(f, 'ln -fs %s %s' % (os.path.join(glidein_loc, glidein_script), glidein_script))
if not os.path.isfile(os.path.join(glidein_loc, glidein_script)):
raise Exception("glidein_script %s does not exist!"%os.path.join(glidein_loc, glidein_script))
self.write_line(f, 'ln -fs %s %s' % (os.path.join(glidein_loc, glidein_script), glidein_script))
if not os.path.isfile(os.path.join(glidein_loc, 'os_arch.sh')):
raise Exception("%s does not exist!"%os.path.join(glidein_loc, 'os_arch.sh'))
self.write_line(f, 'ln -fs %s %s' % (os.path.join(glidein_loc, 'os_arch.sh'), 'os_arch.sh'))

f.write('env -i CPUS=$CPUS GPUS=$GPUS MEMORY=$MEMORY DISK=$DISK WALLTIME=$WALLTIME ')
if 'site' in self.config['Glidein']:
Expand Down Expand Up @@ -597,6 +600,10 @@ def make_submit_file(self, filename, env_wrapper, state, group_jobs):
if not os.path.isfile(glidein_script):
raise Exception("no glidein_script provided")
infiles.append(glidein_script)
osarch_script = os.path.join(os.path.dirname(glidein_script),'os_arch.sh')
if not os.path.isfile(osarch_script):
raise Exception("os_arch.sh not found")
infiles.append(osarch_script)
if "tarball" in self.config["Glidein"]:
if not os.path.isfile(self.config["Glidein"]["tarball"]):
raise Exception("provided tarball does not exist")
Expand Down

0 comments on commit 637dbc5

Please # to comment.