Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EFE27200AE4 for ; Fri, 24 Jun 2016 18:36:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EE6AE160A58; Fri, 24 Jun 2016 16:36:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1D203160A2E for ; Fri, 24 Jun 2016 18:36:13 +0200 (CEST) Received: (qmail 49936 invoked by uid 500); 24 Jun 2016 16:36:13 -0000 Mailing-List: contact dev-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list dev@mesos.apache.org Received: (qmail 49924 invoked by uid 99); 24 Jun 2016 16:36:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jun 2016 16:36:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 52429C9CE6 for ; Fri, 24 Jun 2016 16:36:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=mesosphere.io Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ggl5eoftfvPf for ; Fri, 24 Jun 2016 16:36:09 +0000 (UTC) Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id CFB7B5FAEB for ; Fri, 24 Jun 2016 16:36:08 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id fq2so181887923obb.2 for ; Fri, 24 Jun 2016 09:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mesosphere.io; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=WUYoyYCaPWEWf9NICzARfKCgZfAOjBlYAkCnMCLNXhM=; b=yV9Jo3Dxp0mLMX5afyPgYX2xx9HeAzQyvD+3uBy5CAF9MCFdMPETdhFSusCaA1Uusf N4U7FuPXavCGDyYr7eMag5NNSqaNynISfEFMB1VFRFiIn9kzHUaQtDR1HrH72iFVUl3e JlOwFzCwHdk0criPjCEr29Hf9NbxFJW7upEgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=WUYoyYCaPWEWf9NICzARfKCgZfAOjBlYAkCnMCLNXhM=; b=DkSFj8CHL2EYBJmUF49o06hinGa34ZcJk3bmCO9KQnxH0FADdK9tOUS8ojqDROcZhC uiUcBcU7za3ptdAvwEOsApIEylkFM3ZqxRbCmJkd/8aYgMNI1kkbpAsbEXspM86GKBOJ pZccIJQQWDz8LKWlT32tLL61ss6Sa9RSWPzT+U/HiO+9bldIQlhlOEIyMS4r7e+7qttT d8NFc5FrTZR5yfYo8ca/sqt1zZ0np/5YoX6G8D3t/hKuoMZXJow/8SccrhjbBKoH+SVG 7RKHFMI2FQOBb86ICQJDs+LTtX7GVoP9hkhNuESsCZ3YiDR3bvAMzsVHTc56xShQ20rr 9/6Q== X-Gm-Message-State: ALyK8tJ3/JnCygFLxjxkgX9KZW3KvcQtCg7o8wlEOP9SzxEW4sPjVrrLOTgjkPhYwFjTf/zSwGcHy1ZsyXUif00t X-Received: by 10.107.37.19 with SMTP id l19mr6748814iol.75.1466786161674; Fri, 24 Jun 2016 09:36:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.137.194 with HTTP; Fri, 24 Jun 2016 09:35:42 -0700 (PDT) In-Reply-To: References: From: Artem Harutyunyan Date: Fri, 24 Jun 2016 09:35:42 -0700 Message-ID: Subject: Re: Mesos CLI To: dev@mesos.apache.org Content-Type: multipart/alternative; boundary=001a11409d8e20e4b3053608c420 archived-at: Fri, 24 Jun 2016 16:36:15 -0000 --001a11409d8e20e4b3053608c420 Content-Type: text/plain; charset=UTF-8 Having the CLI package outside the Mesos repo will make it very hard for Mesos developers to verify whether the change that they're introducing breaks the CLI or not. In practise no one is going to actually do that and so the CLI will just sit there and slowly degrade. It will also make it virtually impossible to package it together with Mesos, and someone will need to maintain a compatibility table between CLI and Mesos versions. I am also a +1 for python. Users shouldn't care as long as we can package it as a binary. As for developers, it's naive to expect that there will be a consensus, both sides have very strong advantages and drawbacks. So we need to come to a compromise. I would suggest that Kevin and Haris make a live demo of the functionality that's already in place during our next community sync. This way everyone we'll be able to see what they already have, and we collectively will be able to estimate how long will it actually take us to re-implement all of that in C++. It would be great to see everyone who has an opinion about this join the community sync and express it. Artem. On Thu, Jun 23, 2016 at 7:40 PM, haosdent wrote: > IMO, I perfer to C++ if we decide to put CLI in Mesos repo. > Because we have a lot of utils in stout and libprocess, I think we could > reuse most of them when implementing CLI. > So it would be effective in development as well. If not utils classes and > functions in stout/libprocess meet our requirements. We could add > them and the whole Mesos code would get benefits after adding these C++ > utils classes and functions. Comparing to implement CLI by > Python/Golang or other languages, seems they could not bring too much > benefits. > > But If we decide to put CLI outside Mesos repo. I perfer to use Python or > Golang as the reasons @Guangya and @tommy mentioned above. > > > On Fri, Jun 24, 2016 at 10:06 AM, tommy xiao wrote: > > > Because the golang's popular, the golang is preferred as a cli build > > toolbox. anyone interesting it. > > > > 2016-06-24 10:01 GMT+08:00 Guangya Liu : > > > > > Another advantage for using python is that we can use stevedore > > > > to > > > manage all of the CLI plugins for container, agent,cluster etc. > > > The stevedore was been widely used in OpenStack. > > > > > > Thanks, > > > > > > Guangya > > > > > > On Fri, Jun 24, 2016 at 9:56 AM, Jie Yu wrote: > > > > > > > I am actually fine with Python as long as we can figure out a way to > > > > install python executable without any dependency during make install > > (and > > > > subsequently bundle it into rpm/deb packages). According to Kevin, > > looks > > > > like pyinstall can achieve that. > > > > > > > > If we go for the Python route, I'd like to have a style guide for our > > > > python code. Looks like we can directly use the google python style > > guide > > > > . Looks like > pylint > > > can > > > > also check the style automatically. > > > > > > > > - Jie > > > > > > > > > > > > On Thu, Jun 23, 2016 at 1:21 AM, Guangya Liu > > wrote: > > > > > > > > > +1 to use python. By using python, we can debug the CLI without > > > > re-compile > > > > > but just update the CLI file and debug it with pdb, this is very > > > helpful > > > > to > > > > > trouble shooting. > > > > > > > > > > On Thu, Jun 23, 2016 at 9:34 AM, Kevin Klues > > > wrote: > > > > > > > > > > > > > > > > > > > The best option may still be for it > > > > > > > to be in Python, this is why I'm asking if there are particular > > > > things > > > > > > that > > > > > > > our helper libraries don't provide which you are leveraging in > > > > python. > > > > > > > > > > > > > > > > > > > One thing we rely heavily on that is missing is `docopt`. We use > > > docopt > > > > > for > > > > > > convenient / standardized command line parsing and help > formatting. > > > > This > > > > > > makes it really easy to enforce a standard help format across > > plugins > > > > so > > > > > > the CLI has a consistent feel throughout all of its subcommands. > > > > > Supposedly > > > > > > there is a C++ implementation of this now, but it requires gcc > 4.9+ > > > > (for > > > > > > regex). > > > > > > https://github.com/docopt/docopt.cpp > > > > > > > > > > > > In addition to this, the plugin architecture we built was very > easy > > > to > > > > > > implement in python, and I'm worried it would be much more > > > complicated > > > > > (and > > > > > > less readable) to get the same functionality out of C++. The > > existing > > > > CLI > > > > > > has some support for "plugins" (by looking for executables in the > > > path > > > > > with > > > > > > a "mesos-" prefix and assuming they are an extension to the CLI > > that > > > > can > > > > > > exist as a subcommand). However, the implementation of this is > > pretty > > > > > > ad-hoc and error prone (though it could conceivably be redone to > > work > > > > > > better). > > > > > > > > > > > > To get the equivalent functionality out of C++ for the plugin > > > > > architecture > > > > > > we've built for python, each plugin would need to be implemented > > as a > > > > > > shared object that we dlopen() from the main program. Each module > > > would > > > > > > define a set of global variables describing properties of the > > plugin > > > > > > (including help information) as well as create an instance of a > > class > > > > > that > > > > > > inherits from a `PluginBase` class to perform the actual > > > functionality > > > > of > > > > > > the plugin. The main program would then load this module, > integrate > > > its > > > > > > help information and other meta data into its own metadata, and > > begin > > > > > > invoking functions on the plugin class. > > > > > > > > > > > > I'm not saying it's impossible to do in C++, just that python > lends > > > > > itself > > > > > > better to doing this kind of stuff, and is much more readable > when > > > > doing > > > > > > so. > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > Deshi Xiao > > Twitter: xds2000 > > E-mail: xiaods(AT)gmail.com > > > > > > -- > Best Regards, > Haosdent Huang > --001a11409d8e20e4b3053608c420--