News about the Go Circuit project.

Notes on the XDATA-M2 checkpoint of the new circuit utility

Tue, Nov 19, 2013

What it does

It is an executable utility which allows you to control your entire datacenter at a process-level by issuing local file system operations on any one host in the datacenter.

In other words, from the shell on any host you can command the entire datacenter, and similarly from any programming language (even single-threaded languages like PHP) you can orchestrate concurrent datacenter-wide logic by issuing sequences of local file system operations.

At high level, the circuit utility creates a Go-like runtime environment across the datacenter, which supports creation and manipulation of a few primitive types of objects (channel, mutex, process, select) which are allocated within the /circuit file system and are globally accessible to all participating hosts via their local /circuit directories.

Quick start

1. Fetch, build, install
	% hg clone https://code.google.com/p/gocircuit/
	% cd gocircuit
	% export PATH=$PATH:$PWD/bin
	% cd src/circuit/cmd/circuit
	% go install
2. Run the circuit utility on a cluster of hosts H1, H2, ..., Hn.
On host H1:
	% circuit -a=H_1:PORT_1 -m=MOUNT_POINT -xfs=LOCAL_SHARED_DIR
The circuit will print out the URL of the newly started worker on stdout. It should look like:
Copy it.
On all other hosts H_K, where K = 2, ..., n, run:
	% circuit -a=H_K:PORT_K -m=MOUNT_POINT -xfs=LOCAL_SHARED_DIR \
Here H_J can be any host that is already running the circuit at the time the command above is executed on H_K.
3. Using the circuit

Say you are currently logged in any one host H_K. And say you mounted the circuit on /circuit.

Go to /circuit and explore. Most directories have a help file within them. Cat it. It will tell you what you can do.