Commit Graph

1401 Commits

Author SHA1 Message Date
Jarek Kowalski
e22d22dba2 object: implemented fast concatenation of objects by merging their index entries (#607) 2020-09-11 20:12:01 -07:00
Jarek Kowalski
faf280616a Splitter throughput improvements (#606)
* object: refactored writer to detect split points before writing

This introduces new primitive that will be moved into splitters
themselves in subsequent commits. I'm doing this in small steps to
ensure we don't regress at any time.

* splitter: refactored TestSplitters test

This is use slow (byte-by-byte) and fast (nextSplitPoint) methods of
determining split points.

Note nextSplitPoint is not implemented by splitters yet, but this
verifies that the test is expecting the right thing.

* object: splitter refactoring - replaced ShouldSplit() with NextSplitPoint() everywhere, still not optimized

* splitter: added additional dimension to splitter_test

We split either in large chunks or one byte at a time to catch
the corner cases in the splitter implementation.

* splitter: optimized splitters using NextSplitPoint primitive

This improves splitter performance by about 40% (buzhash) and makes
it virtually free for FIXED splitter.
2020-09-11 19:45:48 -07:00
Julio López
aebf8616a2 object: loadSeekTable helper (#608) 2020-09-11 19:12:13 -07:00
Jarek Kowalski
57888a81eb travis: disable publishing RPM on pull requests since it needs credentials 2020-09-11 09:21:14 -07:00
Jarek Kowalski
e4077674c9 build: publishing of scoop Windows packages via goreleaser
This is not really testable outside of building a tag.
2020-09-10 22:22:36 -07:00
Jarek Kowalski
f3fc2ea3b7 tools: misc fixes to RPM publishing 2020-09-10 22:11:33 -07:00
Jarek Kowalski
5494746e67 tools: clean up repomd directory before updating 2020-09-10 18:59:52 -07:00
Jarek Kowalski
17764567ab travis: update RPM and APT repos on linux/amd64 even for non-tagged commits 2020-09-10 17:30:17 -07:00
Julio López
acc98d89b7 Trivial test nits (#602)
* Ensure other repo is closed

* Prefer testlogging.Context in tests

* Prefer T.TempDir() in repotesting.Environment.Setup()
2020-09-10 17:26:03 -07:00
Julio López
70df5f738c testing: Refactor faketime (#597)
* Allow auto-advance in faketime.TimeAdvance
* Leverage TimeAdvance in faketime.AutoAdvance
* Concurrent test for faketime.AdvanceTime
2020-09-10 00:52:14 -07:00
Jarek Kowalski
f8d0abb020 Makefile: fixed publishing logic 2020-09-09 23:38:10 -07:00
Jarek Kowalski
4ef314bee5 Added RPM repository (#600)
* goreleaser: added signatures to RPM binaries

Currently goreleaser does not support it, so we're overriding
signing script and signing all RPMs that it produces.

Also changed goreleaser parameters to only publish binaries
when running on linux/amd64.

* build: added automatic publishing of RPMs to a YUM repository

Also fixed RPM file names to match local conventions.
2020-09-09 23:18:20 -07:00
Julio López
9d0b8081e9 Go 1.15 (#598)
* Use Go 1.15 in Travis
* Require Go 1.15 for building
2020-09-09 22:36:27 -07:00
Jarek Kowalski
913b3bbdd3 object: fixed splitter reset on reuse (#596)
This did not properly reset the splitter state for buzhash32 and
rabinkarp64, so object writer did not achieve perfect deduplication.

Fixes #595
2020-09-09 19:33:19 -07:00
Jarek Kowalski
640eb5ddf0 Update BUILD.md 2020-09-08 23:08:30 -07:00
Jarek Kowalski
3b87902433 Kopia UI improvements for repository management (#592)
* cli: added --tls-print-server-cert flag

This prints complete server certificate that is base64 and PEM-encoded.

It is needed for Electron to securely connect to the server outside of
the browser, since there's no way to trust certificate by fingerprint.

* server: added repo/exists API

* server: added ClientOptions to create and connect API

* server: exposed current-user API

* server: API to change description of a repository

* htmlui: refactored connect/create flow

This cleaned up the code a lot and made UX more obvious.

* kopia-ui: simplified repository management UX

Removed repository configuration window which was confusing due to
the notion of 'server'.

Now KopiaUI will automatically launch 'kopia server --ui' for each
config found in the kopia config directory and shut it down every
time repository is disconnected.

See https://youtu.be/P4Ll_LR4UVM for a quick demo.

Fixes #583
2020-09-07 08:00:19 -07:00
Jarek Kowalski
29ce1819cb Added support for setting and changing repository client options (description, read-only, hostname, username) (#589)
* repo: refactored client-specific options (hostname,username,description,readonly) into new struct that is JSON-compatible with current config

* cli: added 'repository set-client' to configure parameters of connected repository

* cli: cleaned up 'repository status' output
2020-09-04 13:57:15 -07:00
Jarek Kowalski
a5838ff34c Improvements to UX for mounting directories (both CLI and KopiaUI) (#573)
* cli: simplified mount command

See https://youtu.be/1Nt_HIl-NWQ

It will always use WebDAV on Windows and FUSE on Unix. Removed
confusing options.

New usage:

$ kopia mount [--browse]
    Mounts all snapshots in a temporary filesystem directory
    (both Unix and Windows).

$ kopia mount <object> [--browse]
    Mounts given object in a temporary filesystem directory
    (both Unix and Windows).

$ kopia mount <object> z: [--browse]
    Mounts given object as a given drive letter in Windows (using
    temporary WebDAV mount).

$ kopia mount <object> * [--browse]
    Mounts given object as a random drive letter in Windows.

$ kopia mount <object> /mount/path [--browse]
    Mounts given object in given path in Unix.

<object> can be the ID of a directory 'k<hash>' or 'all'

Optional --browse automatically opens OS-native file browser.

* htmlui: added UI for mounting directories

See https://youtu.be/T-9SshVa1d8 for a quick demo.

Also replaced some UI text with icons.

* lint: windows-specific fix
2020-09-03 17:46:48 -07:00
Jarek Kowalski
90a9cf1143 cli: plumbed through missing --server-cert-fingerprint option (#580)
Fixes: #577
2020-09-01 19:57:14 -07:00
Jarek Kowalski
a3be1e5cfe upload: fixed ForceHashPercentage behavior to be non-deterministic (#579)
Fixes #578
2020-09-01 17:36:24 -07:00
Jarek Kowalski
5e2994b4a9 content: fixed index compaction that would resurrect content entry during full maintenance (#563)
The problem was that while dropping deleted entries from the index
we were looking at index-local and nor merged result.

Say index1 has content1 created at t0.
Say index2 has content1 deleted at t1 > t0.

And we're compacting and dropping index entries deleted before t2,
such that t2 > t1.

Because create and delete records are in separate index files, the
compacted file would preserve "created t0" which is wrong.

This fix changes index compaction to always look at resolved content
status.

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-01 01:29:18 -07:00
Jarek Kowalski
ded1ecf936 implemented Cache Directory Tagging Specification + CLI + UI (#565)
Fixes #564

cli: added 'kopia policy set --ignore-cache-dirs' option to control
whether to ignore caches (global default=true)

ui: added checkbox to control 'Ignore Cache Dirs' in policy editor

ignorefs: moved ignoring cache directories to ignorefs layer

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-08-31 21:35:26 -07:00
Jarek Kowalski
c242235a32 blob: added SetTime() method which may be optionally implemented by blob.Storage (#575)
cli: added --times option to 'repository sync'
2020-08-31 19:50:15 -07:00
Jarek Kowalski
3d24fd8875 apt-publish: publish dummy i386 release, even though we don't make packages for it as Ubuntu on amd64 is sometimes confused and tries downloading i386 anyway (#574) 2020-08-31 17:22:17 -07:00
daniel-eys
39f1fae8a3 Set BuildVersion during repo initialization. (#572) 2020-08-30 17:29:28 -07:00
Jarek Kowalski
965160dba1 cli: ignore trailing / in repository server URL (#569)
Fixes #557
2020-08-30 16:10:26 -07:00
Jarek Kowalski
0dbaae1fa4 ui: fixed typo (#570) 2020-08-30 15:48:39 -07:00
Jarek Kowalski
bce4d78a6f site: fixed edit link (#568)
Fixes #567
2020-08-30 15:36:50 -07:00
phonovision
62c1a77520 Doc: fix create B2 repository cmd (#566)
Fix command line: "create" instead of "connect"
2020-08-30 15:22:54 -07:00
Jarek Kowalski
2011796897 website: added link to kopia forum (#561) 2020-08-28 12:31:53 -07:00
Jarek Kowalski
1a8fcb086c Added endurance test which tests kopia over long time scale (#558)
Globally replaced all use of time with internal 'clock' package
which provides indirection to time.Now()

Added support for faking clock in Kopia via KOPIA_FAKE_CLOCK_ENDPOINT

logfile: squelch annoying log message

testenv: added faketimeserver which serves time over HTTP

testing: added endurance test which tests kopia over long time scale

This creates kopia repository and simulates usage of Kopia over multiple
months (using accelerated fake time) to trigger effects that are only
visible after long time passage (maintenance, compactions, expirations).

The test is not used part of any test suite yet but will run in
post-submit mode only, preferably 24/7.

testing: refactored internal/clock to only support injection when
'testing' build tag is present
2020-08-26 23:03:46 -07:00
Jarek Kowalski
c11850cfb7 Tools to help investigate repository structures safely (#553)
* cli: added 'index inspect' which can dump contents of index blob or local file
* repo: added read-only option when connecting to a repo which prevents any mutations

Co-authored-by: Julio Lopez <julio+gh@k....io>
2020-08-25 17:55:48 -07:00
Jarek Kowalski
f41e904a01 logging: changed default file log level to debug 2020-08-22 06:38:24 -07:00
Nick
e7675f2d01 Address additional suggestions from fio workload PR #529 (#550)
Followup on recent PR #529, some suggestions and discussion after it was merged:

- Express probability as float in range [0,1]
- Add a unit test for DeleteContentsAtDepth
- Add a comment on writeFilesAtDepth explaining depth vs branchDepth
- Refactor pickRandSubdirPath for easier readability and understanding

Upon some reflection, I decided to refactor pickRandSubdirPath() to gather indexes and pick randomly from them instead of the previous reservoir sampling approach. I think this is easier to understand going forward without extra explanation, doesn't have much additional memory overhead, and reduces the number of rand calls to 1.
2020-08-20 21:10:56 -07:00
Julio López
5769b753b6 Minor doc edits (#549) 2020-08-17 22:28:07 -07:00
Jarek Kowalski
7ae823945c Experimental rclone backend (#545)
This will launch 'rclone webdav server' passing random TLS
certificate and username/password and serve predefined rclone
remote path.

This is very experimental, use with caution.

Fixes #313.

Additional / required changes:
* blob: (experimental) support for rclone provider
* server: refactored TLS utilities to separate package
* webdav: add support for specifying trusted TLS certificate fingerprint
* kopia-ui: added rclone support
2020-08-17 20:43:41 -07:00
Jarek Kowalski
48f253173b kopia-ui: added ability to connect to kopia server and few other minor tweaks (#546)
* kopia-ui: added ability to connect to kopia server

* kopia-ui: update status page to show some data for repositories connected to API server

* kopia-ui: hide user@host selection dropdown for kopia server repositories
2020-08-16 17:57:37 -07:00
Jarek Kowalski
27ec5c70a9 server: pre-read request body to fix HTTP/2 deadlock (#539)
Fixes #538 (hopefully)
2020-08-15 21:53:46 -07:00
Jarek Kowalski
923c91b5a4 infra: set up github action to run quick lint on pull requests (#535) 2020-08-14 22:27:09 -07:00
Nick
da6b933542 [Robustness] Add additional fio workloads and fix fio runner (#529)
* [Robustness] Add additional fio workloads

Add more fio workloads to write files at different depths in random
branches of the generated file system tree.

- Write files at depth
- Write files at a specified depth, creating a new directory branch at
a random depth
- Delete a random directory at a given depth
- Delete some or all of the contents of a random directory at
a specified depth
2020-08-14 21:54:52 -07:00
Jarek Kowalski
f0751233a0 apt: update caching parameters after push 2020-08-14 20:05:10 -07:00
Jarek Kowalski
f541734362 site: updated installation instructions now that we have APT repository (#534) 2020-08-14 19:13:04 -07:00
Nick
14d50aaa50 [Robustness] Fix for kopia runner and custom working directory (#533)
* [Robustness] Fix for kopia runner and custom work dir

Apply fix similar to #293 for the robustness kopia runner.
Add control for runner working directory.
2020-08-14 17:32:45 -07:00
Jarek Kowalski
b4f28fb18f kopia-ui: added license ID and description 2020-08-14 16:25:08 -07:00
Jarek Kowalski
3f71aef13d apt: fixed matching unstable version numbers 2020-08-14 15:34:05 -07:00
Jarek Kowalski
b7872760e0 makefile: fixed BOTO_PATH 2020-08-14 14:33:58 -07:00
Jarek Kowalski
b381d31eb8 tools: added apt-publish tool that push to APT repository
The repository is in GCS and the script will automatically copy
DEB files from dist/ to the proper locations and will regenerate
APT package index.
2020-08-14 14:08:10 -07:00
Jarek Kowalski
6915e032b3 goreleaser: tweaks to support APT repositories
* build 32-bit arm DEB and RPM with armhf suffix
* change output files to use kopia version instead of TAG-next for snapshots
2020-08-14 14:08:10 -07:00
Nick
0c3ab1337e [Robustness] Fswalker should ignore host name (#531)
Fix fswalker to ignore hostname to allow reporting
on walks done across different hosts. Also prevent
Before and After walk data from printing to reduce log size.
2020-08-13 16:40:23 -07:00
Nick
7da4022cfd [refactor] Move robustness and engine packages (#528)
Perform minor refactor by moving robustness and engine packages
in preparation for later PRs

Fix import path
2020-08-13 14:56:44 -07:00