-
Notifications
You must be signed in to change notification settings - Fork 31
Added code to support Singularity on HiperGator #389
base: master
Are you sure you want to change the base?
Conversation
logger.info(f'Job {jobid} was cancelled by user.') | ||
return JOB_STATUS.CANCELLED | ||
|
||
time.sleep(5) # Sleep to avoid busy waiting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be better to call s.wait(5)
and catch ExitTimeoutException
.
bind_paths[temporary_directory] = '/output' | ||
super().__call__(*args,**kwargs) | ||
|
||
qos = kwargs.pop('qos', 'pinaki.sarder') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend having these from environment variables. And, rather than construct the slurm script ourselves, we could use the simple_slurm
package to do it (it does the same thing, but has been validated by others and escapes command line parameters appropriately).
bind_option = ','.join([f"{host}:{container}" for host, container in bind_paths.items()]) | ||
|
||
# Construct the Singularity command | ||
singularity_command = f'singularity exec --bind {bind_option} docker://{image} {" ".join(container_args)}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The join is unsafe -- if the container args contain spaces or quotes or shell characters, odd things will happen.
No description provided.