On 06/ 5/14 01:18 PM, Bart Smaalders wrote:
On 05/29/14 16:23, Yiteng Zhang wrote:
This looks like a good start to me.
How does it perform on an image containing solaris-large-server, both in
time taken and space saved?
Some areas of concern:
In __gen_hydrate_actions, you hard-code in exceptions for etc/zones/* files. This would be
much better done by adding 'dehydrate=false' to those files in their own manifests. That
way if we find other files that need to be retained, we can add the same attribute - or
other developers of those packages can. This would need to be done in ON -but it is
file-specific metadata, and belongs in the packages.
In __gen_hydrate_actions, you call get_manifest with ignore_excludes=True. Why?
It is possible to add a publisher and install packages from it _after_ dehydration.
I think this will break your use of 'all' in the dehydrated_pubs list; you're probably better
off not using 'all' but just dealing with the list of publishers.
Pkg operations performed after dehydration may malfunction in interesting ways.
Do we need to prevent this or test it? What happens if I add a package from
the solaris publisher after doing dehydration? What happens if I rehydrate after
doing that? It may just work, but we either need to test it or prevent users
from doing silly things.
I am going to implement the idea to prevent silly pkg operations like this:
If the pkg dehydrate command succeeds, a property named dehydrated with the
names of the publishers specified as the value is set on the image. I will change
the behavior of pkg install/uninstall/update/change-facet/change-variant to first check
if the pkg operations are going to modify the package content delivered by the dehydrated
publishers. If so, we will warn the users and do nothing. If not, we do what the pkg
operations were supposed to do.
For example, if users dehydrated on publisher 'solaris', then we will prevent users installing
any package from the 'solaris' publisher, but we won't prevent users installing packages
from other publishers.
At this point, I find it might be a little tricky to implement the idea because we couldn't
simply check the publishers at the very beginning but need to filter the fmri lists by the
publishers. But I believe we can reach there.
Any suggestion or objection?
[pkg-discuss] Re: code review request: pkg dehydrate/rehydrate