Skip to content

Added code to support Singularity on HiperGator#389

Open
suhasthegame wants to merge 20 commits intogirder:masterfrom
suhasthegame:migration
Open

Added code to support Singularity on HiperGator#389
suhasthegame wants to merge 20 commits intogirder:masterfrom
suhasthegame:migration

Conversation

@suhasthegame
Copy link
Copy Markdown

No description provided.

Comment thread girder_worker/docker/tasks/__init__.py Outdated
logger.info(f'Job {jobid} was cancelled by user.')
return JOB_STATUS.CANCELLED

time.sleep(5) # Sleep to avoid busy waiting
Copy link
Copy Markdown
Member

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.

Comment thread girder_worker/docker/tasks/__init__.py Outdated
bind_paths[temporary_directory] = '/output'
super().__call__(*args,**kwargs)

qos = kwargs.pop('qos', 'pinaki.sarder')
Copy link
Copy Markdown
Member

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).

Comment thread girder_worker/docker/tasks/__init__.py Outdated
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)}'
Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants