You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a working POC which optionally uses rustic_core, see #87.
I think there are several things to enhance/fix, but I'll leave that to you @drdo ;-)
Here are the points, I stumbled over in the PoC:
error handling has been done just quick&dirty using anyhow or sometimes unhandled
Configuration of repository (storage+password): Here rustic has a complete different philosophy as restic and prefers config files to do the configuration. For the POC only local storage and a entered password works, see the unimplemented!() in the code and the docu to BackendOptions and RepositoryOptions in rustic_core. Actually if you were only using rustic_core, I would suggest to you to use those as leading config structs. Currently for the only working local storage, there is also way too much dependency overhead which is mostly because of the many storage backends rustic_core supports via opendal.
Due to the design (which I didn't want to break), for each snapshots and ls call, rustic (re-)opens the repository and (re-)reads the index. If you would change the design, things could work with just a single opening and index-load which would give much better performance when reading the tree from multiple snapshots.
I realized that you use all snapshot data to identify snapshots - snap.id would suffice. I also just mapped the needed data, feel free to complement the mapping from rustic_core::SnapshotFile to redu::Snapshot
Now the repository is only opened once and index is only read once (in Rustic::new()) which gives an immense performance boost especially when scanning multiple snapshots tree. It is still not optimal - better would be to not read the index for config() and snapshots() (not needed there) and only read it once before all ls() calls (and don't read it at all if no ls() is called) - but that would require a structural change outside of the restic module - feel free to do that yourself!
Is there something in rustic to parse repo strings in a restic-compatible way? For example an sftp repo.
BackendOptions::to_backends() already does string parsing; however only local, rclone, rest and opendal are supported. To use a backend supported by opendal, you need to give opendal:<SERVICE> as repo string (e.g. opendal:sftp) and supply options (like server, username etc) in BackendOptions::options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a working POC which optionally uses rustic_core, see #87.
I think there are several things to enhance/fix, but I'll leave that to you @drdo ;-)
Here are the points, I stumbled over in the PoC:
unimplemented!()in the code and the docu toBackendOptionsandRepositoryOptionsin rustic_core. Actually if you were only using rustic_core, I would suggest to you to use those as leading config structs. Currently for the only working local storage, there is also way too much dependency overhead which is mostly because of the many storage backendsrustic_coresupports viaopendal.snapshotsandlscall, rustic (re-)opens the repository and (re-)reads the index. If you would change the design, things could work with just a single opening and index-load which would give much better performance when reading the tree from multiple snapshots.snap.idwould suffice. I also just mapped the needed data, feel free to complement the mapping fromrustic_core::SnapshotFiletoredu::Snapshot