runner

Introduction
runner is the runner of pipego written in Go.
Prerequisites
Run
version=latest make build
./bin/runner --listen-url=:29090
Docker
version=latest make docker
docker run ghcr.io/pipego/runner:latest --listen-url=:29090
Usage
usage: runner --listen-url=LISTEN-URL [<flags>]
pipego runner
Flags:
--[no-]help Show context-sensitive help (also try --help-long and --help-man).
--[no-]version Show application version.
--listen-url=LISTEN-URL Listen URL (host:port)
--log-level="INFO" Log level (DEBUG|INFO|WARN|ERROR)
Protobuf
1. Task
{
"apiVersion": "v1",
"kind": "runner",
"metadata": {
"name": "runner"
},
"spec": {
"task": {
"name": "task",
"file": {
"content": "bytes",
"gzip": true
},
"params": [
{
"name": "env",
"value": "val"
}
],
"commands": [
"cmd",
"argv"
],
"log": {
"width": 500
}
}
}
}
task.file: script file in Bash
task.file.content: bytes
The shebang in task.file.content should be one of below:
#!/bin/bash
#!/usr/bin/env bash
task.file.gzip: boolean
task.params: parameter and value
name1=value1 ($name1: value1)
name2=$name1 ($name2: value1)
name3=$name2 ($name3: value1)
name4=$$name1 ($name4: 790name1, the PID of this script)
name4=${BASHPID}name1 ($name4: 790name1, the PID of current instance)
name5=#name1 ($name5: #name1, invalid symbol in Bash)
task.commands: command and argument
task.log: task log
task.log.width: line width in runes (default: 500)
Output
{
"pos": 1,
"time": "1136214245000000000",
"message": "text"
}
pos: line position
time: Unix timestamp
message: line message in string
The tag in the line and file as below:
BOL: break of line
EOF: end of file
2. Glance
{
"apiVersion": "v1",
"kind": "runner",
"metadata": {
"name": "runner"
},
"spec": {
"glance": {
"dir": {
"path": "/path/to/name"
},
"file": {
"path": "/path/to/name",
"maxSize": 1000
},
"sys": {
"enable": true
}
}
}
}
glance.dir: list directory contents
glance.file: fetch file content in base64
glance.file.maxSize: maximum file size in bytes
glance.sys: show system info
glance.sys.enable: boolean
Output
{
"dir": {
"entries": [
{
"name": "name",
"isDir": true,
"size": 1000,
"time": "2006-01-02 15:04:05",
"user": "name",
"group": "name",
"mode": "drwxr-xr-x"
}
]
},
"file": {
"content": "base64",
"readable": true
},
"sys": {
"resource": {
"allocatable": {
"milliCPU": 16000,
"memory": 12871671808,
"storage": 269490393088
},
"requested": {
"milliCPU": 12,
"memory": 618688512,
"storage": 19994185728
}
},
"stats": {
"cpu": {
"total": "16 CPU",
"used": "0%"
},
"host": "172.23.179.208",
"memory": {
"total": "11 GB",
"used": "0 GB"
},
"os": "Ubuntu 20.04",
"storage": {
"total": "250 GB",
"used": "18 GB"
}
}
},
"error": "text"
}
License
Project License can be found here.
Reference