Skip to content

Commit c35c04f

Browse files
committed
1.0.0
1 parent abb2506 commit c35c04f

File tree

4 files changed

+406
-353
lines changed

4 files changed

+406
-353
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Snips
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+38-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,44 @@
11
# snips-actions-runner
2+
### A lightweight javascript actions runner.
23

3-
**Setup:**
4+
## Purpose
5+
6+
The standard way to run Snips actions is to use the [`snips-skill-server`](https://docs.snips.ai/articles/console/actions/actions/code-your-action/action-specifications#specifications) binary that comes pre-installed with the Snips distribution.
7+
8+
The way the `skill-server` works is that it runs one process per-action.
9+
10+
It means that a `node.js` instance is spawned and bindings to the hermes library are created for each action.
11+
12+
**This is perfectly fine is mosts cases**, but when the number of actions to run is huge or if the environment is memory constrained this can become a problem.
13+
14+
This package is an attempt to mitigate memory issues by running every javascript action using a single process.
15+
16+
## Setup
417

518
`npm i -g snips-actions-runner`
619

7-
**Usage:**
20+
*It is recommended to create a daemon to launch the runner automatically, but this is beyond the scope of this file.*
21+
22+
## Specifications
23+
24+
### Root folder
25+
26+
By default, the runner will look for actions in the `/var/lib/snips/skills` folder on linux, or `/var/lib/snips/skills` for macos.
27+
28+
For other oses, use the `-r` option to specify the root folder.
29+
30+
### Action
31+
32+
Each subfolder will then be scanned, and will be considered as an action **if and only if**:
33+
34+
1) It contains a `package.json` file.
35+
2) The `package.json` file has a `dependency` field that contains the [`snips-toolkit`](https://github.com/snipsco/snips-javascript-toolkit) package.
36+
3) The `package.json` file has a `main` field.
37+
38+
The file linked with the `main` field is then launched using a global `snips-toolkit` package ([in the same fashion as the run command](https://github.com/snipsco/snips-javascript-toolkit#snips-toolkit-run)).
39+
40+
## Usage
41+
42+
`snips-runner --help`
43+
844

9-
`snips-runner --help`

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "snips-actions-runner",
3-
"version": "0.1.1",
3+
"version": "1.0.0",
44
"description": "Snips javascript actions runner.",
5-
"main": "src/index.js",
5+
"main": "cli.js",
66
"bin": {
77
"snips-runner": "./cli.js"
88
},
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"chalk": "^2.4.2",
1313
"commander": "^2.20.0",
14-
"snips-toolkit": "^0.1.1"
14+
"snips-toolkit": "1.0.1"
1515
},
1616
"devDependencies": {
1717
"eslint": "^5.16.0"

0 commit comments

Comments
 (0)