-
warden
A question about pkgsrc: is it possible to create a sparse zone, then "convert" it to pkgsrc, or bootstrap pkgsrc in any other type of zone (ipkg, lipkg, etc.)?
-
warden
This because I'd like to use IPS as long as it's possible (newbie here), but when I need to install something that's not available from its publishers, I wish to get it from pkgsrc, keeping the "build from source" method as a last resort... :)
-
wiedi
yep, you should be able to bootstrap pkgsrc like this with these steps:
pkgsrc.smartos.org/install-on-illumos/#standard-install
-
andyf
A pkgsrc zone is effectively just a sparse zone with the pkgsrc bootstrap in it, and some adjustments to the default PATH.
-
andyf
Here's the pkgsrc postinstall if you want to do the same steps by hand:
github.com/omniosorg/pkg5/blob/master/src/brand/pkgsrc/postinstall
-
warden
Ok, thanks! Still learning about brands, I tried to install NGINX with IPS in a sparse zone a few days ago, but it had trouble about missing libraries... surely because of a fault of mine (I'll retry ASAP), but I was wondering if sparse zones are a solid method to maintain services in a production environments. They are essentially what we call
-
warden
"tiny jails" in FreeBSD?
-
andyf
Yes, I use them for almost all of my services. You just need to be aware that they share the global zone's /usr (and a couple of other directories)
-
andyf
So if nginx depends on a library that is in /usr, then the package for that library needs to be installed in the global zone - that's pretty confusing for new users.
-
andyf
I think we added something to at least print some warnings as you install something like `nginx` in a sparse zone.
-
warden
Ok, in fact I has still to adapt to this architecture... in FreeBSD tiny jails are a no-brain choice, since all additional software (binaries, libraries and config files) is installed under /usr/local, which is always writable. Here is not the same.
-
ptribble
That's the advantage of pkgsrc in this context - it supplies all it's dependencies (beyond libc etc) so can be fully isolated
-
andyf
Yes, that's a nice approach too - and pkgsrc is basically like that.
-
ptribble
Another target for very sparse zones are single-binary go programs, which (usually) have essentially no dependencies
-
andyf
In practice I don't find it a problem - the number of packages you need to install in the GZ for this to work is very small and the sparse zones are tiny. For nginx you were probably missing just pcre2 or libxslt.
-
warden
Ok, now it’s more clear for me. Thanks for your explanations!
-
andyf
Services I run in sparse zones are things like NTP, DNS, email, database and web servers and I've been doing that for years and upgrading from release to release.
-
warden
For what I understand, I should change my vision about software management: in FreeBSD tiny jails, I think to packages as a part of the jail, but in Illumos sparse zones I have to see them as a component of GZ, while sparse NGZ are no more than “sandboxes” where I make applications installed in the GZ run into.
-
andyf
You have to see sparse zones as sharing pieces from the GZ, most commonly things like shared libraries, but I wouldn't install software into the GZ to run it in a sparse zone.
-
andyf
Packages from omnios extra install into /opt/ooce/ which is not shared, so you would just install nginx into the sparse zone, not the GZ.
-
andyf
Packages from pkgsrc install into /opt/local which is also not shared.
-
andyf
sparse is a compromise really - they take significantly less space but there is this extra complication of a shared /usr. Great for a lot of things though - anything more complicated I would just use lipkg.
-
warden
Uh, ok... so if I want to use sparse zones: shared libraries (or packages from omnios publisher) should be installed in GZ, while packages from extra.omnios into NGZ
-
andyf
Broadly, that's right. I'm just going to spin up an r52 VM and see if we did indeed add some helper messages. I thought we did but we might have them off by default.
-
warden
thanks, and please consider that IPS is still mostly unknown by me... the idea of "linked packages" for example, is not yet clear in my mind
-
andyf
Here's a copy of what I just tried. There are warnings, but I appreciate you have to know what you're looking at :)
-
andyf
-
warden
Great: in fact pkg(1) warns when installing NGINX into the sparse zone. Thanks for the clear explanation!
-
warden
IPS looks like a lot more complex but yet powerful than any other package management system I worked with so far (dnf, apt, FreeBSD's pkg and pkgng, OpenBSD's pkg)
-
m1ari
there's quite a bit to get used to regarding packages and zones especially when new, and it seems the documentation is a bit scattered at times especially when you don't always know what you're looking for.
-
jclulow
I don't think it's more complicated, per se, but some of it is _different_ in its expression of the complexity
-
jclulow
Lots of the complexity in other packaging systems is handled in an extremely ad hoc way, and often hidden right up until it causes a problem; e.g., with post-install scripts that wreck the system etc