Return-Path: X-Original-To: apmail-aurora-reviews-archive@minotaur.apache.org Delivered-To: apmail-aurora-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 1BEB410F90 for ; Thu, 27 Mar 2014 18:57:51 +0000 (UTC) Received: (qmail 87463 invoked by uid 500); 27 Mar 2014 18:57:50 -0000 Delivered-To: apmail-aurora-reviews-archive@aurora.apache.org Received: (qmail 87437 invoked by uid 500); 27 Mar 2014 18:57:49 -0000 Mailing-List: contact reviews-help@aurora.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.incubator.apache.org Delivered-To: mailing list reviews@aurora.incubator.apache.org Received: (qmail 87427 invoked by uid 99); 27 Mar 2014 18:57:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 18:57:48 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 27 Mar 2014 18:57:47 +0000 Received: (qmail 85057 invoked by uid 99); 27 Mar 2014 18:57:26 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 18:57:26 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id AB7001D5BBA; Thu, 27 Mar 2014 18:57:22 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7632645607659534838==" MIME-Version: 1.0 Subject: Re: Review Request 19509: Now consuming nonProd consumption from the new getQuota API From: "Suman Karumuri" To: "Bill Farner" , "Mark Chu-Carroll" Cc: "Aurora" , "Suman Karumuri" Date: Thu, 27 Mar 2014 18:57:22 -0000 Message-ID: <20140327185722.29944.54569@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Suman Karumuri" X-ReviewGroup: Aurora X-ReviewRequest-URL: https://reviews.apache.org/r/19509/ X-Sender: "Suman Karumuri" References: <20140326235214.8508.46219@reviews.apache.org> In-Reply-To: <20140326235214.8508.46219@reviews.apache.org> Reply-To: "Suman Karumuri" X-ReviewRequest-Repository: aurora X-Virus-Checked: Checked by ClamAV on apache.org --===============7632645607659534838== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > On March 26, 2014, 11:52 p.m., Bill Farner wrote: > > src/main/python/apache/aurora/client/cli/quota.py, line 70 > > > > > > DRY: > > > > quota_result = resp.result.getQuotaResult > > > > apply libarally done. > On March 26, 2014, 11:52 p.m., Bill Farner wrote: > > src/main/python/apache/aurora/client/commands/core.py, line 632 > > > > > > ditto done. > On March 26, 2014, 11:52 p.m., Bill Farner wrote: > > src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh, line 67 > > > > > > comment not useful removed. - Suman ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19509/#review38678 ----------------------------------------------------------- On March 26, 2014, 10 p.m., Suman Karumuri wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19509/ > ----------------------------------------------------------- > > (Updated March 26, 2014, 10 p.m.) > > > Review request for Aurora, Mark Chu-Carroll and Bill Farner. > > > Bugs: AURORA-246 > https://issues.apache.org/jira/browse/AURORA-246 > > > Repository: aurora > > > Description > ------- > > Updated the client to consume the new getQuota API which contains nonProdConsumption(resources consumed by non-prod tasks) information also. > > Currently, the mocked calls can't detect renamed and missing thrift structs. Added tests to look for expected fields in GetQuotaResult and ResourceAggregate structs. Refactored tests in test_quota to remove duplicated code and added a missing test. > > > Diffs > ----- > > src/main/python/apache/aurora/client/cli/quota.py d06f21a80575058aefa3dffc72b365805d7a5ce2 > src/main/python/apache/aurora/client/commands/core.py 9977c725528086d3e8cf58de294adee542570411 > src/test/python/apache/aurora/client/cli/test_quota.py 44afd74aa5b11296951f45fe7edca8cb58b0ec18 > src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh 27b745ea31189a0ea0731619eb4c06f802aa04b9 > > Diff: https://reviews.apache.org/r/19509/diff/ > > > Testing > ------- > > ./pants src/test/python:all -vxs > > Works for all quota related test. src.test.python.apache.thermos.bin.test_thermos fails on my laptop because of build issues. Sending out a code review since it is an un-related issue. Will look into this tomorrow, if it's a blocker. > > Found all the code to update by running the following query. > > ? git:(mansu/AURORA-246_getQuotaAPI) ag getQuotaResult -G '.py' ~/workspace/incubator-aurora > src/main/python/apache/aurora/client/api/quota_check.py > 90: allocated = CapacityRequest(resp.result.getQuotaResult.quota) > 91: consumed = CapacityRequest(resp.result.getQuotaResult.prodConsumption) > > src/main/python/apache/aurora/client/cli/quota.py > 65: return serialize(quota_resp.result.getQuotaResult, > 69: result += get_quota_str(quota_resp.result.getQuotaResult.quota) > 70: if quota_resp.result.getQuotaResult.prodConsumption: > 72: result += get_quota_str(quota_resp.result.getQuotaResult.prodConsumption) > 73: if quota_resp.result.getQuotaResult.nonProdConsumption: > 75: result += get_quota_str(quota_resp.result.getQuotaResult.nonProdConsumption) > > src/main/python/apache/aurora/client/commands/admin.py > 199: quota = resp.result.getQuotaResult.quota > > src/main/python/apache/aurora/client/commands/core.py > 632: print_quota(resp.result.getQuotaResult.quota, 'Total allocated quota', role) > 634: if resp.result.getQuotaResult.prodConsumption: > 635: print_quota(resp.result.getQuotaResult.prodConsumption, > 639: if resp.result.getQuotaResult.nonProdConsumption: > 640: print_quota(resp.result.getQuotaResult.nonProdConsumption, > > src/test/python/apache/aurora/client/api/test_quota_check.py > 49: getQuotaResult=GetQuotaResult( > > src/test/python/apache/aurora/client/cli/test_quota.py > 35: response.result.getQuotaResult = GetQuotaResult() > 36: response.result.getQuotaResult.quota = ResourceAggregate() > 37: response.result.getQuotaResult.quota.numCpus = 5 > 38: response.result.getQuotaResult.quota.ramMb = 20480 > 39: response.result.getQuotaResult.quota.diskMb = 40960 > 40: response.result.getQuotaResult.consumed = None > 47: response.result.getQuotaResult = GetQuotaResult() > 48: response.result.getQuotaResult.quota = ResourceAggregate() > 49: response.result.getQuotaResult.quota.numCpus = 5 > 50: response.result.getQuotaResult.quota.ramMb = 20480 > 51: response.result.getQuotaResult.quota.diskMb = 40960 > 52: response.result.getQuotaResult.prodConsumption = ResourceAggregate() > 53: response.result.getQuotaResult.prodConsumption.numCpus = 1 > 54: response.result.getQuotaResult.prodConsumption.ramMb = 1024 > 55: response.result.getQuotaResult.prodConsumption.diskMb = 2048 > 56: response.result.getQuotaResult.nonProdConsumption = ResourceAggregate() > 57: response.result.getQuotaResult.nonProdConsumption.numCpus = 1 > 58: response.result.getQuotaResult.nonProdConsumption.ramMb = 1024 > 59: response.result.getQuotaResult.nonProdConsumption.diskMb = 2048 > ? git:(mansu/AURORA-246_getQuotaAPI) ~/workspace/incubator-aurora > > > Thanks, > > Suman Karumuri > > --===============7632645607659534838==--