If you need to create a cluster that has a custom scheduler plug-in in the E-HPC console, you must build the plug-in first. This topic uses the LSF plug-in as an example to describe how to build a scheduler plug-in.
Procedure
Create a directory tree for the plug-in on your local machine.
For more information, see Overview.
mkdir /plugin
mkdir /plugin/LSF
mkdir /plugin/LSF/10.1.0
Download the plug-in configuration file and template files over the Internet.
Run the following command to download the configuration file:
cd /plugin
wget https://public-ehpc-package.oss-cn-hangzhou.aliyuncs.com/plugintemplate/ehpc_custom.conf
Run the following command to download the plug-in template files:
wget -P /plugin/LSF/10.1.0 https://public-ehpc-package.oss-cn-hangzhou.aliyuncs.com/plugintemplate/plugin_template.tar.gz
Modify the configuration file.
Modify the configuration file based on your business requirements and required features. Enable the required features and disable other features. For more information, see Overview.
For example, if you must add nodes, delete nodes, and query a list of queues, you need to set NodeAdd, NodeDel, and QueueList to true, and set NodeOnline, NodeOffline, QueueAdd, QueueDel, and QueueSet to false in the configuration file. The following figure shows the sample configurations.
After you modify the configuration file, run the following command to decompress the plug-in template files:
cd LSF/10.1.0
tar xvfz /plugin/LSF/10.1.0/plugin_template.tar.gz
Enable scheduler features based on the plug-in template.
For example, if you need to enable scheduling service check, you must configure the sched_service_check function in the decompressed pluginschedulercheck.py file, as shown in the following figure.
The code in the red rectangle of the following figure shows how to enable the feature. You need to configure the values to return based on node types. In this example, for the compute nodes and logon node, true is returned to indicate that the check is successful. For the management node, you must check whether the LSF service is running as expected on the node before the check result is returned.
Build the scheduler plug-in.
After you enable the scheduler features, run the tar
command in the home directory to compress the scheduler plug-in.
cd /plugin
tar cvfz lsf_plugin.tgz *