To understand development of Mesos Framework, I developed a simple useless framework example called msh.
Usage
At first, you should distribute this directory to the all slaves on the same location.
Then, you can run msh command on any server. For example:
$ cat /etc/hosts | ./msh -- cat -n 2>/dev/null
1 127.0.0.1 localhost
2
3 # The following lines are desirable for IPv6 capable hosts
4 ::1 ip6-localhost ip6-loopback
5 fe00::0 ip6-localnet
6 ff00::0 ip6-mcastprefix
7 ff02::1 ip6-allnodes
8 ff02::2 ip6-allrouters
9 ff02::3 ip6-allhosts
Internal
mshlaunches amsh-executorusing one of resource offersmsh-executorstarts the given command as a subprocessmshreads its stdin and send the input to the slave as FrameworkMessagemsh-executorreceives messages and write them to the subprocess.stdinmsh-executorreads the subprocess.stdout and sends the output tomshas FrameworkMessage- Each other sends a message ‘EOF’ as a signal of end of the pipe
mshprints received message
TODO
- work with no stdin
- streaming pipe
- pipe multiple tasks like UNIX shell
- interactive shell
- error handling
Conclusion
Development of Mesos framework in Python is very easy. I hope this toy project is useful for someone who is interested in Mesos.