zrepl / zrepl

One-stop ZFS backup & replication solution
https://zrepl.github.io
MIT License
945 stars 94 forks source link
backup bookmark go golang incremental replication snapshot zfs

GitHub license Language: Go User Docs Support me on Patreon Donate via GitHub Sponsors Donate via Liberapay Donate via PayPal Twitter Chat

zrepl

zrepl is a one-stop ZFS backup & replication solution.

User Documentation

User Documentation can be found at zrepl.github.io.

Bug Reports

  1. If the issue is reproducible, enable debug logging, reproduce and capture the log.
  2. Open an issue on GitHub, with logs pasted as GitHub gists / inline.

Feature Requests

  1. Does your feature request require default values / some kind of configuration? If so, think of an expressive configuration example.
  2. Think of at least one use case that generalizes from your concrete application.
  3. Open an issue on GitHub with example conf & use case attached.
  4. Optional: Contact Christian Schwarz for contract work.

The above does not apply if you already implemented everything. Check out the Coding Workflow section below for details.

Development

zrepl is written in Go and uses Go modules to manage dependencies. The documentation is written in ReStructured Text using the Sphinx framework.

Building

Go Code

Dependencies:

Some Go code is generated, and generated code is committed to the source tree. Therefore, building does not require having code generation tools set up. When making changes that require code to be (re-)generated, run make generate. I downloads and installs pinned versions of the code generation tools into ./build/install. There is a CI check that ensures Git state is clean, i.e., code generation has been done by a PR and is deterministic.

Docs

Set up a Python environment that has docs/requirements.txt installed via pip. Use a venv to avoid global state.

Testing

The test suite is split into pure Go tests (make test-go) and platform tests that interact with ZFS and thus generally require root privileges (sudo make test-platform). Platform tests run on their own pool with the name zreplplatformtest, which is created using the file vdev in /tmp.

For a full code coverage profile, run make test-go COVER=1 && sudo make test-platform && make cover-merge. An HTML report can be generated using make cover-html.

Circle CI

We use CircleCI for automated build & test pre- and post-merge.

There are two workflows:

Artifacts are stored in CircleCI.

Releasing

Releases are issued via Git tags + GitHub Releases feature. The procedure to issue a release is as follows:

Official binary releases are not re-built when Go receives an update. If the Go update is critical to zrepl (e.g. a Go security update that affects zrepl), we'd issue a new source release. The rationale for this is that whereas distros provide a mechanism for this ($zrepl_source_release-$distro_package_revision), GitHub Releases doesn't which means we'd need to update the existing GitHub release's assets, which nobody would notice (no RSS feed updates, etc.). Downstream packagers can read the changelog to determine whether they want to push that minor release into their distro or simply skip it.

Notes to Distro Package Maintainers