Add snapshot and diff service
Remove rootfs service in place of snapshot service. Adds diff service for extracting and creating diffs. Diff creation is not yet implemented. This service allows pulling or creating images without needing root access to mount. Additionally in the future this will allow containerd to ensure extractions happen safely in a chroot if needed. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
1111
api/services/diff/diff.pb.go
Normal file
1111
api/services/diff/diff.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
58
api/services/diff/diff.proto
Normal file
58
api/services/diff/diff.proto
Normal file
@@ -0,0 +1,58 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package containerd.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "github.com/containerd/containerd/api/types/mount/mount.proto";
|
||||
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
|
||||
|
||||
// Diff service creates and applies diffs
|
||||
service Diff {
|
||||
// Apply applies the content associated with the provided digests onto
|
||||
// the provided mounts. Archive content will be extracted and
|
||||
// decompressed if necessary.
|
||||
rpc Apply(ApplyRequest) returns (ApplyResponse);
|
||||
|
||||
// Diff creates a diff between the given mounts and uploads the result
|
||||
// to the content store.
|
||||
rpc Diff(DiffRequest) returns (DiffResponse);
|
||||
}
|
||||
|
||||
message ApplyRequest {
|
||||
// Diff is the descriptor of the diff to be extracted
|
||||
containerd.v1.types.Descriptor diff = 1;
|
||||
|
||||
repeated containerd.v1.types.Mount mounts = 2;
|
||||
}
|
||||
|
||||
message ApplyResponse {
|
||||
// Applied is the descriptor for the object which was applied.
|
||||
// If the input was a compressed blob then the result will be
|
||||
// the descriptor for the uncompressed blob.
|
||||
containerd.v1.types.Descriptor applied = 1;
|
||||
}
|
||||
|
||||
message DiffRequest {
|
||||
// Left are the mounts which represent the older copy
|
||||
// in which is the base of the computed changes.
|
||||
repeated containerd.v1.types.Mount left = 1;
|
||||
|
||||
// Right are the mounts which represents the newer copy
|
||||
// in which changes from the left were made into.
|
||||
repeated containerd.v1.types.Mount right = 2;
|
||||
|
||||
// MediaType is the media type descriptor for the created diff
|
||||
// object
|
||||
string media_type = 3;
|
||||
|
||||
// Ref identifies the pre-commit content store object. This
|
||||
// reference can be used to get the status from the content store.
|
||||
string ref = 5;
|
||||
}
|
||||
|
||||
message DiffResponse {
|
||||
// Diff is the descriptor of the diff which can be applied
|
||||
containerd.v1.types.Descriptor diff = 3;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,35 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package containerd.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "github.com/containerd/containerd/api/types/mount/mount.proto";
|
||||
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
|
||||
|
||||
service RootFS {
|
||||
rpc Unpack(UnpackRequest) returns (UnpackResponse);
|
||||
rpc Prepare(PrepareRequest) returns (MountResponse);
|
||||
rpc Mounts(MountsRequest) returns (MountResponse);
|
||||
}
|
||||
|
||||
message UnpackRequest {
|
||||
repeated containerd.v1.types.Descriptor layers = 1;
|
||||
}
|
||||
|
||||
message UnpackResponse {
|
||||
string chainid = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false, (gogoproto.customname) = "ChainID"];
|
||||
}
|
||||
|
||||
message PrepareRequest {
|
||||
string name = 1;
|
||||
string chain_id = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false, (gogoproto.customname) = "ChainID"];
|
||||
bool readonly = 3;
|
||||
}
|
||||
|
||||
message MountsRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message MountResponse {
|
||||
repeated containerd.v1.types.Mount mounts = 1;
|
||||
}
|
||||
2379
api/services/snapshot/snapshots.pb.go
Normal file
2379
api/services/snapshot/snapshots.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
81
api/services/snapshot/snapshots.proto
Normal file
81
api/services/snapshot/snapshots.proto
Normal file
@@ -0,0 +1,81 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package containerd.v1.snapshot;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "github.com/containerd/containerd/api/types/mount/mount.proto";
|
||||
|
||||
// Snapshot service manages snapshots
|
||||
service Snapshot {
|
||||
rpc Prepare(PrepareRequest) returns (MountsResponse);
|
||||
rpc View(PrepareRequest) returns (MountsResponse);
|
||||
rpc Mounts(MountsRequest) returns (MountsResponse);
|
||||
rpc Commit(CommitRequest) returns (google.protobuf.Empty);
|
||||
rpc Remove(RemoveRequest) returns (google.protobuf.Empty);
|
||||
rpc Stat(StatRequest) returns (StatResponse);
|
||||
rpc List(ListRequest) returns (stream ListResponse);
|
||||
rpc Usage(UsageRequest) returns (UsageResponse);
|
||||
// "Snapshot" prepares a new set of mounts from existing name
|
||||
}
|
||||
|
||||
message PrepareRequest {
|
||||
string key = 1;
|
||||
string parent = 2;
|
||||
}
|
||||
|
||||
message MountsRequest {
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
message MountsResponse {
|
||||
repeated containerd.v1.types.Mount mounts = 1;
|
||||
}
|
||||
|
||||
message RemoveRequest {
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
message CommitRequest {
|
||||
string name = 1;
|
||||
string key = 2;
|
||||
}
|
||||
|
||||
message StatRequest {
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
enum Kind {
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
option (gogoproto.enum_customname) = "Kind";
|
||||
|
||||
ACTIVE = 0 [(gogoproto.enumvalue_customname) = "KindActive"];
|
||||
|
||||
COMMITTED = 1 [(gogoproto.enumvalue_customname) = "KindCommitted"];
|
||||
}
|
||||
|
||||
message Info {
|
||||
string name = 1;
|
||||
string parent = 2;
|
||||
Kind kind = 3;
|
||||
bool readonly = 4;
|
||||
}
|
||||
|
||||
message StatResponse {
|
||||
Info info = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
message ListRequest{}
|
||||
|
||||
message ListResponse {
|
||||
repeated Info info = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
message UsageRequest {
|
||||
string key = 1;
|
||||
}
|
||||
|
||||
message UsageResponse {
|
||||
int64 inodes = 2;
|
||||
int64 size = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user