To simply control tmux sessions to deploy pre-configured software system very easily. All it needs is a configuration file (in YAML) and different sub-systems (defined as different windows in a joint tmux sessions) can be launch and stopped conveniently.
tmux features windows which can have different panes. In TMuLE windows correspond to sub-systems that can be launch and stopped independently of others, but always are launched or stopped together. Each pane in a window runs one of a set of commands belonging to one sub-system.
The configuration file uses YAML format.
- an
init_cmdcan be defined which is executed in each pane before the actual command is run. - the
windowsare a list of individual windows that will be created in the tmux session. Each corresponds to one sub-system. - Each window is given a
name, and a list ofpanes - the entries in the
paneslist, are shell scripts commands that are executed as is in the tmux session shell (i.e. bash) - you can also include other yaml files using the
!includestatement.
For an example look at tmule.yaml, and robot1.yaml for an example of !include.
Just run tmule -h, output whould be something like this:
usage: tmule [-h] [--config CONFIG] [--init INIT] [--session SESSION]
{list,launch,stop,relaunch,terminate,server,pids,running} ...
positional arguments:
{list,launch,stop,relaunch,terminate,server,pids,running}
sub-command help
list show windows
launch launch window(s)
stop stop windows(s)
relaunch relaunch windows(s)
terminate kill window(s)
server run web server
pids pids of processes
running returns true of there is a process running in the
window
optional arguments:
-h, --help show this help message and exit
--config CONFIG JSON config file. see sample-config.json. Default:
spqrel-pepper-config.json
--init INIT Should tmux be initialised? Default: True
--session SESSION The session that is controlled. Default: spqrel```
Note: If you are using the default config file, you can obviously skip using the --config option below.
-
list the windows in the tmux session:
tmule --config tmule.yaml listIf the
initoption is not explicitly set toFalsethis will create (or attach to) the default (spqrel) tmux session, and will make sure that all the windows that are configured and required panes are created. -
launch one specific window (sub-system):
tmux -config tmule.yaml launch -w htopThis will launch all the configured commands in the
htopwindow in their two respective panes. -
stop the processes of a window (sub-system):
tmule -config tmule.yaml stop -w htopThis command will send
Ctrl-Cto all the panes of thehtopwindow, and hence stop all the processes in there. -
kill the processes of a window (sub-system):
tmule -config sample.json kill -w navigationThis command will send
Ctrl-Cto all the panes of thehtopwindow just likestopwould do, but follows this with a properkill -9for all child processes to make sure everything is sure and properly gone. It will also close the respective window in the session. -
if in any of the above commands, now window is specified (no
-wor--windowoption given), the command will apply to ALL configured windows (sub-systems), e.g.tmule -config tmule.yaml launchwill launch all processes
tmule -config tmule.yaml killwill shut everything down and in fact close the tmux session
-
Manual interaction with the tmux session:
tmux a -t tmuleThis will attach to the default TMuLE session, allwoing manual inspection and interaction with the session (e.g. watching the output of the individual processes, or even starting and stopping them manually)
Use
Ctrl-b dto detach from the session again, orCtrl-b wto switch between different windows.
- edit
setup.pyto bump up version string - create a tag (not strictly needed, but good practice):
git commit -a && git tag `grep "VERSION =" setup.py | sed "s/VERSION = '\([0-9\.]*\)'/\1/"` git push --tags - clean dist directory
rm -r dist/* tmule.egg-info/ - build dist
python setup.py sdist - upload
twine upload dist/*
fpm -s virtualenv -t deb --prefix /opt/tmule --name tmule_standalone tmule