The code enables NICE EnginFrame HPC portal services to save themselves as standalone submission scripts.
These scripts can be executed by the user in a later time without accessing the portal, from a command line.
Saving the service as a standalone submission script can cover a number of customer cases, such as:
- Need to submit several instances of the same HPC job manually or within wrapper scripts (e.g. in case of multiple realization jobs)
- Users preferring to submit their jobs from terminals, ssh or DCV sessions
- Build custom jobs workflows and automations, where this submission script becomes a step
- Enable users to work even if the portal is down
- Test/validate job scripts in a quicker way
Please review and accept EnginFrame EULA: https://download.enginframe.com/eula.html
We’ll implement this function by just modifying the Action Script of our target service. The logic we’ll put in place is the following:
- Get required information from the environment (service id, full path to service scripts, service option id list)
- For each service option id, dump its environment variable name and value into the target script
- Dump standard environment variables automatically exported by the portal (e.g. EF_ROOT, EF_USER, etc) into the target script
- Translate submission options passed to portal application.submit wrapper into standard HPC scheduler submission options (that’s the scheduler-dependent section)
- If submission options include MyHPC ones, dump them as well
- Save the script under ${HOME}/enginframe/saved.scripts
- Redirect the user to the spooler containing the script, just like application.submit would have done. In here the user can find a downloadable copy of the target script
- You know EnginFrame software and you are an EnginFrame administrator
- Your service Action script must use the standard EnginFrame submission wrapper: applications.submit E.g. it should use standard applications.submit command line options such as --jobname, --submitopts etc..
- Your service Action script must collect applications.submit options into one args() bash array (the default)
- If you’re using MyHPC AWS Professional Services solution, there should similarly be 2 other bash arrays e.g. myhpc_cunit() and myhpc_tags() that collect MyHPC options and tags. Also, args() array mentioned above must not include any MyHPC option, i.e. the arrays must not define the same submission parameters. Similar instructions could be applicable to Scale out computing on AWS (SOCA) solution.
- Since the code is bound to the underlying scheduler used, it might vary a little. In this document I’ll refer to PBS scheduler (working with OpenPBS or Altair PBS Pro but it should be easily portable to other schedulers supported by EnginFrame
To enable this feature to your service, proceed in the following way:
- Edit target service with EnginFrame service editor
- Add Save as script, don't submit checkbox/boolean option with id: save_as_script and class save-as-script, default value: true
- To disable the standard Submit button if our new checkbox is checked, we’ll add a little JavaScript code. Go To Settings → Javascript and add service.js code
- Finally, let’s find a place in our Action script that meets all the Requirements above, in particular where args() and other optional myhpc() arrays contain all the desired options, and those options are not overlapping. Then paste there the action-script.sh code
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.