proc_box

command module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 13 Imported by: 0

README

proc_box

proc_box is an open source, way of containerizing a process into a resource limited box suitable for batch systems. The primary goal is to limit resource explosion and causing other users of the batch system to receive unexpected resource pressure. This project also provides remote control of the process through AMQP JSON messages. Also, proc_box will emit statistical usage measurements of the contained process for analysis by other tools.

Build Status GoDoc

Go Report Card Average time to resolve an issue Percentage of issues still open

Features

  • Connects to an AMQP broker
  • Starts the contained process
  • Gracefully exits with either a simple remote control JSON or the process naturally existing.
  • Basic suspend/resume/quit/kill remote control support.
  • Controllable wall-clock timer to end runaway processes (also controlled over AMQP).
  • Captures SIGINT/etc. at proc_box level and issues appropriate signals to child process.
  • Periodic statistical samples of process usage (aggregated parent and children) emitted on AMQP.
  • Arguments directly on the command line or provided through environment variables. Command line overrides environment variables.

Requirements

Go; that's about it. We suggest the rabbitmq:3-management Docker container for development purposes.

Documentation

Use Godoc documentation under the agents package for reference.

Running

Generally, only specifying both the AMQP broker and the command to be contained is necessary.

./proc_box -uri <amqp_uri> <cmd> <args>
Remote Commands

Remote commands can be issued through the AMQP broker to the topic exchange specified (or default proc_box.remote_control). Messages should be in JSON of the form:

{
    "command": "<cmd>",
    "arguments": ["<arg1>", "<arg2>", ...],
}

Supported commands:

  • stop: Issue SIGQUIT to the process.
  • resume: Resume suspended process execution (and timeout timer).
  • suspend: Suspend the process execution.
  • kill: Issue SIGKILL to the process. Optional single argument is the signal to send (9 is default).
  • sample: Force a process statistics sample.
  • change_sample_rate: Change duration between process statistic samples.
  • timer_reset: Disables timer and sets ElapsedTime to zero.
  • timer_start: Enables timer ticking from an ElapsedTime of zero.
  • timer_stop: Disables timer
  • timer_resume: Continues ticking time without resetting.

License

proc_box is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/aybabtme/iocontrol
Package iocontrol offers `io.Writer` and `io.Reader` implementations that allow one to measure and throttle the rate at which data is transferred.
Package iocontrol offers `io.Writer` and `io.Reader` implementations that allow one to measure and throttle the rate at which data is transferred.
_workspace/src/github.com/jtolds/gls
Package gls implements goroutine-local storage.
Package gls implements goroutine-local storage.
_workspace/src/github.com/shirou/gopsutil/internal/common
gopsutil is a port of psutil(http://pythonhosted.org/psutil/).
gopsutil is a port of psutil(http://pythonhosted.org/psutil/).
_workspace/src/github.com/shirou/gopsutil/process
Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints.
Package binary implements simple translation between numbers and byte sequences and encoding and decoding of varints.
_workspace/src/github.com/smartystreets/assertions
Package assertions contains the implementations for all assertions which are referenced in goconvey's `convey` package (github.com/smartystreets/goconvey/convey) for use with the So(...) method.
Package assertions contains the implementations for all assertions which are referenced in goconvey's `convey` package (github.com/smartystreets/goconvey/convey) for use with the So(...) method.
_workspace/src/github.com/smartystreets/assertions/internal/oglematchers
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
_workspace/src/github.com/smartystreets/assertions/internal/oglemock/createmock
createmock is used to generate source code for mock versions of interfaces from installed packages.
createmock is used to generate source code for mock versions of interfaces from installed packages.
_workspace/src/github.com/smartystreets/assertions/internal/oglemock/generate
Package generate implements code generation for mock classes.
Package generate implements code generation for mock classes.
_workspace/src/github.com/smartystreets/assertions/internal/oglemock/generate/test_cases/complicated_pkg
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
Package complicated_pkg contains an interface with lots of interesting cases, for use in integration testing.
_workspace/src/github.com/smartystreets/assertions/internal/oglemock/generate/test_cases/renamed_pkg
A package that calls itself something different than its package path would have you believe.
A package that calls itself something different than its package path would have you believe.
_workspace/src/github.com/smartystreets/assertions/internal/ogletest
Package ogletest provides a framework for writing expressive unit tests.
Package ogletest provides a framework for writing expressive unit tests.
Functions for working with source code.
_workspace/src/github.com/smartystreets/assertions/internal/reqtrace
Package reqtrace contains a very simple request tracing framework.
Package reqtrace contains a very simple request tracing framework.
_workspace/src/github.com/smartystreets/assertions/should
package should is simply a rewording of the assertion functions in the assertions package.
package should is simply a rewording of the assertion functions in the assertions package.
_workspace/src/github.com/smartystreets/goconvey/convey
Package convey contains all of the public-facing entry points to this project.
Package convey contains all of the public-facing entry points to this project.
_workspace/src/github.com/smartystreets/goconvey/convey/gotest
Package gotest contains internal functionality.
Package gotest contains internal functionality.
_workspace/src/github.com/smartystreets/goconvey/convey/reporting
Package reporting contains internal functionality related to console reporting and output.
Package reporting contains internal functionality related to console reporting and output.
_workspace/src/github.com/streadway/amqp
AMQP 0.9.1 client with RabbitMQ extensions Understand the AMQP 0.9.1 messaging model by reviewing these links first.
AMQP 0.9.1 client with RabbitMQ extensions Understand the AMQP 0.9.1 messaging model by reviewing these links first.
_workspace/src/github.com/streadway/amqp/examples/simple-consumer
This example declares a durable Exchange, an ephemeral (auto-delete) Queue, binds the Queue to the Exchange with a binding key, and consumes every message published to that Exchange with that routing key.
This example declares a durable Exchange, an ephemeral (auto-delete) Queue, binds the Queue to the Exchange with a binding key, and consumes every message published to that Exchange with that routing key.
_workspace/src/github.com/streadway/amqp/examples/simple-producer
This example declares a durable Exchange, and publishes a single message to that Exchange with a given routing key.
This example declares a durable Exchange, and publishes a single message to that Exchange with a given routing key.
Package agents provides individual handlers for managing portions of controlling or observing a contained process.
Package agents provides individual handlers for managing portions of controlling or observing a contained process.

Jump to

Keyboard shortcuts

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