Re: PARENT attribute in placement resolution
"Goldsack, Patrick" <[email protected]> Thu, 29 Jun 2006 13:52:49 +0100
| Newsgroups | gmane.comp.java.smartfrog.devel |
|---|---|
| Message-ID | <[email protected]> |
Olivier,
This is an interesting use case.
1) First a comment on the description as given: I would put the
definition of DefaultSetup external to the sfConfig. The only reason why
you might include it is if the sfConfig were to be a template for
further extension (and thus probably not called sfConfig) you might want
to have in in the template so as to make it over-writable in the extends
of that template. If you want it included in sfConfig, you will have to
define it as DATA (or LAZY). Similarly with the definition of vm4rgma,
etc, the defnition "defaultsetup extends DefaultSetup" should be DATA.
2) If truth be told, placement is a semantic abberation, but with the
current extends operator a necessary one. We have for a long time been
wanting to replace it with an alternative one (see the proposed SF
Language v2), a kind of combined extends and place operator. In the mean
time, so as to tame the excesses of placement and make it closer to this
new operator, we have syntactically restricted the use of it to
"downward" placement - so the model is to extend, then place downwards
into the extension.
3) To work around the restriction, take the definiton of XenDomainVM,
for example, and wrap it as follows:
ConfigXenDomainVM extends XenDomain {
shell config:shell;
kernel config:kernel;
ramdisk config:ramdisk;
baseImage config:baseImage;
memory config:memory;
etc...
config extends DATA {
// some default values, or nothing, ...
}
}
Then in your sfConfig I would write
vm4rgma extends ConfigXenDomainLVM {
domainName "rgma";
ip "128.142.134.121";
hostname "oplaslim9-rgma";
config extends DATA DefaultSetup;
}
This has the advantage(?) that I could now write
vm4rgma extends ConfigXenDomainLVM {
domainName "rgma";
ip "128.142.134.121";
hostname "oplaslim9-rgma";
memory 512;
config extends DATA DefaultSetup;
}
And have the 512 overwrite the 256 from DefaultSetup.
The disadvantage(?) of this approach is that you need to pre-determine
which attributes are going to be extracted from the config attribute,
whereas your approach means that this is decided in the definition of
DefaultSetup (ie which attributes you place upwards).
4) We have been considering an extension of the language to support
"multiple" extension, so we could write
DefaultSetup extends {
shell LAZY ATTRIB myShell;
etc...
}
vm4rgma extends XenDomainLVM, DefaultSetup {
etc...
}
With the obvious semantics and I think this would do what you want in
this case, but not work as an replaceable block of attributes that can
be refered to by name. If one wanted to take vm4rgma and replace the
attributes to those from, for example, a set of attributes in
AnotherDefaultSetup, one could write
vm4rgma1 extends vm4rgma, AnotherDefaultSetup;
which is an approximation to that effect.
Patrick
-----Original Message-----
From: smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
Olivier Pernet
Sent: 28 June 2006 15:54
To: smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [Smartfrog-developer] PARENT attribute in placement resolution
Hello,
I saw in the reference manual that the PARENT, ROOT and ATTRIb reference
parts are not permitted in placement references.
However, we have a configuration here that we feel needs PARENT
references :
#####
#include "org/smartfrog/components.sf"
#include "org/smartfrog/sfcore/workflow/combinators/container.sf"
#include "ch/cern/openlab/smartfrog/xen/components.sf"
#include "org/smartfrog/services/shellscript/components.sf"
/*
* A gLite testbed-in-a-box. Deploy on a Xen-enabled machine.
*/
sfConfig extends Compound {
// Needed for proper termination of the component :
// the shell is needed for domain shutdown.
sfSyncTerminate true;
// The shell needs to come first, too.
myShell extends BashShell;
rgmaServer extends Compound {
vm4rgma extends XenDomainLVM {
domainName "rgma";
ip "128.142.134.121";
hostname "oplaslim9-rgma";
defaultsetup extends DefaultSetup;
}
dummy extends Prim {
sfHost ATTRIB vm4rgma:ip;
sfClass "org.smartfrog.sfcore.prim.PrimImpl";
}
}
vomsServer extends Compound {
vm4voms extends XenDomainLVM {
domainName "voms";
ip "128.142.134.122";
hostname "oplaslim9-voms";
defaultsetup extends DefaultSetup;
}
dummy extends Prim {
sfHost ATTRIB vm4voms:ip;
sfClass "org.smartfrog.sfcore.prim.PrimImpl";
}
}
DefaultSetup extends {
PARENT:shell LAZY ATTRIB myShell;
PARENT:kernel "/boot/vmlinuz-2.6-xen";
PARENT:ramdisk "/boot/initrd-2.6-xen.img";
PARENT:baseImage "/data/xen/slc3-smartfrog.img";
PARENT:memory 256;
PARENT:vcpus 2;
PARENT:volumeGroup "vg";
PARENT:volumeSize "2g";
PARENT:netmask "255.255.0.0";
PARENT:gateway "128.142.1.1";
}
}
#####
We'll be adding more virtual machines, so you can understand that we
don't want to duplicate the parameters all over the place.
We could certainly just use
kernel ATTRIB DefaultSetup:kernel;
,etc. for all parameters, but this is a lot of copy/paste and is not so
elegant.
Do you have another idea about how we could do this properly ?
Thanks in advance.
--
Olivier Pernet
Summer Student - CERN Openlab
We are the knights who say
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Smartfrog-developer mailing list
Smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/smartfrog-developer
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642