Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Poise Python is Archived #3

Open
gregorskii opened this issue Oct 21, 2019 · 6 comments
Open

Poise Python is Archived #3

gregorskii opened this issue Oct 21, 2019 · 6 comments

Comments

@gregorskii
Copy link

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+

poise/poise-python#146

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

@RulerOf
Copy link
Contributor

RulerOf commented Oct 22, 2019

@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
Copy link
Author

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
Copy link
Author

gregorskii commented Oct 27, 2019

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
Copy link
Contributor

RulerOf commented Oct 29, 2019

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
Copy link
Author

Awesome thanks. Will try this.

@gregorskii
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants