Skip to content

Instantly share code, notes, and snippets.

View ConnorDoyle's full-sized avatar
💫

Connor Doyle ConnorDoyle

💫
View GitHub Profile
@ConnorDoyle
ConnorDoyle / config.json
Last active August 29, 2015 14:14
Mesos-DNS Config Example
{
"masters": ["10.49.138.253:5050"],
"refreshSeconds": 20,
"ttl": 20,
"domain": "mesos",
"port": 53,
"resolvers": ["213.186.33.99","8.8.8.8"],
"timeout": 5
}
@ConnorDoyle
ConnorDoyle / chronos-framework.sh
Created January 13, 2015 22:21
Chronos run script
#!/bin/bash
set -o errexit -o nounset -o pipefail
function -h {
cat <<USAGE
USAGE: chronos-framework (--jar <chronos.jar>)? <option>*
Run the chronos scheduler, collecting options from the configuration
directory and appending the options supplied on the command line.
$conf_dir

Reconciliation

There's no getting around it, frameworks on Mesos are distributed systems.

Distributed systems must deal with failures, and partitions (the two are indistinguishable from a system's perspective).

Concretely, what does this mean for frameworks? Mesos uses an actor-like message passing programming model, in which messages are delivered at-most-once. (Exceptions to this include task status updates, most of

@ConnorDoyle
ConnorDoyle / bridged.json
Created September 10, 2014 06:12
Marathon app definition demonstrating how to run a task inside a docker container with bridged networking.
{
"id": "bridged-webapp",
"cmd": "python3 -m http.server $PORT0",
"cpus": 0.5,
"mem": 64.0,
"instances": 2,
"container": {
"type": "DOCKER",
"docker": {
"image": "python:3",
type Function1[-A,+B]
case class A(x: Int)
case class B(x: Int) extends A(x)
val alpha: A => Unit = { a => ??? }
val beta: B => Unit = { b => ??? }
def gamma(f: B => Unit) = ???
POST /v2/apps HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Length: 327
Content-Type: application/json; charset=utf-8
Host: mesos.vm:8080
User-Agent: HTTPie/0.8.0
{
"cmd": "sleep 60",
#!/bin/bash
search_paths='/usr/lib /usr/local/lib'
echo "MESOS_NATIVE_JAVA_LIBRARY is not set. Searching in $search_paths."
export MESOS_NATIVE_JAVA_LIBRARY=$(find -L $search_paths -name libmesos.dylib -or -name libmesos.so 2>/dev/null | head -n1)
export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY
java -jar target/scala-2.10/marathon-assembly-0.7.0-SNAPSHOT.jar --master 10.141.141.10:5050 --zk zk://10.141.141.10:2181/marathon
@ConnorDoyle
ConnorDoyle / STDERR
Created August 27, 2014 19:57
Docker Debug
I0827 19:56:09.255442 7392 exec.cpp:132] Version: 0.20.0
I0827 19:56:09.258818 7410 exec.cpp:206] Executor registered on slave 20140827-191134-16842879-5050-1574-0
echo "SF: "$(TZ=America/Los_Angeles date) && echo "HH: "$(TZ=Europe/Berlin date)
@ConnorDoyle
ConnorDoyle / nothing.cpp
Created June 30, 2014 18:32
Seeing into nothing
// "Seeing into nothingness-this is the true seeing, the eternal seeing." ~Shen Hui
Promise<Nothing> promise;