Skip to content
Vamp Workflow Agent
TypeScript Go Shell Makefile Dockerfile HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea/codeStyles
files
ui
.dockerignore
.gitignore
Dockerfile
LICENSE
Makefile
README.md
api.go
http.go
main.go
package.json
run.go
yarn.lock

README.md

Vamp Workflow Agent

Join the chat at https://gitter.im/magneticio/vamp Docker Build Status Download

  • retrieves a workflow JavaScript file using confd
  • launches Node.js runtime to execute the script
  • gives an overview (UI) of script execution

Usage

$ ./vamp-workflow-agent -help
                                       
Usage of ./vamp-workflow-agent:
  -help
        Print usage.
  -httpPort int
        HTTP port. (default 8080)
  -uiPath string
        Path to UI static content. (default "./ui/")
  -workflow string
        Path to workflow file. (default "/usr/local/vamp/workflow.js")
  -executionPeriod int
        Period between successive executions in seconds (0 if disabled).
  -executionTimeout int
        Maximum allowed execution time in seconds (0 if no timeout).

Some arguments are mandatory and if they are not provided, agent will try to get them from environment variables. For environment variable names check out Executing Workflow.

Building Binary

Using make:

make vamp-workflow-agent

Alternatively:

go get -d ./...
go install
CGO_ENABLED=0 go build -v -a -installsuffix cgo

Released binaries can be also downloaded.

Building Docker Images

Building the vamp-workflow-agent Docker image includes building the Go binary, downloading the vamp-node-client and building the workflow UI.

make

Docker images after the build: magneticio/vamp-workflow-agent:katana

For more details on available targets see the contents of the Makefile.

Executing Workflow

Vamp Workflow Agent:

  • retrieves workflow script
  • saves it as /usr/local/vamp/workflow.js
  • executes node /usr/local/vamp/workflow.js

Important environment variables:

  • VAMP_KEY_VALUE_STORE_TYPE <=> confd -backend
  • VAMP_KEY_VALUE_STORE_CONNECTION <=> confd -node
  • VAMP_KEY_VALUE_STORE_PATH <=> key used by confd
  • VAMP_WORKFLOW_EXECUTION_PERIOD <=> $executionPeriod
  • VAMP_WORKFLOW_EXECUTION_TIMEOUT <=> $executionTimeout
  • VAMP_ELASTICSEARCH_URL <=> http://elasticsearch:9200

Parameters related to Vamp Node.js client:

  • VAMP_URL
  • VAMP_API_CACHE - true by default
  • VAMP_API_TOKEN
  • VAMP_NAMESPACE
  • VAMP_CA - optional path to CA file
  • VAMP_TLS_CHECK - true by default

Vamp JavaScript API vamp-node-client

More details: package.json

Docker Images

Docker Hub repo.

Example:

docker run -e VAMP_KEY_VALUE_STORE_TYPE=zookeeper \
           -e VAMP_KEY_VALUE_STORE_CONNECTION=localhost:2181 \
           -e VAMP_KEY_VALUE_STORE_PATH=/scripts \
           -e VAMP_WORKFLOW_EXECUTION_PERIOD=0 \
           -e VAMP_WORKFLOW_EXECUTION_TIMEOUT=10 \
           -e VAMP_ELASTICSEARCH_URL=http://localhost:9200 \
           magneticio/vamp-workflow-agent:katana

In this example JavaScript is read from /scripts entry.

You can’t perform that action at this time.