On Mon, 12 Jul 2010, Darren Kenny wrote:
On 07/10/10 12:09 AM, Alok Aggarwal wrote:
3.7: Overall, I support the approach taken but I do have a nagging concern
about raising the requirements for plugging into DC. I think it would be
nice for users to be able to drop in custom scripts without having to write
Python or get heavily educated in how the engine & DOC work. I'm wondering
if we could provide a fairly simple "CustomScript" generic checkpoint that
could be easily added to a manifest and that would provide simple bridge
logic to retrieve items from the DOC into environment variables, execute a
named script, and report results back. Any thoughts?
I've been thinking about it some more since Darren also
pointed this out.
I think it would be easy to provide a generic checkpoint
that implements the checkpoint interfaces. The execute
method for that checkpoint would -
a) Pull out the values that have a high probability of being
used out of the DOC and stick it in a self.* variables.
For example: pkg image area path, ba_build path, tmp_dir
path, etc.
b) Have the following dummy code -
cmd = ["/usr/bin/myscript" + " " + self.pkg_img + " " + self.ba_build .. ]
subprocess.check_call(cmd)
A 3rd party would then just need to replace '/usr/bin/myscript'
with their script and provide the necessary arguments.
How does that sound?
On this, I mentioned some possible mechanisms to provide a solution for this
back in May, which are in the e-mail at:
http://mail.opensolaris.org/pipermail/caiman-discuss/2010-May/018064.html
Maybe some of these would be useful?
So, I took a this suggestion a little more.
With this approach, the schema would have to be
extended to provide a finalizer section which is
different from the execution section.
The challenge I see with this approach is, we'd
have to somehow associate a given finalizer with
an execution checkpoint. What I mean is - the
finalizer can run at any point in time during
the execution of the checkpoints. In order to ensure
it runs before or after the appropriate checkpoint,
there would need to thus be some way to correlate the
finalizer section with the execution section.
I do however like your idea of exposing which script
gets runs as part of a given checkpoint right there
in the manifest. So, I'm going to try to incorporate
that idea into my proposal.
Thanks,
Alok
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss