installing carbon / passing PYTHONPATH to pip package provider?

245 views
Skip to first unread message

Amos Shapira

unread,
Jun 6, 2013, 12:30:56 AM6/6/13
to puppet...@googlegroups.com
My environment: Ubuntu LTS 12.04, carbon (https://github.com/graphite-project/carbon) 0.9.9 installed using "pip".

I just learned why when I run "pip freeze" on a system I don't see the "carbon" package even when it installed successfully - I should run it with "PYTHONPATH=/opt/graphite/lib/ pip freeze".

This causes Puppet to re-install the package on every run (and reload dependant servers), even though it's already installed and there is nothing that really needs to be done.

I guess this is the package's fault, but it made me hit once more a limitation in Puppet i.e. that I don't have a way to pass options or environment variables to "pip".

Apparently there are already a couple of issues and pull requests for this in https://github.com/puppetlabs/puppet/pull/1507 and https://projects.puppetlabs.com/issues/18029, but they don't seem likely to be accepted.

Alternatively - can anyone point me to how they solved the carbon package (or a similar) issue? i.e. that it doesn't get re-installed on every Puppet run?

Thanks,

--Amos

Amos Shapira

unread,
Jun 6, 2013, 6:32:35 PM6/6/13
to puppet...@googlegroups.com
Thanks.

This is similar to a solution suggested in https://github.com/graphite-project/carbon/issues/86#issuecomment-16200739 (there he adds a symlink instead of providing a copy).
What I don't like about these (practical) solutions is that they are fragile - either the symlink target could change (newer version, for instance) or the content of the copied file could change (and the change could be lost).

In the meantime I'm exploring a different direction - there are .deb packages for the version I want in later versions of Ubuntu than 12.04. They install cleanly on 12.04 (I assume this is because they are pure Python) and even if they didn't, I could rebuild them for 12.04 from source-deb. I intend to make them available on our internal repository and install them with the "apt" provider instead.

Cheers,

--Amos

On Thursday, 6 June 2013 23:23:21 UTC+10, Ben Whaley wrote:
Yep, I ran in to this as well, both with carbon and graphite-web. I solved it by adding the Python metadata in the appropriate location on my system. 

Check this gist for the code

Hope this helps.

- Ben

Nikola Petrov

unread,
Jun 11, 2013, 5:20:07 AM6/11/13
to puppet...@googlegroups.com
I also have some packages that were produced with fpm. Here is the
script that I am using - https://gist.github.com/nikolavp/5755563 which
was borrowed from a blog post I found on the net. You can of course
change the versions if you want.

Feel free to add dependency metadata to fpm when building the packages
and please comment on the gist if you end up with something useful ;)

--
Nikola
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To post to this group, send email to puppet...@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages