Submit Tasks Using Task Templates
You can configure task templates in advance and use them to submit tasks to the cluster, improving efficiency. This guide explains how to create a task template and submit a task using that template.
Prerequisites
- You have created an Fsched cluster and its status is
Running. See Add Hosts and Create a Cluster. - Shared storage is enabled in environment configuration. See Use Shared Storage as the Fastone Storage Directory.
- The platform task scheduling mode is set to the scheduler-oriented task mode. See Set the Task Scheduling Mode.
Create a Task Template
-
In the left sidebar, open the Task Templates page.
-
Click New and add a task template using the example below. For a full explanation of template syntax, see Task Template Overview.
# Display name of the task template
Name: RunCommand
Definition:
parameters:
- name: param1
display: runcommand
description: Description
type: STRING
required: true
usage: SCRIPT
visibility: true
outputs:
- path: testrun.txt
type: text
script: |-
#!/bin/bash
{{ param1 }} >> a.txtKeep other settings as default.
-
Click Submit.
Submit a Task Using the Template
- On the home page under Quick Navigation, click New Task.
- Select the
RunCommandtemplate created in the previous step. - On the parameter input page, enter a command in
runcommand(for example,hostname). In the cluster list, select a running Fsched cluster. - Click Submit.
- Go to Compute -> Application Center -> Task Management to check task status.
View Task Output
In Compute -> Application Center -> Task Management, locate the task you submitted, open the task details page, and click the output file a.txt to view the result.