chef / omnibus

Easily create full-stack installers for your project across a variety of platforms.
Apache License 2.0
1.29k stars 296 forks source link

SmartOS can't install SVR4-style Solaris packages #321

Closed juliandunn closed 7 years ago

juliandunn commented 10 years ago

Let me try this again in the right repo...

SmartOS does not have the old Solaris pkgadd commands as it uses BSD pkgsrc under the covers. Thus, our attempt to coerce it into installing a SVR4-type .pkg file is actually incorrect.

If we actually do intend to support SmartOS in the context of the platform support RFC, then we would need to build native pkgsrc packages for it. (You could pkgtrans the Solaris ones to it as part of CI or something, as a cheap trick.)

bixu commented 10 years ago

FYI, I've done the pkgtrans excercise on SmartOS and the omnibus build still fails due to some missing libs, or libs at the wrong path (I forget which).

schisamo commented 10 years ago

@bixu Yeah I think we might need to do special builds for SmartOS. Please add your comments/support to opscode/chef-rfc#21 which is our aspirational platform support policy.

bixu commented 10 years ago

I totally get that. I'm still a bit confused about how the RFC process works. Do I just add comments to the discussion?

juliandunn commented 10 years ago

@bixu Yup.

bixu commented 10 years ago

Done. Thanks!

helperton commented 9 years ago

We're having the exact issue with Solaris 11.1

x.x.1.203 downloading https://www.opscode.com/chef/metadata?v=11.12.4&prerelease=false&nightlies=false&p=solaris2&pv=5.11&m=i386 x.x.1.203 to file /tmp/install.sh.1237/metadata.txt x.x.1.203 trying wget... x.x.1.203 url https://opscode-omnibus-packages.s3.amazonaws.com/solaris2/5.10/i386/chef-11.12.4-1.solaris2.5.10.solaris x.x.1.203 md5 45d4b863fc7a869e7939f2b7e302c7b5 x.x.1.203 sha256 1461ece12a984c7501c1e003633e6f7158dbb405d70177738c0b362617db4c77 x.x.1.203 downloaded metadata file looks valid... x.x.1.203 downloading https://opscode-omnibus-packages.s3.amazonaws.com/solaris2/5.10/i386/chef-11.12.4-1.solaris2.5.10.solaris x.x.1.203 to file /tmp/install.sh.1237/chef-11.12.4-1.solaris2.5.10.solaris x.x.1.203 trying wget... x.x.1.203 Comparing checksum with sha256sum... x.x.1.203 Installing Chef 11.12.4 x.x.1.203 installing with pkgadd... x.x.1.203 /dev/fd/63: line 410: pkgadd: command not found x.x.1.203 Installation failed x.x.1.203 Please file a bug report at https://github.com/opscode/opscode-omnitruck/issues/new x.x.1.203 Version: 11.12.4 x.x.1.203
x.x.1.203 Please detail your operating system type, version and any other relevant details x.x.1.203 Starting first Chef Client run... x.x.1.203 bash: line 86: chef-client: command not found

uname -a SunOS somehost 5.11 11.1 i86pc i386 i86pc

helperton commented 9 years ago

Temporarily linking pkadd to /usr/bin:

cd /usr/bin ln -s /usr/sbin/pkgadd

So that pkgadd is in the path of a normal user seems to temporarily fix it

bixu commented 9 years ago

IIRC, Chef engineering is using Vagrant as part of the Omnibus Chef build process. If this is true, then this work may help: https://github.com/vagrant-smartos/vagrant-smartos-zones

bahamas10 commented 9 years ago

Same issue here...

$ uname -a
SunOS sjc1-dave-01.voxer.com 5.11 joyent_20140530T010428Z i86pc i386 i86pc Solaris
bixu commented 9 years ago

What needs to happen for us to have an auto generated chef omnibus install for SmartOS? I would like to keep Chef as a first-class SmartOS citizen (developer momentum at $job is moving towards Ansible lately). I'd like Chef to remain an equally valid choice :)

bahamas10 commented 9 years ago

I would love to get chef working with omnibus on SmartOS... if there is anything I can do to help, or testing needed, etc. let me know i'm happy to help resolve this issue.

juliandunn commented 9 years ago

What we are in need of is some patches here. To start, you probably need to make a packager definition for SmartOS, if the toolchain is different than solaris, whose definition is here: https://github.com/chef/omnibus/blob/master/lib/omnibus/packagers/solaris.rb

After that, you can wire it into the platform packager map and try to omnibus-build a Chef client using the omnibus-chef project. Chances are, a native SmartOS build won't quite work because of Solaris conditionals, but it shouldn't be too much work to add that into the omnibus-chef project definition.

It's unlikely that Chef Software, Inc. will have paid developer resources to put into this effort, as SmartOS is not a platform used by very many customers, but we would definitely take community patches. Hopefully the foregoing is enough for those who are interested to go on!

bahamas10 commented 9 years ago

Great, thank you for the information @juliandunn

I'm currently attempting to run bundle exec omnbus build chef in omnibus-chef to completion without failing. I believe this patch https://github.com/chef/dep-selector-libgecode/pull/41 will fix some (if not all) of the errors I'm currently seeing.

I do have a question regarding the package building process however. From what I understand about packaging on SmartOS, the prefix defaults to /opt/local... i don't know if it is possible to install to a path outside of that directory. However, I would imagine that this is an issue that isn't unique to SmartOS, so how does omnibus get around this?

bixu commented 9 years ago

@bahamas10 I've got a real need for omnibus chef on SmartOS, so if you ever want to remote pair on this stuff, let me know. I'm in the Berlin timezone.

juliandunn commented 9 years ago

@bahamas10 I've never seen a packaging system enforce that packages can only be installed to a particular hierarchy. Omnibus assumes that the package will live in /opt/chef

bixu commented 9 years ago

/opt on SmartOS should be a fine location for the Omnibus install, as /opt is read/write on SmartOS.

bahamas10 commented 9 years ago

@bixu me too.. i'm in New York timezone but would be happy to sit down and try to nail this down.

@juliandunn I believe pkg on freebsd has very strict rules about packages being stuck in /usr/local for instance. Any package installed via that method will be under that directory for security purposes... i don't know if SmartOS is the same way.

Either way, like @bixu mentioned it's a moot point, because worst case scenario there could be a post install script to mv /path/where/chef/was/installed /opt/chef

bahamas10 commented 9 years ago

Just to get an updated todo

  1. get bundle exec omnibus build chef to work on smartos
  2. add a SmartOS packager definition to this project

To expand on section 1, we need to fix the bugs that are currently stopping this from working

If someone knows how to use those branches when running bundle exec omnibus build chef we can test them out and move forward.

juliandunn commented 9 years ago

Couple options for you to proceed:

bixu commented 9 years ago

@juliandunn, thanks for the tips.

@bahamas10, when do you want to remote-pair on this? thinking screenhero here - drop me an email via my GitHub profile?

michaelcarruthers commented 9 years ago

@bixu I am needing to have a SmartOS omnibus package, let me know if you need an extra pair of hands.

bahamas10 commented 9 years ago

FWIW these steps can get ruby and chef compiled and installed to /opt/chef on SmartOS. it's not the same as omnibus, but it does result in a self-contained chef installation https://gist.github.com/bahamas10/6a052faa8644d3d462d5