Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation or restrictions on what can be specified as a job script #104

Closed
ericfranz opened this issue Jul 11, 2019 · 4 comments
Closed
Labels
enhancement This is functionality that builds upon existing functionality.
Milestone

Comments

@ericfranz
Copy link
Contributor

ericfranz commented Jul 11, 2019

Currently there is no restriction on what file can be selected to submit a job. Recently, some users have accidentally had their Abaqus input file selected as the script to submit, instead of the job script itself. The result is the job is rejected.

Some ideas:

  • restrict the dropdown to files ending in .sh, and then let the user "uncheck" the checkbox to allow them to select any file
  • restrict the dropdown to files whose first line starts with a shebang
  • display a warning to the user if the "script" currently selected does not have a shebang as the first line of the file
  • display a warning to the user if the "script" currently selected does not have the extension .sh

┆Issue is synchronized with this Asana task by Unito

@ericfranz
Copy link
Contributor Author

Also, if there is any logic in the app to choose the script file for a job where a script file has not been specified, we should probably choose a file with the preferred extension or with the first line a shebang...

@treydock
Copy link
Contributor

  • restrict the dropdown to files ending in .sh, and then let the user "uncheck" the checkbox to allow them to select any file

I wouldn't do this unless OnDemand is in full control of the filename used for job scripts. I always make Torque jobs .qsub or .batch and when I managed slurm I did .batch or .slurm. I've seen sites document the extension differently.

  • restrict the dropdown to files whose first line starts with a shebang

This isn't required by all batch schedulers.

  • display a warning to the user if the "script" currently selected does not have a shebang as the first line of the file
  • display a warning to the user if the "script" currently selected does not have the extension .sh

Warnings are fine but my previous comments would also apply to warnings.

I was thinking looking for #PBS or #SBATCH type strings in the file but those aren't necessary either if all arguments are passed at command line. Disallowing binary files is a good start, if it's binary it's not a job script, think the mime type information may tell you this. Another thing to do is warn if the file size is large. A plain text job script will be small and the issue we've seen at OSC is the job scripts that are actually input files are very large, that's how we catch this. I think the cutoff for us is 64KB for when we truncate job scripts for OSCUS but we consider it "large" if over 1MB I think, before the truncating.

@ericfranz
Copy link
Contributor Author

Mime type and file size are great ideas!

@ericfranz ericfranz transferred this issue from OSC/ood-myjobs Nov 6, 2019
@ericfranz ericfranz added this to the Backlog milestone Jan 30, 2020
@ritikasunkara ritikasunkara added the enhancement This is functionality that builds upon existing functionality. label Jul 14, 2022
@johrstrom
Copy link
Contributor

I think this is related to the job composer, in which case I'm going to close as won't do.

It does however relate to #2575 in that auto_scripts should glob the correct extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is functionality that builds upon existing functionality.
Projects
None yet
Development

No branches or pull requests

5 participants