Merge pull request #7722 from cstrahan/mesos-0.22.0

mesos: 0.21.0 -> 0.22.0
This commit is contained in:
Charles Strahan 2015-05-10 19:40:43 -04:00
commit 26cf4a6684
3 changed files with 65 additions and 35 deletions

View File

@ -40,10 +40,10 @@ in {
extraCmdLineOptions = mkOption {
description = ''
Extra command line options for Mesos Master.
Extra command line options for Mesos Master.
See https://mesos.apache.org/documentation/latest/configuration/
'';
See https://mesos.apache.org/documentation/latest/configuration/
'';
default = [ "" ];
type = types.listOf types.string;
example = [ "--credentials=VALUE" ];
@ -82,20 +82,21 @@ in {
wantedBy = [ "multi-user.target" ];
after = [ "network-interfaces.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.mesos}/bin/mesos-master \
--port=${toString cfg.port} \
--zk=${cfg.zk} \
${if cfg.quorum == 0 then "--registry=in_memory" else "--registry=replicated_log --quorum=${toString cfg.quorum}"} \
--work_dir=${cfg.workDir} \
--logging_level=${cfg.logLevel} \
${toString cfg.extraCmdLineOptions}
'';
Restart = "on-failure";
PermissionsStartOnly = true;
ExecStart = ''
${pkgs.mesos}/bin/mesos-master \
--port=${toString cfg.port} \
${if cfg.quorum == 0
then "--registry=in_memory"
else "--zk=${cfg.zk} --registry=replicated_log --quorum=${toString cfg.quorum}"} \
--work_dir=${cfg.workDir} \
--logging_level=${cfg.logLevel} \
${toString cfg.extraCmdLineOptions}
'';
Restart = "on-failure";
PermissionsStartOnly = true;
};
preStart = ''
mkdir -m 0700 -p ${cfg.workDir}
mkdir -m 0700 -p ${cfg.workDir}
'';
};
};

View File

@ -1,35 +1,38 @@
{ stdenv, lib, makeWrapper, fetchurl, curl, sasl, openssh, autoconf
, automake, libtool, unzip, gnutar, jdk, maven, python, wrapPython
, setuptools, distutils-cfg, boto, pythonProtobuf, apr, subversion
, leveldb, glog
, leveldb, glog, perf, utillinux, libnl, iproute
}:
let version = "0.21.0";
in stdenv.mkDerivation {
dontDisableStatic = true;
let
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
soext = if stdenv.system == "x86_64-darwin" then "dylib" else "so";
in stdenv.mkDerivation rec {
version = "0.22.0";
name = "mesos-${version}";
dontDisableStatic = true;
src = fetchurl {
url = "http://www.apache.org/dist/mesos/${version}/mesos-${version}.tar.gz";
sha256 = "01ap8blrb046w26zf3i4r7vvnnhjsbfi20vz5yinmncqbzjjyx6i";
sha256 = "0z8c1vr7b06l3nqgbxq8ydcz79ayw75y2szipfqkw17c7gv6d7v8";
};
buildInputs = [
makeWrapper autoconf automake libtool curl sasl jdk maven
python wrapPython boto distutils-cfg setuptools leveldb
subversion apr glog
] ++ lib.optionals stdenv.isLinux [
libnl
];
propagatedBuildInputs = [
pythonProtobuf
];
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
preConfigure = ''
export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/.m2"
ln -s $mavenRepo .m2
export MAVEN_OPTS="-Dmaven.repo.local=${mavenRepo}"
substituteInPlace src/launcher/fetcher.cpp \
--replace '"tar' '"${gnutar}/bin/tar' \
@ -37,6 +40,29 @@ in stdenv.mkDerivation {
substituteInPlace src/cli/mesos-scp \
--replace "'scp " "'${openssh}/bin/scp "
substituteInPlace src/cli/python/mesos/cli.py \
--replace "['mesos-resolve'" "['$out/bin/mesos-resolve'"
'' + lib.optionalString (stdenv.isLinux) ''
substituteInPlace configure.ac \
--replace /usr/include/libnl3 ${libnl}/include/libnl3
substituteInPlace src/linux/perf.cpp \
--replace '"perf ' '"${perf}/bin/perf '
substituteInPlace src/slave/containerizer/isolators/filesystem/shared.cpp \
--replace '"mount ' '"${utillinux}/bin/mount ' \
substituteInPlace src/slave/containerizer/isolators/namespaces/pid.cpp \
--replace '"mount ' '"${utillinux}/bin/mount ' \
substituteInPlace src/slave/containerizer/isolators/network/port_mapping.cpp \
--replace '"tc ' '"${iproute}/bin/tc ' \
--replace '"ip ' '"${iproute}/bin/ip ' \
--replace '"mount ' '"${utillinux}/bin/mount ' \
--replace '/bin/sh' "${stdenv.shell}"
'';
configureFlags = [
@ -45,27 +71,29 @@ in stdenv.mkDerivation {
"--with-svn=${subversion}"
"--with-leveldb=${leveldb}"
"--with-glog=${glog}"
"--with-glog=${glog}"
"--enable-optimize"
"--disable-python-dependency-install"
] ++ lib.optionals stdenv.isLinux [
"--with-network-isolator"
];
postInstall = ''
rm -rf $out/var
rm $out/bin/*.sh
ensureDir $out/share/java
mkdir -p $out/share/java
cp src/java/target/mesos-*.jar $out/share/java
shopt -s extglob
MESOS_NATIVE_JAVA_LIBRARY=$(echo $out/lib/libmesos.*(so|dylib))
shopt -u extglob
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos.${soext}
ensureDir $out/nix-support
mkdir -p $out/nix-support
touch $out/nix-support/setup-hook
echo "export MESOS_NATIVE_JAVA_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
echo "export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
# Inspired by: pkgs/development/python-modules/generic/default.nix
ensureDir "$out/lib/${python.libPrefix}"/site-packages
mkdir -p $out/lib/${python.libPrefix}/site-packages
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
${python}/bin/${python.executable} src/python/setup.py install \
--install-lib=$out/lib/${python.libPrefix}/site-packages \
@ -85,14 +113,14 @@ in stdenv.mkDerivation {
fi
done
for f in $out/libexec/mesos/python/mesos/*.py; do
${python}/bin/${python.executable} -c "import py_compile; py_compile.compile('$f')"
done
# wrap the python programs
declare -A pythonPathsSeen=()
program_PYTHONPATH="$out/libexec/mesos/python"
program_PATH=""
_addToPythonPath "$out"
for prog in mesos-cat mesos-ps mesos-scp mesos-tail; do
wrapProgram "$out/bin/$prog" \
--prefix PYTHONPATH ":" $program_PYTHONPATH
--prefix PYTHONPATH ":" "$out/libexec/mesos/python"
true
done
'';

View File

@ -4640,6 +4640,7 @@ let
sasl = cyrus_sasl;
inherit (pythonPackages) python boto setuptools distutils-cfg wrapPython;
pythonProtobuf = pythonPackages.protobuf2_5;
perf = linuxPackages.perf;
};
mesos-dns = callPackage ../servers/dns/mesos-dns { };