-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use pyenv cookbook instead of poise for python install/usage #350
Changes from all commits
cd90d3d
916462a
ec61a57
b96cd11
5f47e08
368d79d
274f490
5b1a2b9
dadac83
e4ea3c8
b5190c8
f31eaa8
2d644d6
7e53531
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,30 +19,28 @@ | |
|
||
package Array(node['graphite']['system_packages']) | ||
|
||
python_package 'django' do | ||
pyenv_pip 'django' do | ||
virtualenv node['graphite']['base_dir'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we have a library helper we should use that in the resource instead of using node attributes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm kind of unclear on what you're asking, are you saying setting the virtualenv as a library helper and then remove setting all the |
||
user node['graphite']['user'] | ||
group node['graphite']['group'] | ||
version node['graphite']['django_version'] | ||
virtualenv node['graphite']['base_dir'] | ||
end | ||
|
||
python_package 'uwsgi' do | ||
pyenv_pip 'uwsgi' do | ||
virtualenv node['graphite']['base_dir'] | ||
user node['graphite']['user'] | ||
group node['graphite']['group'] | ||
options '--isolated' | ||
virtualenv node['graphite']['base_dir'] | ||
end | ||
|
||
python_package 'graphite_web' do | ||
pyenv_pip 'graphite_web' do | ||
package_name lazy { | ||
key = node['graphite']['install_type'] | ||
node['graphite']['package_names']['graphite_web'][key] | ||
} | ||
|
||
virtualenv node['graphite']['base_dir'] | ||
user node['graphite']['user'] | ||
version lazy { | ||
node['graphite']['version'] if node['graphite']['install_type'] == 'package' | ||
} | ||
user node['graphite']['user'] | ||
group node['graphite']['group'] | ||
install_options '--no-binary=:all:' | ||
virtualenv node['graphite']['base_dir'] | ||
options '--no-binary=:all:' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,10 @@ | |
property :config, [Hash, nil], default: nil | ||
|
||
action :create do | ||
python_package backend_name do | ||
backend_attributes.each { |attr, value| send(attr, value) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is some ruby/chef patterns that I don't really understand, please let me know what this is doing and how I can emulate this in my changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is “just” collecting all the attributes and sending them though. It’s a little terse, and hard to read. So I’m with you here and write something easier to read. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so its another way to set the properties here? if |
||
Chef::Log.info "Installing storage backend: #{package_name}" | ||
action :install | ||
user node['graphite']['user'] | ||
group node['graphite']['group'] | ||
install_options '--no-binary=:all:' | ||
pyenv_pip backend_name do | ||
virtualenv node['graphite']['base_dir'] | ||
user node['graphite']['user'] | ||
options '--no-binary=:all:' | ||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
property :pyenv_name, String, name_property: true | ||
property :python_version, String, default: '3.8.5' | ||
property :user, String, default: lazy { node['graphite']['user'] } | ||
property :graphite_dir, String, default: lazy { node['graphite']['base_dir'] } | ||
|
||
action :install do | ||
pyenv_user_install new_resource.pyenv_name do | ||
user new_resource.user | ||
end | ||
|
||
pyenv_python new_resource.python_version do | ||
user new_resource.user | ||
end | ||
|
||
pyenv_global new_resource.python_version do | ||
user new_resource.user | ||
end | ||
|
||
pyenv_pip 'virtualenv' do | ||
user new_resource.user | ||
end | ||
|
||
pyenv_script 'setup graphite virtualenv' do | ||
code "virtualenv #{new_resource.graphite_dir}" | ||
user new_resource.user | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a cleanup as i was thinking about the systemd portions of the cookbook, its not used anywhere. should i remove the change?