Skip to content

Instantly share code, notes, and snippets.

View sanmiguel's full-sized avatar

Michael Coles sanmiguel

View GitHub Profile

The path to one-ness with Universe

In order to gain access to Universe, we must fulfil the requirements laid out in the currently open PR: mesosphere/universe#703

To achieve this, we must make some breaking changes to the Riak-Mesos Framework. Those changes, and the reasoning behind them, are laid out below.

For a long time we have discussed the path forward as being to a split-package world,

syntax on
set laststatus=2
set showtabline=2
set background=dark
set ignorecase
set smartcase
set clipboard+=unnamed " Copy to/paste from system clipboard
{
"riak": {
"scheduler": {
"cpus": 0.5,
"mem": 256.0
},
"executor": {
"cpus": 0.1,
"mem": 512.0
},

Change highlights:

  • IMPORTANT Persistent volumes/Data dir: the path for this is now $(executor-dir)/data, to avoid the contents of any of the artifacts over-writing the symlink Mesos creates for the persistent volume inside the executor's directory. The Executor is currently hard-coded to use this path. In future versions, this will be configurable. If you need to use this path in your custom Riak config, it is accessible via the data_dir template variable.
  • Riak config: No longer always require a riak.conf to be set for Riak TS clusters: instead, no default riak.conf is provided and we use the one that ships with the Riak you install. If you wish to customise the config that is used for your cluster, you can still do so in the same way (instructions here), but be aware that it is necessary for the executor to override the configuration items contained in [this file](https://github.com/basho-labs/riak-mesos-executor/blob

Flow

Eager model:

File.read!("source")
|> String.split("\n")
|> Enum.flat_map(&String.split/1)
-module(mylists).
% interleave X with Y.
interleave(X, Y) -> interleave(X, Y, []).
interleave([], [], A) -> A;
interleave([], T, A) -> lists:reverse(A) ++ T;
interleave(T, [], A) -> lists:reverse(A) ++ T;
interleave([X | XT], [Y | YT], A) -> interleave(XT, YT, [X, Y | A]);
% intersperse X among Ys
@sanmiguel
sanmiguel / neomake-mix-test.vim
Created January 18, 2016 20:55
neomake rules for mix test
let g:neomake_elixir_mix_maker = {
\ 'args': ['compile'],
\ 'errorformat':
\ '** %s %f:%l: %m,' .
\ '%f:%l: warning: %m'
\ }
let g:neomake_elixir_test_maker = {
\ 'exe': 'mix',
\ 'args': ['test'],
\ 'errorformat':
@sanmiguel
sanmiguel / mesos-slave-provision.sh
Last active January 8, 2016 19:57
mesos-slave-provision.sh
#!/bin/bash
# Create the 'mesos' user to run the executor as
useradd -d /home/mesos -m mesos
apt-get -y update
apt-get -y upgrade
# Use mesosphere's repo
apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
:version
NVIM 0.0.0-alpha+201510082018 (compiled Oct 9 2015 13:12:02)
Commit: 57d3a2a52fea57874d08472d0f8ee8f1bcee87c1
Build type: RelWithDebInfo
Compilation: /usr/local/Library/ENV/4.3/clang -Wconversion -O2 -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE
_CONFIG_H -I/tmp/neovim20151009-5219-20lk8u/build/config -I/tmp/neovim20151009-5219-20lk8u/src -I/tmp/neovim20151009-5219-20lk8u/deps-build/usr/include -I/tmp/neovim20151009-5219-20lk8u/deps-build/usr/include -I/tmp/neovim20151009-5219-20
lk8u/deps-build/usr/include/luajit-2.0 -I/tmp/neovim20151009-5219-20lk8u/deps-build/usr/include -I/tmp/neovim20151009-5219-20lk8u/deps-build/usr/include -I/tmp/neovim20151009-5219-20lk8u/deps-build/usr/include -I/tmp/neovim20151009-5219-2
0lk8u/deps-build/usr/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim20151009-5219-20lk8u/build/src/nvim/auto -I/tmp/neovim20151009-5219-20