The abstraction layer around jobs, allows pull a job from your API and report logs & status
1.1K
The abstraction layer around jobs, allows pull a job from your API periodically, call-back your API, observe execution time and to control concurrent execution.
It's responsible for getting the commands from your API, running commands, and streaming the logs back to your API. It also sends state updates to your API.
Find the version you wish to install on the GitHub Releases
page and download either the
darwin-amd64 binary for MacOS or the linux-amd64 binary for Linux. No other
operating systems or architectures have pre-built binaries at this time.
[!WARNING] Running releasses on MacOs: You need to download file, extract it and remove attributes with the following command (where /Users/weldpua2008/Downloads/supraworker_darwin_amd64/supraworker is path to the file)
$ xattr -d com.apple.quarantine /Users/weldpua2008/Downloads/supraworker_darwin_amd64/supraworker
$ /Users/weldpua2008/Downloads/supraworker_darwin_amd64/supraworker
brew tap weldpua2008/tap
brew install weldpua2008/tap/supraworker
To update to the latest, run
brew upgrade weldpua2008/tap/supraworker
Define config at $HOME/supraworker.yaml:
[!WARNING] Keys are not case sensitivity (https://github.com/spf13/viper/pull/635#issuecomment-580659676): Viper's default behaviour of lowercasing the keys for key insensitivity is incompatible with these standards and has the side effect of making it difficult for use cases such as case sensitive API credentials in configuration. For eg: MyApiKey=MySecret
# ClientId in case you need to identify the worker
clientId: "my_uniq_client_id"
# how ofen call your API
api_delay_sec: 10
# jobs related operations
jobs:
get:
url: "http://localhost:80/get/new/job"
method: POST
headers:
"Content-type": "application/json"
params:
"clientid": "{{ .ClientId}}"
curl --silent -L "https://api.github.com/repos/weldpua2008/supraworker/releases/latest" \
| jq --arg PLATFORM_ARCH "$(echo `uname -s`_amd| tr '[:upper:]' '[:lower:]')" -r '.assets[] | select(.name | contains($PLATFORM_ARCH)).browser_download_url' \
| xargs -I % curl -sSL % \
| sudo tar --strip-components=1 -xzf -
v1.13+$GOPATHmkdir -p $GOPATH/src/github.com/weldpua2008git clone https://github.com/weldpua2008/supraworker $GOPATH/src/github.com/weldpua2008/supraworkercd $GOPATH/src/github.com/weldpua2008/supraworkerdocker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.24.0 golangci-lint run -v$ go clean -testcache
$ go test -bench= -test.v ./...
Content type
Image
Digest
Size
11.7 MB
Last updated
over 5 years ago
docker pull weldpua2008/supraworker