Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
Merge pull request #84 from mesosphere/multibuilder
Browse files Browse the repository at this point in the history
build support for multiple variants of mesos, until pure bindings have merged w/ master
  • Loading branch information
jdef committed Nov 28, 2014
2 parents ec12c0c + 48068a5 commit 9c0549f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For a binary-only install of the Kubernetes-Mesos framework you can use the Dock
```shell
# chcon needed for systems protected by SELinux
$ mkdir bin && chcon -Rt svirt_sandbox_file_t bin
$ docker run -rm -v $(pwd)/bin:/target jdef/kubernetes-mesos:dockerbuild
$ docker run -rm -v $(pwd)/bin:/target jdef/kubernetes-mesos:build-latest
```

Instructions to build and install from source are as follows:
Expand Down
2 changes: 2 additions & 0 deletions hack/dockerbuild/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
README.md
build
Dockerfile.orig
mesos-*-compat
8 changes: 2 additions & 6 deletions hack/dockerbuild/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ FROM debian:wheezy
MAINTAINER James DeFelice <[email protected]>

ENV DEBIAN_FRONTEND noninteractive
ENV DEB_VERSION_MESOS 0.20.1-1.0.debian75

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF && \
echo "deb http://repos.mesosphere.io/debian wheezy main" | \
tee /etc/apt/sources.list.d/mesosphere.list && \
apt-get -y update && \
apt-get -y install mesos=$DEB_VERSION_MESOS g++ make curl mercurial git
RUN apt-get -y update && \
apt-get -y install g++ make curl mercurial git

RUN curl -L https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz | tar xz && cd protobuf-2.5.0/ && ./configure --prefix=/usr && make && make install

Expand Down
16 changes: 9 additions & 7 deletions hack/dockerbuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This example copies the resulting binaries into the host-mounted volume `/tmp/ta

To build and copy the binaries:

$ docker run --rm -v /tmp/target:/target k8s-mesos-builder
$ docker run --rm -v /tmp/target:/target jdef/kubernetes-mesos:build-latest
...
git clone https://${GOPKG}.git .
Cloning into '.'...
Expand All @@ -43,28 +43,30 @@ To build and copy the binaries:

Alternatively, it can be used to generate binaries from a branch:

$ docker run --rm -v /tmp/target:/target -e GIT_BRANCH=default_port k8s-mesos-builder
$ docker run --rm -v /tmp/target:/target -e GIT_BRANCH=default_port jdef/kubernetes-mesos:build-latest

Want a quick-and-dirty development environment to start hacking?

$ docker run -ti -v /tmp/target:/target k8s-mesos-builder bash
$ docker run -ti -v /tmp/target:/target jdef/kubernetes-mesos:build-latest bash
root@5883c3a460a6$ make bootstrap all

Need to build the project, but from a forked git repo?

$ docker run --rm -v /tmp/target:/target -e GIT_REPO=https://github.com/whoami/kubernetes-mesos k8s-mesos-builder
$ docker run --rm -v /tmp/target:/target -e GIT_REPO=https://github.com/whoami/kubernetes-mesos jdef/kubernetes-mesos:build-latest

To hack in your currently checked out repo mount the root of the github repo to `/snapshot`:

$ docker run -ti -v /tmp/target:/target -v /home/jdef/kubernetes-mesos:/snapshot k8s-mesos-builder bash
$ docker run -ti -v /tmp/target:/target -v /home/jdef/kubernetes-mesos:/snapshot jdef/kubernetes-mesos:build-latest bash

## Profiling

Profiling in the cloud with Kubernetes-Mesos is easy!
First, ssh into your Mesos cluster and generate a set of project binaries with profiling enabled (the `TAGS` variable is important here):

$ dpkg -l | grep -e mesos # verify the mesos version
ii mesos 0.20.1-1.0.debian75 amd64 Cluster resouce manager with efficient resource isolation
$ docker run --rm -ti -e GIT_BRANCH=offer_storage -e TAGS=profile \
-v $(pwd)/bin:/target jdef/kubernetes-mesos:dockerbuild
-v $(pwd)/bin:/target jdef/kubernetes-mesos:build-mesos-0.20.1-compat

Next, [start the framework](https://github.com/mesosphere/kubernetes-mesos/#start-the-framework) and schedule some pods.
Once the framework and executors are up and running you can start capturing heaps:
Expand All @@ -80,6 +82,6 @@ Additional packages may be required to support the reporting format you desire.

$ apt-get install ghostscript graphviz
$ go tool pprof --base=./framework.heap.20141117175634 --inuse_objects --pdf \
./bin/kubernetes-executor ./framework.heap.20141120162503 >framework-20141120a.pdf
./bin/kubernetes-mesos ./framework.heap.20141120162503 >framework-20141120a.pdf

For more details regarding profiling read the [pprof](http://golang.org/pkg/net/http/pprof/) package documentation.
9 changes: 8 additions & 1 deletion hack/dockerbuild/build
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
docker build -t k8s-mesos-builder .
docker build -t kubernetes-mesos:build-base .
docker tag kubernetes-mesos:build-base jdef/kubernetes-mesos:build-base

for i in mesos-0.20.1-compat mesos-0.21.0-compat; do
test -d $i && docker build -t kubernetes-mesos:build-$i $i && docker tag kubernetes-mesos:build-$i kubernetes-mesos:build-latest
docker tag kubernetes-mesos:build-$i jdef/kubernetes-mesos:build-$i
docker tag kubernetes-mesos:build-$i jdef/kubernetes-mesos:build-latest
done
10 changes: 10 additions & 0 deletions hack/dockerbuild/mesos-0.20.1-compat/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM jdef/kubernetes-mesos:build-base
MAINTAINER James DeFelice <[email protected]>

ENV DEB_VERSION_MESOS 0.20.1-1.0.debian75

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF && \
echo "deb http://repos.mesosphere.io/debian wheezy main" | \
tee /etc/apt/sources.list.d/mesosphere.list && \
apt-get -y update && \
apt-get -y install mesos=$DEB_VERSION_MESOS
10 changes: 10 additions & 0 deletions hack/dockerbuild/mesos-0.21.0-compat/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM jdef/kubernetes-mesos:build-base
MAINTAINER James DeFelice <[email protected]>

ENV DEB_VERSION_MESOS 0.21.0-1.0.debian77

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF && \
echo "deb http://repos.mesosphere.io/debian wheezy main" | \
tee /etc/apt/sources.list.d/mesosphere.list && \
apt-get -y update && \
apt-get -y install mesos=$DEB_VERSION_MESOS

0 comments on commit 9c0549f

Please sign in to comment.