Bug 227155 - [NEW PORT] databases/py-carbonate: Tools for managing federated carbon clusters
Summary: [NEW PORT] databases/py-carbonate: Tools for managing federated carbon clusters
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kai Knoblich
URL:
Keywords: feature
Depends on:
Blocks:
 
Reported: 2018-04-01 07:08 UTC by Andreas Andersson
Modified: 2019-07-03 21:58 UTC (History)
2 users (show)

See Also:


Attachments
databases/py-carbonate (5.59 KB, patch)
2018-04-01 07:08 UTC, Andreas Andersson
no flags Details | Diff
Add concurrent to USES_PYTHON=, use ${REINPLACE_CMD} (4.33 KB, patch)
2018-04-01 11:38 UTC, Andreas Andersson
no flags Details | Diff
Update to 1.1.3 (2.65 KB, patch)
2018-04-04 08:31 UTC, Andreas Andersson
no flags Details | Diff
py-carbonate-1.1.5.patch (3.61 KB, patch)
2019-06-13 15:21 UTC, Kai Knoblich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Andersson 2018-04-01 07:08:26 UTC
Created attachment 192029 [details]
databases/py-carbonate

This brings databases/py-carbonate(https://github.com/graphite-project/carbonate). It is a set of utilities provided by the graphite-project that are very useful when you're operating carbon datastores. 

For instance should the number of machines in your cluster grow these utitilties can help you rebalance the cluster. It is also useful if you loose a node or accidentally delete all the metrics. It can help you sync that node.

This port has three patches included:
 * files/patch-carbonate_cluster.py - Fixes a bug, but there is no new release yet so I backported this fix (https://github.com/graphite-project/carbonate/commit/ac50289a3114d4c47d84284ac24950218ed061db)
 * files/patch-carbonate_util.py - Look for the carbonate.conf file in /usr/local/etc instead, which is more freebsd-ish (default is /opt/graphite/conf/.
 * files/patch-carbonate_util.py - Patches the default root directory where to look for whisper files, databases/py-carbon for instance writes to /var/db/carbon/whisper by default. 

I've tried this port and it works, a bit slow, but still, it works.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-04-01 09:42:42 UTC
Thanks Andreas. Can you please confirm QA passes?
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2018-04-01 09:43:02 UTC
Comment on attachment 192029 [details]
databases/py-carbonate

Maintainer approval doesn't apply to new (yet uncommited) ports
Comment 3 Andreas Andersson 2018-04-01 09:59:34 UTC
(In reply to Kubilay Kocak from comment #1)
Yes!

Poudriere QA passes with 10.3, 10.4, 11.1 and 12-CURRENT. portlint -AC is also fine. Functionality also verified with a very real usecase (the very reason I needed this tool). :)
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-04-01 10:29:23 UTC
I'll commit this now since you're so excited.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-04-01 10:44:27 UTC
A few review items:

/usr/local should never be hardcoded. In this case, since we cant pass it as a configuration to the build, use %%PREFIX%% in the patch, and then use REINPLACE_CMD to replace it with the current ${PREFIX} value at post-patch. [1]

Either add a comment above the commented out LICENSE_FILE to explain it ('not yet packaged with distfile'), or leave the line out. Without a comment it looks accidental.

Since the python package installs console scripts (things into localbase/bin) [2], make the port concurrent versions safe by using USE_PYTHON=concurrent, which will automatically version suffix all scripts and create (version-less) symlinks to point the versioned scriptnames. This isn't a major issue as the port currently only supports 2.7, but the port should be made concurrent safe anyway.

Add comments to patches, in particular for ones that aren't self explanatory. In this case the patch that adds 'ROUTER_HASH_TYPE = None'. You (awesomely) explained (most?) of them in your initial comment 0, add those comments and references to the top of all the patches themselves.

[1] See: 4.4.3. Simple Automatic Replacements in Porters Handbook
[2] https://github.com/graphite-project/carbonate/blob/master/setup.py#L37
Comment 6 Andreas Andersson 2018-04-01 11:38:03 UTC
Created attachment 192050 [details]
Add concurrent to USES_PYTHON=, use ${REINPLACE_CMD}

Thank you for your comments. 

This new diff removes two of the patches, and instead uses ${REINPLACE_CMD} to do two simple path changes to be more FreeBSD like.

It also comments on why the patch was made, with a reference to a thread on github. 

Lastly this port now adds concurrent to USES_PYTHON.
Comment 7 Andreas Andersson 2018-04-01 12:24:15 UTC
According to this: https://github.com/graphite-project/carbonate/pull/97 we might want to wait a day or two to commit this port since new version might be released soon as well as maybe getting tests which was requested by Kubilay
Comment 8 Andreas Andersson 2018-04-02 10:00:49 UTC
(In reply to Andreas Andersson from comment #7)

Will update my patch in one or two days. :)

https://github.com/graphite-project/carbonate/issues/96
Comment 9 Andreas Andersson 2018-04-04 08:31:44 UTC
Created attachment 192202 [details]
Update to 1.1.3

This updates to 1.1.3, thus I removed the remaining patch and the files/ directory since new release has the cluster.py fix.

Poudriere QA fine on 10.3, 10.4, 11.1 and 12-CURRENT. portlint -AC also fine.
Comment 10 Kai Knoblich freebsd_committer freebsd_triage 2019-06-13 15:21:46 UTC
Created attachment 205037 [details]
py-carbonate-1.1.5.patch

(In reply to Andreas Andersson from comment #9)

Hi Andreas,

at first: Sorry for the huge delay! Somehow this PR totally went under.

Meanwhile the latest release is 1.1.5 that has support for Python 3, that can be enabled once the dependent port databases/py-carbon is enabled for Python 3.

Attached you'll find an updated patch based on your initial patch with the following additions:

- Added LICENSE_FILE (upstream now packages that file)
- Improved pkg-descr a bit to give the users some more info about the port

If you're still interested to get this port into the ports tree and the 1.1.5 release works for you then I'm happy to commit it asap.
Comment 11 Kai Knoblich freebsd_committer freebsd_triage 2019-07-03 21:58:44 UTC
Closing this PR with "Feedback Timeout" as it seems that there's no more interest to bring this port into the ports tree.

Andreas, feel free to re-open this PR if you still want databases/py-carbonate into the Ports tree.