Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taskcontrols/js-taskcontrol
Control, Create, Run named workflows & tasks with before/after middlewares support, data persistence, orm, authentication, logging, multi-threading/processing, events, network sockets, webhooks, client-agent libraries, etc with plugins support [Actively Developed, Funding invited] - npm install taskcontrol https://www.npmjs.com/package/taskcontrol
https://github.com/taskcontrols/js-taskcontrol
aws aws-devops azure azure-devops devops devops-tools gcp middlewares nodejs serverless task-queue task-runner typescript workflow-automation workflow-tool workflows
Last synced: 2 months ago
JSON representation
Control, Create, Run named workflows & tasks with before/after middlewares support, data persistence, orm, authentication, logging, multi-threading/processing, events, network sockets, webhooks, client-agent libraries, etc with plugins support [Actively Developed, Funding invited] - npm install taskcontrol https://www.npmjs.com/package/taskcontrol
- Host: GitHub
- URL: https://github.com/taskcontrols/js-taskcontrol
- Owner: taskcontrols
- License: mit
- Created: 2020-05-08T17:53:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-25T20:55:23.000Z (over 1 year ago)
- Last Synced: 2024-10-31T18:38:03.151Z (3 months ago)
- Topics: aws, aws-devops, azure, azure-devops, devops, devops-tools, gcp, middlewares, nodejs, serverless, task-queue, task-runner, typescript, workflow-automation, workflow-tool, workflows
- Language: JavaScript
- Homepage: https://taskcontrols.github.io/
- Size: 670 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# taskcontrol (js-taskcontrol)
## INDEVELOPMENT - DO NOT USE
##### Workflow Automation Library with support for Concurrent or Event based processes or activities in Local/Network Automation Tasks, including CI/CD activities.
* `taskcontrol (js-taskcontrol)` is a python library to create tasks in and based on named workflow controls. It allows middlewares before and after each task with support for concurrent processing. taskcontrol can run single or multiple tasks during task invocation/runs.
* It provides a simple decorator called `workflow` that takes arguments to set up the named workflow controls. It also provides methods to create a plugin and allow working with tasks as a module and/or pre-created ordered task list. Taskcontrol allows for scaling of plugin development with various utilities like authentication, logging, concurrency, sockets, events, publisher-subscriber architectures, webhooks, client-server http api servers etc.# Features
* In-Development: Create Named task controls (tasks) - instance and isolated
* In-Development: Allows before / after middlewares for each task
* In-Development: Access read-only contexts and results of middlewares/tasks
* In-Development: Allows merging two instances of task controls with namespace clash handling
* In-Development: Run instance, shared, and mix of tasks (individual or all groups)
* In-Development: Allows working with Logging, Sockets, Events, Queues, Publisher-Subscriber Architectures, etc
* In-Development: Allows support for / working with Concurrency
* In-Development: Allows working with Commands & Scripts (Todo), SSH (Todo), etc
* In-Development: Allows working with Files (Todo - normal, yaml, ini, and csv), Scheduling (Todo), etc
* In-Development: Allows working with ORMs/Databases (Todo), Authentication (Todo), and best practices like Dependency Injection (Todo) within the library, tasks, and workflows
* In-Development: Allows creating, registering, and using tasks/workflows as a plugin
* In-Development: Provided in and Allows plugins support for Python, Javascript languages![Features](./docs/architecture/Taskcontrols%20Features.jpg "Taskcontrols Features")
# Installation
##### Command:
* Node.js
npm install taskcontrol
##### Version:
In Development Version: py-taskcontrol V1.2.6 equivalent (functional - production ready with plugin and concurrency support, fully tested)
[Releases](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/releases.md) Lists in short the releases of the package
##### Package Link:
https://github.com/taskcontrols/js-taskcontrol
https://www.npmjs.com/package/taskcontrol
##### Website:
https://taskcontrols.github.io/# Supported Architectures within the Library
### Workflow Task Execution Architecture
![Workflow Execution Architecture](./docs/architecture/Workflow%20Architecture.jpg "Workflow Execution Architecture")
![Workflow Task Execution Architecture](./docs/architecture/Workflow%20Task%20Architecture.jpg "Workflow Task Execution Architecture")
### Publisher Subscriber, Message Queue, and Two Way Socket Events Architecture
![Message Queue Architecture](./docs/architecture/MESSAGE%20QUEUE%20ARCHITECTURE.jpg "Message Queue Architecture")
![Publisher Subscriber Architecture](./docs/architecture/PUBLISHER%20SUBSCRIBER%20ARCHITECTURE.jpg "Publisher Subscriber Architecture")
![Two Way Socket Events Architecture](./docs/architecture/TWO%20WAY%20EVENTS%20SOCKETS%20SERVER%20ARCHITECTURE.jpg "Two Way Socket Events Architecture")
### Server - Client Agentless SSH Architecture
![Agentless Architecture](./docs/architecture/SERVER%20-%20CLIENT%20AGENTLESS%20SSH%20ARCHITECTURE.jpg "Agentless Architecture")
### Server - Client Agent Architecture
![Server-Client Agent Architecture](./docs/architecture/SERVER%20AGENT%20-%20CLIENT%20AGENT%20ARCHITECTURE.jpg "Server - Client Agent Architecture")
### REST API Architecture
![REST API Access Architecture](./docs/architecture/REST%20API%20ARCHITECTURE.jpg "REST API Access Architecture")
### Webhooks Architecture
![Webhooks Architecture](./docs/architecture/WEBHOOKS%20ARCHITECTURE.jpg "Webhooks Architecture")
### Authentication and Data Persistence Architecture
![Authentication and Data Persistence Architecture](./docs/architecture/PERSISTENT%20DATA%20PLUS%20AUTHENTICATION%20ARCHITECTURE.jpg "Authentication and Data Persistence Architecture")
# Technical Specifications
##### Requirements:
* Node 11.x and above
* Any OS supporting Node 11.x and above##### Package Dependencies:
* None
##### Quick Demo:
[demo example - main.js](https://github.com/taskcontrols/js-taskcontrol/blob/master/main.js)
```js
const workflow = require("./lib/index").workflow
const Tasks = require("./lib/index").Taskssparrow = Tasks()
function middleware_trees(ctx, result, k, c, d){
console.log("Running my Middleware Function: middleware_trees - task items", k, c, d)
}
function taskone(ctx, result, a, b):
console.log("Running my task function: taskone", a, b)// decorator not allowed
// decorator support for TS, use TS version
workflow(
// JS-Python version difference
// taskfunction to run
taskone,
// name
"taskname",
// task_order
1,
// task_instance
sparrow,
// shared
False,
// args
[1, 2],
// JS-Python version difference
// // kwargs ()
// {},
// before
[
{
"function": middleware_trees,
"args": [11, 12],
// JS-Python version difference
// "kwargs": {"d": "Before Testing message Middleware "},
"options": {"error": "next", "error_next_value": ""}
}
],
// after
[
{
"function": middleware_trees,
"args": [13, 14],
// JS-Python version difference
// "kwargs": {"d": "After Middleware Testing message"},
"options": {
"error": "error_handler",
"error_next_value": "value",
"error_handler": lambda err, value: (err, None)
}
}
],
// log
False
)// Run single task
tasks="taskname"
sparrow.run(tasks)// Run all tasks
tasks=["1"]
sparrow.run(tasks)// tasks=["taskname", ..., "anothertask"]
// sparrow.run(tasks)```
##### Note:
Though it does not support Node version 8.x and above. However, it has not been tested in 8.x. The Syntax and Features of the library supports Node version 11.x due to multithreading environment. All other features may work. However, use at your own risk.
# Wiki
* [Getting started](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/getting-started.md)
Describes in short the usage of the package* [taskcontrol `workflow` decorator / function](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/workflow.md)
Describes how to use the taskcontrol workflow decorator in detail* [taskcontrol `workflow` decorator / function argument details](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/workflow-arguments.md)
Describes in detail the arguments of workflow decorator* [taskcontrol `workflow` before / after argument for middleware declaration](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/workflow-middlewares.md)
Describes creating, defining, and running middlewares* [taskcontrol `workflow` instance and shared tasks argument](https://github.com/taskcontrols/js-taskcontrol/blob/master/docs/users/workflow-instance-shared-tasks.md)
Describes creating a instance (isolated task) and an shared task (available to all instances)##### Crazy Hint:
You can also create a simple workflow without taskcontrol using a simple list or nested list and loop through them using a for/while loop and invoke them during looping```js
// Loop the lists below and invoke the functions
let lst = ["f1", "f2", "f3"]
let nest_lst = [["f1", "f2"], "f3", "f4", ["f5"]]// Use a reducer if you want to send args to next function like below
function test(a,b){
console.log(a,b)
return {"a":a, "b":b}
}
function tester(a,b){
console.log(a,b)
return null
}kwargs_for_first_function_the_its_returns_or_other_value_for_next_func = {"a":"a", "b":"b"}
ls = [kwargs_for_first_function_the_its_returns_or_other_value_for_next_func, test, tester]
function red(kwargs_for_first_then_func, p){
let i = p(kwargs.get("a"), kwargs.get("b"))
return i
}
ls.reduce(red)```
# [Todo](https://github.com/taskcontrols/js-taskcontrol/blob/master/.todo)
* e2e and Unit Tests - Add Tests (Structure of package created - to be cleaned after writing tests)
* Allow creating and registering a set of task controls as a plugin
* Allow working with commands (Todo), ssh (Todo), Files (Todo - normal, yaml, ini, json, and csv), Scheduling (Todo), Dependency Injection (Todo), ORMs/Databases (Todo), Authentication (Todo)
* [C?] Consider Workflow/Tasks tracking system and Dashboard with its own progress and logging
* [C?] Consider compatibility to Chef/CircleCI/Github/Other Automation tools, atleast as external added plugins# Status
* In Active Development (taskcontrol version py-taskcontrol V1.2.6 equivalent)
- Check https://github.com/taskcontrols/py-taskcontrol/ for features# Support
[Paypal.me/taskcontrols](https://paypal.me/taskcontrols)
[Be a Patreon](https://www.patreon.com/taskcontrols)
# License
The MIT License (MIT) - See [LICENSE](https://github.com/taskcontrols/js-taskcontrol/blob/master/LICENSE) for further details
Copyright © 2020 - till library works