mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Wu" <>
Subject Re: Review Request 41560: Change Docker::run to take Subprocess::IO instead of Option<string>
Date Tue, 22 Dec 2015 01:32:39 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 21, 2015, 5:32 p.m.)

Review request for mesos, Benjamin Hindman, Artem Harutyunyan, Jie Yu, Joris Van Remoortere,
and Timothy Chen.


Add to Logger Module review chain.

Bugs: MESOS-4137

Repository: mesos


This changes the FDs used by the `mesos-docker-executor` to inherit rather than open anew.

In the `mesos-docker-executor`, we originally passed the log file path (i.e. `path::join(sandboxDirectory,
"stdout")`) as an argument to `Docker::run`.  In the executor's context, the log file is already
open as `STDOUT_FILENO`.

By inheriting the FD, the docker containerizer's logging-code will path mirrors that of the
mesos containerizer.


  src/docker/docker.hpp 33d6fb3e82ff7328ad093648a45546a18ec7b8cb 
  src/docker/docker.cpp 5dc4667d93b143b54841d85606affe3e4926757a 
  src/docker/executor.cpp 4042cec0acbe03d937ea3c53ffde745cbba552d2 
  src/slave/containerizer/docker.cpp 2d2dd4e0df36207c5f3cbb4fe2c50df51c0f3e9e 
  src/tests/mesos.hpp 1c6acabab9d189a6d3cc8d63359053fd230377b8 



make check (Centos7)
sudo bin/ --gtest_filter="*ROOT_DOCKER_Logs*"

Also confirmed that the changed pipes will still output to the sandbox.  See below for repro


# Manual test for launching an executor from an agent launched with `--docker_mesos_image=<something>`


FROM centos:7

RUN yum -y update systemd

RUN yum install -y tar wget
RUN wget -O

RUN yum groupinstall -y "Development Tools"
RUN yum install -y apache-maven python-devel java-1.7.0-openjdk-devel zlib-devel libcurl-devel
openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel libevent-devel

RUN yum install -y perf nmap-ncat

RUN yum install -y git

RUN yum install -y docker

# Export environment.
ENV JAVA_HOME /usr/lib/jvm/java-1.7.0-openjdk/

# Include libmesos on library path.
ENV LD_LIBRARY_PATH /usr/local/lib

# Copy local checkout into /opt
ADD . /opt


# Configure!
RUN ./bootstrap
RUN mkdir -p build && cd build && ../configure --enable-ssl --enable-libevent

WORKDIR /opt/build

# Build and cleanup in a single layer.
RUN make -j4 install && cd /


On Centos7, prepare the docker image:
sudo docker build -t mesos/mesos:git-docker-pipe .


Start the master:
bin/ --work_dir=/tmp/master --ip=

Start the agent inside a Docker container:
sudo docker run -t  -v /var/run/docker.sock:/var/run/docker.sock -v /sys/fs/cgroup:/sys/fs/cgroup
-v /tmp/mesos:/tmp/mesos --pid=host --net=host -i mesos/mesos:git-docker-pipe \
mesos-slave --master= --containerizers=docker --docker_mesos_image="mesos/mesos:git-docker-pipe"

Run one of the following (they should both work):

src/mesos-execute --master= --containerizer=docker --docker_image=busybox --name="DockerInDocker"
--command="echo hello"

Then check to see if anything was printed in `/tmp/mesos/slaves/<SLAVE_ID>/frameworks/<FRAMEWORK_ID>/executors/<EXECUTOR_ID>/runs/latest/`.


Joseph Wu

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message