Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8FB7173DC for ; Wed, 20 May 2015 20:44:40 +0000 (UTC) Received: (qmail 69350 invoked by uid 500); 20 May 2015 20:44:40 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 69301 invoked by uid 500); 20 May 2015 20:44:40 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 69273 invoked by uid 99); 20 May 2015 20:44:40 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2015 20:44:40 +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 98A4CC6F98 for ; Wed, 20 May 2015 20:44:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=wso2.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aaecyo995Xhc for ; Wed, 20 May 2015 20:44:30 +0000 (UTC) Received: from mail-yk0-f182.google.com (mail-yk0-f182.google.com [209.85.160.182]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 9556820D53 for ; Wed, 20 May 2015 20:44:30 +0000 (UTC) Received: by ykft189 with SMTP id t189so19919236ykf.1 for ; Wed, 20 May 2015 13:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wso2.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UnzPMww11uht4SSv15DIB/WZWIkwph9IYWxrYTqcw+c=; b=RgK9X2ieiLW/dSp9WbtoweXYnRvk2x2TcP6h5CuzqZEa5uSlMVjOGqUX7PARIuCsfD EucQPvA8fHmXT3xFnr2gheaK5otINQ9f9J9M+CEN0WaZKQMUKOGzv4r8bQ/LyF2izXr0 zKZe/Rx+umt4ZvKnbApfB3C2QosShujp9akFo= 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:date :message-id:subject:from:to:content-type; bh=UnzPMww11uht4SSv15DIB/WZWIkwph9IYWxrYTqcw+c=; b=dWi/lGqumP43MlAKgJXlFk+qepk2bF7KnGw9ZqiEDHARgcx22kjeVdJyZB0dko0nMt UEZbdUFgehEC2n5cllfaUNZ8eAfCndLn021W6xFy2gcXqPei37pb0M5SxonhdU+FhWaW lEslU7C+axabx3OZnBGZ3w6B97oBGI2E5zlbd6/nf6d9kBFg6FRN3ZN0cb5hHt9ykq6y QfGGf8/3AdSs3Tni5YEKeWIY47cKT0iPnw3JKJy5ZZR3ZTv/Hplqg2eEwANNUWvBBkoz sw5H9clDu/7OM1/btEluqrU2vUlvqJvwYMXvf9RwY7gWaOlETv1cHTOFHpbPTO03awnw QrqA== X-Gm-Message-State: ALoCoQmD8+CVA/+B8X60CLAplI/glG+QJRJB2naGIDSSWw1S3imDnSPDZVUeTBJi5TgqY/aydNiC MIME-Version: 1.0 X-Received: by 10.170.157.4 with SMTP id y4mr36714788ykc.91.1432154669659; Wed, 20 May 2015 13:44:29 -0700 (PDT) Received: by 10.129.71.86 with HTTP; Wed, 20 May 2015 13:44:29 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 May 2015 02:14:29 +0530 Message-ID: Subject: Re: [Discuss] Specifying CPU and Memory in Docker Cartridges From: Rajkumar Rajaratnam To: "dev@stratos.apache.org" Content-Type: multipart/alternative; boundary=001a113a17f6595ae30516897e5c --001a113a17f6595ae30516897e5c Content-Type: text/plain; charset=UTF-8 This is great Imesh! If we don't specify these parameters, the CPU and Memory won't be restricted right? Do we have to explicitly set these to 0? Thanks. On Thu, May 21, 2015 at 12:54 AM, Imesh Gunaratne wrote: > Hi Devs, > > I have now implemented support to specify CPU (number of cores) and Memory > (in MB) in Docker Cartridges. These values will be passed to Kubernetes > when creating a Pod and Kubernetes will limit those resources to containers > accordingly. > > If CPU and Memory should not be restricted, above parameter values can be > set to zero. Please find a sample cartridge definition below: > > { > "type": "php", > "provider": "apache", > "category": "framework", > "host": "php.stratos.org", > "displayName": "php", > "description": "php Cartridge", > "version": "7", > "multiTenant": "false", > "loadBalancingIPType": "public", > "portMapping": [ > { > "protocol": "http", > "port": "80", > "proxyPort": "8281" > } > ], > "deployment": { > "baseDir": "/var/www" > }, > "iaasProvider": [ > { > "type": "kubernetes", > "imageId": "stratos/php:4.1.0-beta", > "networkInterfaces": [ > ], > "property": [ > ] > } > ], > "property": [ > { > "name": "KUBERNETES_CONTAINER_CPU", > "value": "1" > }, > { > "name": "KUBERNETES_CONTAINER_MEMORY", > "value": "512" > } > ] > } > > Thanks > > -- > Imesh Gunaratne > > Senior Technical Lead, WSO2 > Committer & PMC Member, Apache Stratos > -- Rajkumar Rajaratnam Committer & PMC Member, Apache Stratos Software Engineer, WSO2 Mobile : +94777568639 Blog : rajkumarr.com --001a113a17f6595ae30516897e5c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is great Imesh!

If w= e don't specify these parameters, the CPU and Memory won't be restr= icted right? Do we have to explicitly set these to 0?

Thanks.

On Thu, May 21, 2015 at 12:54 AM, Imesh Gunaratne <imesh@apache.org= > wrote:
H= i Devs,

I have now implemented support to specify CPU (n= umber of cores) and Memory (in MB) in Docker Cartridges. These values will = be passed to Kubernetes when creating a Pod and Kubernetes will limit those= resources to containers accordingly.

If CPU and M= emory should not be restricted, above parameter values can be set to zero. = Please find a sample cartridge definition below:

<= pre style=3D"color:rgb(0,0,0);font-family:Menlo">{
"type": "php",
"provider": "apache"= ;,
&qu= ot;category": "framework",
"host": "php.stratos.org",
"displayName": "php",
"description": "php Cartridge= ",
"version": "7",
"multiTenant": "false",
"loadBalancingIPType": "public",
"= portMapping": [
{
"protocol": "http",
= "port&qu= ot;: "80&qu= ot;,
"proxyPort": "8281"
}
],
"deployment": {
= "baseDir"= : "/var/www= "
},
"= ;iaasProvider": [
{
"type": "kubernetes",
= "im= ageId": &qu= ot;stratos/php:4.1.0-beta",
"networkInterfaces": [<= br> ],
"property": [
]
} ],
"property": = [
{
"name": "KUBERNETES_CONTAINER_CPU",
"value": "1"
}, {
"name": "KUBERNETES_CONTAINER_MEMORY",
"value": "512"
<= /span> }<= br> ]

}
<= div>Thanks
--
Imesh Gunaratne<= div>
Senior Technical Lead, WSO2
= Committer & PMC Member, Apache Stratos



--
<= div dir=3D"ltr">
Rajkumar Ra= jaratnam
Committer & PMC Member, Apache Stra= tos
Software Engineer, WSO2

Mobile : +94777568639
--001a113a17f6595ae30516897e5c--