Methods
(async) beforeExit()
- Description:
An async function that cleanup all resources before exit the Adapter process and after all jobs are finished or errored.
- Source:
(async) beforeStart()
- Description:
An async function that preparing all required resources to run tasks.
- Source:
(async) detectJobStatus()
- Description:
Some Jobs may be sent to remote computing resources so the we cannot determine when does the
this.runningJobs[jobId].jobEmitter
emit the finish or error event in the jobSpawn function. ThisdetectJobStatus
function can be implemented to check if the job is finished or has errors. Returns nothing.
- Source:
(async) determineJobProxy(jobObj) → {Proxy|null}
Parameters:
Name | Type | Description |
---|---|---|
jobObj |
JobDefinition |
Returns:
- Type
- Proxy | null
(async) jobDeploy(jobObj) → {RunningJob}
Parameters:
Name | Type | Description |
---|---|---|
jobObj |
JobDefinition |
Returns:
a runningJob object that at least contains the jobEmitter that emits 'finished' or 'error'
- Type
- RunningJob
(async) jobExitCallback(jobObj, exitCode, signal) → {processExit}
Parameters:
Name | Type | Description |
---|---|---|
jobObj |
JobDefinition | The job definition object |
exitCode |
number | |
signal |
string | The terminating signals such as SIGTERM, SIGINT if exists. For normal task execution, the signal will be |
Returns:
Process exit object, e.g. {exitCode: 0, signal: null}
- Type
- processExit
(async) jobOverrides(jobObj, argumentRecipe) → {JobDefinition}
- Description:
implement this function to overrides the job definitions. Each implemented adapter should override this function to formulate your command patterns for your computing resources If you use an argument-recipe yaml file to formulate your runtime arguments, remember to call
await super._parseRecipe(jobObj, argumentRecipe);
inside the implemented version Also, developers need to change the JobDefinition.option.mem to an accepted format. The JobDefinition.option.mem is memory size in bytes. Use the humanizeMemory filter function (@big-data-processor/utilities.memHumanize) to convert bytes into other formats, e.g. 1000000 to 1MB (or 1m); 1024 to 1KiB.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
jobObj |
JobDefinition | |
argumentRecipe |
string | The recipe content to transform the JobDefinition.taskArgs into runtime arguments. |
Returns:
- Type
- JobDefinition