add sysutils/zrepl port
Needs ReviewPublic

Authored by lifanov on Fri, Sep 22, 1:45 PM.

Details

Summary

zrepl is a tool for replicating ZFS filesystems

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lifanov created this revision.Fri, Sep 22, 1:45 PM
mat added inline comments.Fri, Sep 22, 2:03 PM
sysutils/zrepl/Makefile
13–14 ↗(On Diff #33319)

This appears too early.

lifanov updated this revision to Diff 33329.Fri, Sep 22, 2:58 PM

address mat's feedback: move PLIST_FILES after USES/USE block

This looks good, and I believe is ready for commit. I have included a couple of minor comments here, which are not show-stoppers.

sysutils/zrepl/Makefile
3 ↗(On Diff #33329)

These first 3 blocks are probably indented one tab too many

15 ↗(On Diff #33329)

This is indented one tab too many

44 ↗(On Diff #33329)

This is indented one tab too many

sysutils/zrepl/pkg-descr
2 ↗(On Diff #33329)

Having discussed this port with Christian at EuroBSDcon, I think we should include a small warning after this description to explain that there has not yet been the first 0.1 release yet, and as such this probably should not be used in "production" environments just yet.

woodsb02 updated this revision to Diff 33589.Sat, Sep 30, 11:20 AM

Add rc script and warning message. Fix indentation.

Hi Nikolai,
I hope you don't mind, but I updated this diff myself because I had added an rc script which makes it much easier to use.
I have completed build and run testing. It is working nicely.
Feel free to revert any changes if you don't like them.
Cheers,
Ben

me_cschwarz.com requested changes to this revision.Sat, Sep 30, 12:31 PM

I restructured logging during EuroBSDCon - zrepl now supports writing to syslog directly, as well as several log formats and other log sinks.

The revision I would like to see in ports is 7c86628f3b6d77c1b3833e1f75a979690aed5f30.

Compared to what we have here right now, changes required are:

  • newsyslog.conf.d entry
  • default config with syslog output enabled -> see examples / extend zrepl docs
  • daemon(8) should then interpret any stderr & stdout output as LOG_ALERT, since the only output there will be errors encountered while writing to the logging sinks
  • update dependencies if required

I'm on a train with flaky internet connection, so I cannot update the Gopkg files right, now, will do sow in a few hours, which will be another commit.

This revision now requires changes to proceed.Sat, Sep 30, 12:31 PM

OK, the Gopkg.{toml,lock} from 7c86628f3b6d77c1b3833e1f75a979690aed5f30 is up-to date, so the deps listed there are the ones required to build.

Hi Christian,

To me it sounds like you could tag your first (beta) 0.1 release as commit 7c86628f3b6d77c1b3833e1f75a979690aed5f30. Can I encourage this? ;)

Also, do we still need the big scary warning I introduced in pkg-message?

Thanks,
Ben

I mention tagging a release, because I think it will encourage users to begin testing it in non-production environments, and because it’s important for users to be using a consistent version during this pre-release testing. It’s not a 1.0 release, so it doesn’t matter that it’s not something you consider feature complete. Far too often do I see software on GitHub that doesn’t tag releases.

So I actually released a 0.0.1, signed with my pubkey.

I guess the warning can go away...

sysutils/zrepl/pkg-descr
1 ↗(On Diff #33589)

Can we write zrepl in small letters here?

So I actually released a 0.0.1, signed with my pubkey.

I guess the warning can go away...

Great news! Thanks for that :)

For some reason I can't download the release using the 0.01 release number. When I put that into the port and run "make makesum" I get the following output:

/usr/ports/sysutils/zrepl$ make makesum
=> zrepl-zrepl-0.01_GH0.tar.gz doesn't seem to exist in /usr/local/poudriere/ports/default/distfiles/.
=> Attempting to fetch https://codeload.github.com/zrepl/zrepl/tar.gz/0.01?dummy=/zrepl-zrepl-0.01_GH0.tar.gz
fetch: https://codeload.github.com/zrepl/zrepl/tar.gz/0.01?dummy=/zrepl-zrepl-0.01_GH0.tar.gz: Not Found

Are you sure you tagged the release in the normal way? Instructions are here: https://help.github.com/articles/creating-releases/

*facepalm* thanks... working now. :)

woodsb02 updated this revision to Diff 33599.Sun, Oct 1, 9:29 AM

As per comments from Christian Schwarz (zrepl author):

  • Update to 0.0.1 release, and remove big scary warning
  • Add syslog.d and newsyslog.conf.d entries
  • Add default config with syslog output enabled
  • Update rc script to interpret redirect any stdout/stderr as LOG_ALERT
  • Update dependencies
  • Add pkg-message explaining steps required after first install

For the record, the only dependencies I haven't included in the Makefile are the last 4 entries in Gopkg.lock (https://github.com/zrepl/zrepl/blob/0.0.1/Gopkg.lock).

It appears to work perfectly without adding anything related to these:

[[projects]]
  branch = "master"
  name = "golang.org/x/sys"
  packages = ["unix"]
  revision = "429f518978ab01db8bb6f44b66785088e7fba58b"

[[projects]]
  branch = "master"
  name = "golang.org/x/text"
  packages = ["internal/gen","internal/triegen","internal/ucd","transform","unicode/cldr","unicode/norm"]
  revision = "1cbadb444a806fd9430d14ad08967ed91da4fa0a"

[[projects]]
  branch = "v2"
  name = "gopkg.in/yaml.v2"
  packages = ["."]
  revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"

[solve-meta]
  analyzer-name = "dep"
  analyzer-version = 1
  inputs-digest = "7ce2ead5225e4bb72a34132538171a649b26de574596e909730658ddbc904cd5"
  solver-name = "gps-cdcl"
solver-version = 1

I believe this is ready for committing to ports. @lifanov are you happy with my updates, and do you want to commit it? Alternatively, let me know if you are happy for me to commit it.

lifanov added a comment.EditedSun, Oct 1, 2:26 PM

I'll take one last look at it and commit it in a few minutes. I hereby implicitly approve you (woodsb02) to make any sort of change to the port in the future including grabbing maintainership.

p.s. Sorry, I was traveling, just got back.

pkg-descr needs to start with a capital letter.
Also, it uses "written in Go" twice in the same sentence.

Closed by commit rP451047: new port: sysutils/zrepl (authored by lifanov, committed by ). · Explain WhySun, Oct 1, 2:44 PM
This revision was automatically updated to reflect the committed changes.
mat added inline comments.Fri, Oct 6, 2:58 PM
head/sysutils/zrepl/pkg-plist
2–3

If the syslog.d file can be customized, I think the newsyslog.conf.d file shoudl be customizable too. (Note the newsyslog sample file needs to be some other place.)

woodsb02 added inline comments.Fri, Oct 6, 4:24 PM
head/sysutils/zrepl/pkg-plist
2–3

I wanted to do this, but unlike syslogd which only includes .conf files, newsyslog include ALL files in the /usr/local/etc/newsyslog.conf.d/ directory.

Do you know if it is possible with package to put the .sample file in a different directory from the config file? It would violate POLA... but could work.

mat added inline comments.Fri, Oct 6, 4:34 PM
head/sysutils/zrepl/pkg-plist
2–3
$ ag newsyslog sysutils/munin-node/
sysutils/munin-node/pkg-plist
8:@dir etc/newsyslog.conf.d
9:@sample %%ETCDIR%%/munin-node.newsyslog etc/newsyslog.conf.d/munin-node

sysutils/munin-node/Makefile
91:     ${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-node.newsyslog
lifanov reopened this revision.Fri, Oct 6, 5:29 PM

Ughh, sorry. I didn't think of that.
What do you think of adding a file in etc/newsyslog.conf.d that does something like
<include> %%LOCALBASE%%/etc/zrepl-newsyslog.conf
and install a sample for that?

mat added a comment.Fri, Oct 6, 8:26 PM

Ughh, sorry. I didn't think of that.
What do you think of adding a file in etc/newsyslog.conf.d that does something like
<include> %%LOCALBASE%%/etc/zrepl-newsyslog.conf
and install a sample for that?

That seems like over-engineering. Why not simply install the sample file someplace else and use @sample to install it at the right place ?