gamegos / supervisor-cookbook

Chef Cookbook for Supervisor
GNU General Public License v3.0
2 stars 7 forks source link

Poise Python is Archived #3

Open gregorskii opened 5 years ago

gregorskii commented 5 years ago

Hi, this appears to be the most up to date supervisor cookbook, but poise python has an error in its python version:

python_runtime_pip[supervisor] (/tmp/kitchen/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb line 118) had an error: ArgumentError: Malformed version number string 2.7.15+

https://github.com/poise/poise-python/issues/146

Can this cookbook be updated to use a more reliable python cookbook?

RulerOf commented 5 years ago

@gregorskii is there a clear successor to poise python? If poise is broken, I expect to run into trouble in my environment eventually, although we may be escaping problems by pinning pip 18 right now...

gregorskii commented 5 years ago

I didn’t find one, looking back at the work I did a few months ago on this project, I was also using poise, and backed out of it for the same reason.

At the moment I can’t install supervisor using this book, if pinning pip works that would be a good stop gap.

gregorskii commented 5 years ago

Just checking in, is it possible to easily resolve this?

Thanks.

EDIT:

currently I am installing python with:

package 'python-minimal'
package 'python-pip'

Which is not cross platform, may only work in Ubuntu.

But when I skip the supervisor_install step I get an error around this step:

  declare_resource(:template, 'supervisord_config_file') do

About a nil value here:

notifies :reload, find_resource(:supervisor_service, 'supervisor'), :delayed

Not too familiar with this chef config, but it looks like it registering a service resource. If i skip the supervisor_install '4.1.0' step that service does not get registered.

Any tips on how to bypass the python install if it's already installed?

RulerOf commented 5 years ago

Any tips on how to bypass the python install if it's already installed?

I think that you need to create a custom :supervisor_service resource. The cookbook defines one here: https://github.com/gamegos/supervisor-cookbook/blob/master/resources/service.rb

I think that if you create a resource with the same name in the cookbook where you're including this recipe, the find_resource() method will locate it and send this notification that way.

gregorskii commented 5 years ago

Awesome thanks. Will try this.

gregorskii commented 5 years ago

Hi @RulerOf I was able to get this to work with this combination:

Install python outside of this cookbook:

package 'python-minimal'
package 'python-pip'

Install this cookbook using:

execute "install supervisor" do
  command "pip install supervisor"
  action :run
end

supervisor_config 'supervisor'

supervisor_process "laravel-worker" do
  action :create
  type "program"
  A COMMAND
end

supervisor_service 'supervisor'

Making my cookbook depend on poise-service.

Copying the service from this cookbook into COOKBOOK/resources.

So I think it would make sense to make this cookbook run correctly with some flag indicating that python is installed externally, but still configuring the service. Or relying on this workaround.