Skip to content

Nodejs module to interact with a OpenPBS/Torque Server

License

Notifications You must be signed in to change notification settings

quantumhpc/torquejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-pbsjs

Nodejs module to interact with a PBS/Torque Server

Introduction

For now only basic function are implemented: qmgr -c 'p s', qstat, qdel(jobId), qnodes and qnodes(nodename). It uses SSH to remotly connect to the PBS/Torque headnode and return information as a JSON array.

Basic usage

Edit ./config/pbsserver.json" with your information

var pbs_config = {
        "method"                : "ssh",
        "ssh_exec"              : "/usr/bin/ssh",
        "username"              : "root",
        "serverName"            : "pbsserver",
        "secretAccessKey"       : "/root/.ssh/id_rsa",
        "local_shell"           : "/bin/sh",
        "binaries_dir"          : "/usr/local/bin/"
};
var pbsjs = require("./pbsjs.js")


// Generate a submission script with the parameters in jobArgs and save it inside localJobDir
pbsjs.qscript_js(jobArgs, localJobDir, callback(err,data))

// Submit a job with the following submissionScript and send the jobFiles along
pbsjs.qsub_js(pbs_config, [submissionScript, jobFiles, ..], callback(err,data))

// Gather server information
var server_info = pbsjs.qmgr_js();

// Gather node list
pbsjs.qnodes_js(pbs_config, callback(err,data))

// Gather job list
pbsjs.qstat_js(pbs_config, callback(err,data));

// Gather job information
pbsjs.qstat_js(pbs_config, jobId, callback(err,data));

// List files in working directory
pbsjs.qfind_js(pbs_config, jobId, callback(err,data));

// Download files from a working directory to the localJobDir
pbsjs.qretrieve_js(pbs_config, jobId, [jobFiles,..] , localJobDir, callback(err,data))

// Cancel a job
pbsjs.qdel_js(pbs_config, jobId, callback(err,data))

Output exemples

qmgr_js:

[ queues: [ { queue_type: 'Execution',
      'resources_default.nodes': '1',
      'resources_default.walltime': '01:00:00',
      enabled: 'True',
      started: 'True',
      name: 'batch' } ],
  server: { scheduling: 'True',
    acl_hosts: 'pbsserver',
    managers: 'root@pbsserver',
    ...} ]

qnodes_js:

[ { 
    name: 'node1',
    state: 'free',
    power_state: 'Running',
    np: '1',
    ntype: 'cluster',
    status: 'rectime',
    ...
    uname: 'Linux server_name 1.1.1-001.x86_64 #1 SMP Tue Jan 01 00:00:00 UTC 2016 x86_64',
    opsys: 'linux'
    },
    {
    name: 'node2',
    state: 'down',
    power_state: 'Running',
    np: '1',
    ntype: 'cluster',
    mom_service_port: '15002',
    mom_manager_port: '15003' 
    } ]

qstat_js:

[ {
    jobId: '0.pbsserver',
    name: 'testJob0',
    user: 'user',
    time: '0',
    status: 'Completed',
    queue: 'batch' 
    },
    {
    jobId: '1.pbsserver', 
    name: 'testJob1',
    user: 'user',
    time: '0',
    status: 'Running',
    queue: 'batch' 
    }]

About

Nodejs module to interact with a OpenPBS/Torque Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published