From reviews-return-58848-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Fri Apr 7 16:40:28 2017 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BD6918C61 for ; Fri, 7 Apr 2017 16:40:28 +0000 (UTC) Received: (qmail 75574 invoked by uid 500); 7 Apr 2017 16:40:28 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 75543 invoked by uid 500); 7 Apr 2017 16:40:27 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 75532 invoked by uid 99); 7 Apr 2017 16:40:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2017 16:40:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3B56BC047D; Fri, 7 Apr 2017 16:40:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.201 X-Spam-Level: **** X-Spam-Status: No, score=4.201 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, NML_ADSP_CUSTOM_MED=1.2, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id trAUVJWXnC3w; Fri, 7 Apr 2017 16:40:26 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id CBB085F27E; Fri, 7 Apr 2017 16:40:25 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 73A72E02AA; Fri, 7 Apr 2017 16:40:25 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 2BD75C412E4; Fri, 7 Apr 2017 16:40:25 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4219085770394292162==" MIME-Version: 1.0 Subject: Re: Review Request 58200: Fix mesos runs with docker(pid namespace mismatch). From: Deshi Xiao To: haosdent huang , Alexander Rukletsov Cc: Mesos Reviewbot , Deshi Xiao , mesos Date: Fri, 07 Apr 2017 16:40:24 -0000 Message-ID: <20170407164024.14956.11377@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Deshi Xiao X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/58200/ X-Sender: Deshi Xiao References: <20170405233506.56252.73341@reviews-vm2.apache.org> In-Reply-To: <20170405233506.56252.73341@reviews-vm2.apache.org> Reply-To: Deshi Xiao X-ReviewRequest-Repository: mesos --===============4219085770394292162== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58200/ ----------------------------------------------------------- (Updated April 7, 2017, 4:40 p.m.) Review request for mesos, Alexander Rukletsov and haosdent huang. Bugs: MESOS-7210 https://issues.apache.org/jira/browse/MESOS-7210 Repository: mesos Description ------- Becuase MESOS HTTP checks doesn't work when mesos runs with --docker_mesos_image ( pid namespace mismatch ).So let docker executor run with container add host pid mapping(--pid=host) Diffs ----- src/slave/containerizer/docker.cpp ad9ab847cb3093724ef374d036c896b4e7f18b5e Diff: https://reviews.apache.org/r/58200/diff/1/ Testing (updated) ------- 1. Build the image with latest code. Let's name the image with `mesos-build` here. 2. Launch mesos master. ``` $ docker run \ -it \ --pid host \ --net host \ --privileged \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /sys/fs/cgroup:/sys/fs/cgroup \ mesos-build \ mesos-master \ --hostname=127.0.0.1 \ --ip=127.0.0.1 \ --port=5050 \ --work_dir=/tmp/mesos ``` 3. Launch mesos agent. ``` $ docker run \ -it \ --pid host \ --net host \ --privileged \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /sys/fs/cgroup:/sys/fs/cgroup \ mesos-build \ mesos-agent \ --hostname=127.0.0.1 \ --ip=127.0.0.1 \ --master=127.0.0.1:5050 \ --systemd_enable_support=false \ --work_dir=/tmp/mesos \ --containerizers=docker,mesos \ --docker_mesos_image=mesos-build ``` 4. Launch task with health check. Define the task with health check. ``` $ cat /tmp/task.json { "name": "test-health-check", "task_id": {"value" : "test-health-check"}, "agent_id": {"value" : ""}, "resources": [ { "name": "cpus", "type": "SCALAR", "scalar": { "value": 0.1 }, "role": "*" }, { "name": "mem", "type": "SCALAR", "scalar": { "value": 32 }, "role": "*" } ], "command": { "value": "sleep 1000" }, "container": { "type": "DOCKER", "volumes": [], "docker": { "image": "mesos-build", "network": "HOST" } }, "health_check": { "type": "HTTP", "http": { "scheme": "http", "port": 5050 }, "gracePeriodSeconds": 300, "intervalSeconds": 60, "timeoutSeconds": 20, "maxConsecutiveFailures": 3 } } ``` Lauch task ``` $ mesos-execute --master=127.0.0.1:5050 --task=/tmp/task.json ``` And verified the healthy status of task is correct. ``` I0407 16:29:57.258509 88767 health_checker.cpp:123] Entered the net namespace of task (pid: '88727') successfully I0407 16:29:57.334801 88643 health_checker.cpp:395] Performed HTTP health check for task 'test-health-check' in 86.311186ms I0407 16:29:57.334872 88643 health_checker.cpp:319] HTTP health check for task 'test-health-check' passed ``` Thanks, Deshi Xiao --===============4219085770394292162==--