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 3D09011F8C for ; Sat, 12 Apr 2014 13:18:29 +0000 (UTC) Received: (qmail 15545 invoked by uid 500); 12 Apr 2014 13:18:28 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 15343 invoked by uid 500); 12 Apr 2014 13:18:26 -0000 Mailing-List: contact dev-help@stratos.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.incubator.apache.org Delivered-To: mailing list dev@stratos.incubator.apache.org Received: (qmail 15334 invoked by uid 99); 12 Apr 2014 13:18:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Apr 2014 13:18:24 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nirmal070125@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Apr 2014 13:18:19 +0000 Received: by mail-we0-f169.google.com with SMTP id w62so6535370wes.28 for ; Sat, 12 Apr 2014 06:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lJqiMPhgP+5NovUHzOq5OJvbTbjwseUw40jWIRCutHg=; b=y3suHwiWDnJ7huDe1xxxNeosMgo+YbglEjYlJFJamMm5Y0eDDl4ZeRR6TNcKbNDo21 kkcW4hdCYE2n3QBtlRtaQXlA3L7zgH/q4de2LBWNG/E092b/NIDxNesEQhJgDnNwTouA ylViZavqW/jGt2pfEWG3WA+qRsOsq6okg5RYELRohucfSmm0urkOf4gkLLGOC6scX9iH omEsObP2FAesYOznGP7dDfRttKSpT2vKufFrgO0Nov5jYyBxS7j87WA5fhsu7LGfuIue SDNIfr3XcwRu5/jRSKq2G8lVHR2XSuhJy3UmRBBE+004ZkMdGKwwevADxzryD8E5z1Lc JgoA== MIME-Version: 1.0 X-Received: by 10.194.205.161 with SMTP id lh1mr9423778wjc.40.1397308677131; Sat, 12 Apr 2014 06:17:57 -0700 (PDT) Received: by 10.194.46.38 with HTTP; Sat, 12 Apr 2014 06:17:57 -0700 (PDT) In-Reply-To: References: Date: Sat, 12 Apr 2014 18:47:57 +0530 Message-ID: Subject: Re: Create a base Puppet module From: Nirmal Fernando To: "dev@stratos.incubator.apache.org" Content-Type: multipart/alternative; boundary=047d7b6d950257945204f6d847b9 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6d950257945204f6d847b9 Content-Type: text/plain; charset=UTF-8 We already have a 'base' node AFAIS and all the other nodes inherited from that. On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perera wrote: > > On Sat, Apr 12, 2014 at 1:02 PM, Nirmal Fernando wrote: > >> >> >> >> On Sat, Apr 12, 2014 at 12:49 PM, Akila Ravihansa Perera < >> ravihansa@wso2.com> wrote: >> >>> Hi Nirmal, >>> >>> We don't need zip/unzip to install Puppet. Actually I managed to install >>> a default node without zip/unzip by adding package { 'unzip': ensure => >>> installed } to Puppet Java module. >>> >> >> Well, we still need wget? :-) >> > > Not really...we need wget just to download installation scripts. This can > be done via ssh :-) > SSH from where? > >>> What I'm trying to address is the redundant code in current Puppet >>> master module structure. Currently we have "require java", class >>> {'agent':} on each module, which can be avoided by creating a base module >>> and other modules can inherit stuff from this. >>> >>> For eg. php module has package { 'zip': ensure => installed } >>> dependency, and also Java module need this package as well. Instead of >>> putting these common tools in individual classes we can create a base class >>> and others will inherit stuff from this. >>> >> >> :-) if you check the nodes.pp file, we already leverage puppet >> inheritance. >> > > Yes, but Puppet classes do not :-) > >> >>> If you're interested, I can create a patch for this to be reviewed. >>> >> >> It's better if you test it fully for all the existing scenarios >> (judgemental) and I think these improvements can go for 4.1 but not for >> 4.0, since we're wrapping up 4.0 and this is not a blocker. >> > > Absolutely :-) > > How about we add zip/unzip packages + Stratos agent class declaration > (common tools) to a base *class* and have other *classes* inherit from that? > >> >>> >>> On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando < >>> nirmal070125@gmail.com> wrote: >>> >>>> Hi Akila, >>>> >>>> If you have a look at the current nodes.pp file, Dinesh have already >>>> added a default section, which will be used to create a base image with >>>> minimal software (without wget, zip). >>>> >>>> What problems you are trying to address here? Is it to avoid the >>>> redundant code in nodes.pp file? Cause to install puppet you need these >>>> wget etc. packages, hence no point of adding it in the default node. >>>> >>>> >>>> >>>> On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera < >>>> ravihansa@wso2.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I was thinking that we could simplify cartridge creation process by >>>>> creating a base Puppet module which would install common tools like zip, >>>>> unzip, tar, wget and also include Java module in this base module. >>>>> >>>>> Basically, the module structure will be like this (not tested); >>>>> >>>>> node /base/ { >>>>> >>>>> >>>>> >>>>> } >>>>> >>>>> >>>>> class base { >>>>> >>>>> package { 'unzip': ensure => installed } >>>>> package { 'tar': ensure => installed } >>>>> package { 'wget': ensure => installed } >>>>> >>>>> class {'java'} >>>>> class {'agent':} >>>>> >>>>> Class['java'] ~> Class['agent'] >>>>> >>>>> } >>>>> >>>>> >>>>> Then other Stratos module can include this >>>>> >>>>> node /lb/ inherits base { >>>>> class {'lb': maintenance_mode => 'norestart',} >>>>> } >>>>> >>>>> This will remove lot of redundancy and ugly dependencies we have >>>>> now....WDYT? >>>>> >>>>> >>>>> -- >>>>> Akila Ravihansa Perera >>>>> Software Engineer >>>>> WSO2 Inc. >>>>> http://wso2.com >>>>> >>>>> Phone: +94 77 64 154 38 >>>>> Blog: http://ravihansa3000.blogspot.com >>>>> >>>> >>>> >>>> >>>> -- >>>> Best Regards, >>>> Nirmal >>>> >>>> Nirmal Fernando. >>>> PPMC Member & Committer of Apache Stratos, >>>> Senior Software Engineer, WSO2 Inc. >>>> >>>> Blog: http://nirmalfdo.blogspot.com/ >>>> >>> >>> >>> >>> -- >>> Akila Ravihansa Perera >>> Software Engineer >>> WSO2 Inc. >>> http://wso2.com >>> >>> Phone: +94 77 64 154 38 >>> Blog: http://ravihansa3000.blogspot.com >>> >> >> >> >> -- >> Best Regards, >> Nirmal >> >> Nirmal Fernando. >> PPMC Member & Committer of Apache Stratos, >> Senior Software Engineer, WSO2 Inc. >> >> Blog: http://nirmalfdo.blogspot.com/ >> > > > > -- > Akila Ravihansa Perera > Software Engineer > WSO2 Inc. > http://wso2.com > > Phone: +94 77 64 154 38 > Blog: http://ravihansa3000.blogspot.com > -- Best Regards, Nirmal Nirmal Fernando. PPMC Member & Committer of Apache Stratos, Senior Software Engineer, WSO2 Inc. Blog: http://nirmalfdo.blogspot.com/ --047d7b6d950257945204f6d847b9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We already have a 'base' node AFAIS and all the ot= her nodes inherited from that.


On Sat, Apr 12, 2014 at 1:52 PM, Akila Ravihansa Perer= a <ravihansa@wso2.com> wrote:
=
On Sat, Apr 12, 2014 at 1:02= PM, Nirmal Fernando <nirmal070125@gmail.com> wrote:



On Sat, Apr 12, 2014 at 12:49 P= M, Akila Ravihansa Perera <ravihansa@wso2.com> wrote:
Hi Nirma= l,

We don't need zip/unzip to install Puppet. Actual= ly I managed to install a default node without zip/unzip by adding=C2=A0package { 'unz= ip': ensure =3D> installed } to Puppet Java module.

Well, we still need wget? :-) =

Not real= ly...we need wget just to download installation scripts. This can be done v= ia ssh :-)=C2=A0

SSH from where?
=

What I'm= trying to address is the redundant code in current Puppet master module st= ructure. Currently we have "require java",=C2=A0class {'agent':} = on each module, which can be avoided by creating a base module and other mo= dules can inherit stuff from this.

For= eg. php module has=C2=A0=C2=A0package { 'zip': ensure =3D> installed } = dependency, and also Java module need this package as well. Instead of putt= ing these common tools in individual classes we can create a base class and= others will inherit stuff from this.

:-) if you check the nodes.pp = file, we already leverage puppet inheritance.
<= /blockquote>

Yes, but Puppet classes do not :-) = =C2=A0
=

If = you're interested, I can create a patch for this to be reviewed.=

It's better if you test it= fully for all the existing scenarios (judgemental) and I think these impro= vements can go for 4.1 but not for 4.0, since we're wrapping up 4.0 and= this is not a blocker.

Absolutely := -) =C2=A0

How about we add zip/unzip packages + St= ratos agent class declaration (common tools) to a base *class* and have oth= er *classes* inherit from that?
=


On Sat, Apr 12, 2014 at 12:17 PM, Nirmal Fernando <= nirmal070125@gm= ail.com> wrote:
Hi Akila,

If you have a look at the current nodes.pp file, D= inesh have already added a default section, which will be used to create a = base image with minimal software (without wget, zip).

What problems you are trying to address here? Is it to avoid the = redundant code in nodes.pp file? Cause to install puppet you need these wge= t etc. packages, hence no point of adding it in the default node.



On Sat, Apr 12, 2014 at 11:15 AM, Akila Ravihansa Perera <ra= vihansa@wso2.com> wrote:
Hi,
=
I was thinking that we could simplify cartridge creation pro= cess by creating a base Puppet module which would install common tools like= zip, unzip, tar, wget and also include Java module in this base module.

Basically, the module structure will be like this (not = tested);

node /base/ {

= =C2=A0 =C2=A0 <declarations here>
=C2=A0=C2=A0
}<= /div>


class base {

=C2=A0 =C2=A0pack= age { 'unzip': ensure =3D> installed }
=C2=A0 =C2= =A0package { 'tar': ensure =3D> installed }
=C2=A0= =C2=A0package { 'wget': ensure =3D> installed }

=C2=A0 =C2=A0class {'java'}
=C2= =A0 =C2=A0class {'agent':}
=C2=A0 =C2=A0
=C2=A0= =C2=A0Class['java'] ~> Class['agent'] =C2=A0
=
}


Then other Stratos module can include this

node /lb/ inherits base { =C2=A0=C2=A0
=C2=A0 class = {'lb': maintenance_mode =C2=A0 =3D> 'norestart',}
<= div>}

This will remove lot of redundancy and ugly dependencies we have= now....WDYT?


--
Akila Ravihansa P= erera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone:=C2=A0+94 77 64 154 38=
Blog:=C2=A0
http://ravihansa3000.blogspot.com



--
Best Regards,
Nirmal

Nirmal = Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.




--
Akila Ravihansa Perera
Software Engineer
WSO2 = Inc.
http= ://wso2.com

Phone:=C2=A0+94 77 64 154 3= 8
Blog:=C2=A0
http://ravihansa3000.blogspot.com


=
--
Best Regards,
Nirmal

Nirmal Fernando.=
PPMC Member & Committer of Apache Stratos,
Senior Software Engin= eer, WSO2 Inc.




--
Akila= Ravihansa Perera
Software Engineer
WSO2 Inc.
http= ://wso2.com

Phone:=C2=A0+94 77 64 154 3= 8
Blog:=C2=A0
http://ravihansa3000.blogspot.com



--
Best R= egards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of= Apache Stratos,
Senior Software Engineer, WSO2 Inc.

--047d7b6d950257945204f6d847b9--