runner

command module
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

runner

Build Status codecov Go Report Card License Tag

Introduction

runner is the runner of pipego written in Go.

Prerequisites

  • Go >= 1.18.0

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:
  --help                   Show context-sensitive help (also try --help-long and --help-man).
  --version                Show application version.
  --listen-url=LISTEN-URL  Listen URL (host:port)

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"
      ],
      "livelog": 5000
    }
  }
}

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.livelog: maximum lines in livelog

Output

{
  "output": {
    "pos": 1,
    "time": "1136214245000000000",
    "message": "text"
  },
  "error": "text"
}
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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL