With the change to the snapshotter interface, we've now updated the
overlay driver to follow the conventions of the current test suite. To
support key unification, an hashed index was added to active and
committed directories. We still need to do some testing around
collisions, but we'll leave that for a future PR.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
After receiving feedback on the `snapshot.Driver` interface, it was
found that the behavior of active and committed snapshots was confusing.
We attempt to clean this up by doing the following:
1. Define the concept of "active" and "committed" snapshots and their
lifecycle relationship. Active snapshots can be created from a parent.
Committed snapshots can only be created from active snapshots.
2. Only committed snapshots can be a parent.
3. Unify the keyspace of snapshots. For common operations, such as
removal and stat, we only have a single method that works for both
active and committed snapshots. For methods that take one or the other,
the restriction is called out. `Remove` and `Delete` are consolidated
for this purpose.
4. Define the `Info` data type to include name, parent, kind and
readonly state. This allows us to collect `Exists` and `Parent` into a
single method `Stat` and simplifies the `Walk` method, eliding `Active`.
5. The `Driver` has been renamed to `Snapshotter` due to the overuse of
the term `Driver`.
Effectively, we now have snapshots that are either active or committed.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
We now include btrfs in the snapshot driver test suite. This includes
the addition of parent links and name hashing into the btrfs driver.
We'll probably endup replacing this with a common metadata store, as
these relationships are generally identical between implementations.
A small bug was discovered in the delete implementation in the course
testing, so the btrfs package has been updated with a fix.
The overlay driver was modified accordingly with the btrfs driver to use
`Driver` as the exported type of each driver packge.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Remove change type in favor of explicit change function.
Using change function makes it more difficult to unnecessarily
add to the change interface.
Update test apply functions to use an interface rather
than a function type.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
The change computation will be done on the callers thread
and use callbacks rather than running a goroutine and
returning a channel.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Compare is using its own time check comparison and
doing byte comparison when ambiguous rather than
ignoring it like this function does.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Add diff comparison with support for double walking
two trees for comparison or single walking a diff
tree. Single walking requires further implementation
for specific mount types.
Add directory copy function which is intended to provide
fastest possible local copy of file system directories
without hardlinking.
Add test package to make creating filesystems for
test easy and comparisons deep and informative.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
We now define the `snapshot.Driver` interface based on earlier work.
Many details of the model are worked out, such as snapshot lifecycle and
parentage of commits against "Active" snapshots.
The impetus of this change is to provide a snapshot POC that does a
complete push/pull workflow. The beginnings of a test suite for snapshot
drivers is included that we can use to verify the assumptions of
drivers. The intent is to port the existing tests over to this test
suite and start scaling contributions and test to the snapshot driver
subsystem.
There are still some details that need to be worked out, such as listing
and metadata access. We can do this activity as we further integrate
with tooling.
Signed-off-by: Stephen J Day <stephen.day@docker.com>