Skip to content

Instantly share code, notes, and snippets.

@bennofs
Forked from narayandesai/gist:5de29170207396c98108
Last active August 29, 2015 14:04

Revisions

  1. bennofs revised this gist Jul 29, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ stdenv.mkDerivation rec {

    unpackPhase = "true";

    installPhase = "
    installPhase = ''
    set -x
    mkdir -p $out/bin

    @@ -28,5 +28,5 @@ installPhase = "

    EOF
    chmod +x $out/bin/mesos-spark-shell
    ";
    '';
    }
  2. @narayandesai narayandesai created this gist Jul 29, 2014.
    32 changes: 32 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    {stdenv, bash, jre, spark} :

    stdenv.mkDerivation rec {
    name = "mesos-spark-${version}";
    version = "1";

    unpackPhase = "true";

    installPhase = "
    set -x
    mkdir -p $out/bin

    cat > $out/bin/mesos-spark-shell <<EOF
    #!${bash}/bin/bash
    set -o posix
    export JAVA_HOME=${jre}
    export SPARK_HOME=${spark}/lib/spark-1.0.1-bin-cdh4

    for o in "\$@"; do
    if [ "\$1" = "-c" -o "\$1" = "--cores" ]; then
    shift
    if [ -n "\$1" ]; then
    OPTIONS="-Dspark.cores.max=\$1"
    shift
    fi
    fi
    done

    EOF
    chmod +x $out/bin/mesos-spark-shell
    ";
    }