Create Web Based Job Submission Worfklows
On this page, you will learn how to create an application profile and give your users the ability to submit HPC jobs via a simple web interface.
No coding experience = No Problem
IDEA features a complete visual form builder experience with simple drag & drop capabilities. HPC admins can build their own forms without any coding/HTML experience via an intuitive wysiwyg (What You See Is What You Get) solution.
Build the job script
The first step is to identify the variables you want your users to configure. Let's take this simple job file for reference:
Replace the values/parameters you want your users to configure with {{``VARIABLE_NAME }}
such as:
Job Script you will need to reuse later during Configure the job script:
In this example:
{{ job_name }} will be replaced by the actual job name specified by the user
{{ queue_name }} will be replaced by the actual queue
{{ instance_type }} will be replaced with the actual instance type
{{ input_file }} will be replaced by the simulation input
{{ version }} will let the user decide what software version to use
{{ cpus }} , {{ input_file }}, and {{ parameter1 }} are application specific parameters
{{ backup_enabled }} will determine if we want to archive the job output to S3
{{ bucket_to_archive }} will point to the user's personal S3 bucket
Create the HTML form
Now that you have identified all variables, you must create their associated HTML components. As a HPC admin, navigate to "Application" tab in the left sidebar. Click "Create Application" to load the application interface. You will see three tabs:
Preview Form: Live rendering of the form you are creating
Form Builder: Where you build the HTML form
Advanced Mode: Build the HTML form directly via JSON inputs
Click "Form Builder" then "Reset Form" to start from a fresh template and start to build the HTML form using the examples below.
As an alternate option, you can copy/paste the content of the following section to "Form Builder (Advanced Mode using JSON)" to directly import the template.
Text Field
Click "Add Form Field" and add a new "Text" field.
Configure the widget and configure the Name settings (red) with the variable name associated (job_name in our example) then click "Save"
Repeat the same operation for job_project, bucket_to_archive, parameter and input_file
{{ input_file }} will automatically be configured with the path of the input file selected by the user
Read Only Field
In this example, e want to enforce the instance type to be c5.18xlarge.
Create a new Text field
Specify the name (red) / title / description
Under Preview, write c5.18xlarge (green)
Enable the "is ReadOnly" button (blue)
Number Field
In this example, we want to create the cpus
parameter hence recommend using the "Number" field
To specify Min/Max values, click "Form Builder (Advanced Mode Using Json)" and locate the json entry associated to your field. Finally, add "min" and "max" values as shown below (line 14 and 15)
Select Field
Assuming your application hierarchy is as follow:
This time, we recommend you using the "Select" component:
Similarly to the previous examples, map the "Name" to your variable name ({{ version }}) and add labels (green) and their associated values (blue)
Toggle Field & dynamic elements display/hide
{{ backup_enabled }} is a boolean which enable (1) or disable (0) archival of the job output data to S3. This time use "Toggle" form field.
Now let's create a new "Text" field called bucket_to_archive
. However, we want to display this information only when backup_enabled
is set to checked. To do that, click "Advanced Mode", locate the "bucket_to_archive" section and add the when
section as shown below. This will ensure bucket_to_archive will only be visible to the users if bucket_enabled is checked
Configure the job script
Once your HTML form is done, simply click "Next" and copy/paste Build the job script within the "Job Script" section. Select "Jinja2" as template.
Job Script support Jinja2 templating. For example, {{ job_name | upper }} will retrieve the HTML field named job_name and enforce uppercase.
Since this script is expected to be triggered by OpenPBS scheduler, keep the default "PBS Job Script" as interpreter. IDEA also gives you an easy way to determine if all the variables you have configured on the HTML form are being used in your job script
Save your profile
Finally, click "Next" choose an name, upload a thumbnail if needed (optional) and select the IDEA project that are authorized to use this form (learn more about projects: Projects Management)
Submit a test job
To submit a job, first navigate to "File Browser" on the left sidebar File Browser.
Choose your input file and click "Submit Job" icon. This will open the submit job interface.wizard
From there, click "Application" and select the application you just created
Fill out the HTML form generated during the previous step with your own inputs.
IDEA also determine the number of nodes to provision automatically based on the instance type and cpus requested. For example, if the instance is c5.18xlarge (36 cores) and the number of CPUs requested by the user is 72. IDEA automatically detects these values and determine the number of instances to provision is 2
Prior to submitting a job, you can click "Dry run" to validate whether or not you job can run. You will also be able to check the cost estimation of your job as well as additional information specific to your simulation.
Once done, click "Submit Job" and you job will be submitted to the queue.
You can now verify the job script generated by IDEA correctly reports the HTML inputs you specified via the web form:
(Click to enlarge)
Work with Dynamic Form Fields
You can easily hide/show HTML elements based on the values of other elements via the "when" option.
For example, let's say you have a dropdown menu named "dropdown1" and you want to display it only when the user click on the toggle button "checkbox1"
Supported operators are:
empty
not_empty
eq
not_eq
in
not_in
Additional comparators will be added in the future.
What if I want to run a Linux script/command
If you want your job script to use regular bash interpreter (and not qsub), simple select "Linux Shell Script". In other words, the output generated by your HTML world will be a simple bash script and SOCA will run /bin/bash job_submit.sh
command.
Last updated