Repository navigation
Conversation
97d22c4 to
ea39179
Compare
There was a problem hiding this comment.
I don't think the interface should rely on an external package like this. I see that it's used in the Registry interface below to get a repository, but wouldn't it make more sense for an implementation of Registry to decide if it's going to use x/net/context?
There was a problem hiding this comment.
@jlhawn The idea here is that we subscribe to x/net/context or we don't. Really, each method should start with a context argument. Perhaps, we could refactor this interface to be transaction oriented to capture that, making context an implementation detail of the transaction.
ea39179 to
c15c7ed
Compare
c15c7ed to
7877252
Compare
There was a problem hiding this comment.
If I understand correctly, the name "layer" in this comment is badly chosen (should include manifests and tags too).
There was a problem hiding this comment.
yes, the interface used to be called "LayerService", so I think the comment just wasn't updated.
bcfbdfe to
1c48e76
Compare
|
@jlhawn I've removed the repository field from descriptor, per our discussion in https://github.com/docker/distribution/pull/62/files#r25635220. Please update the manifest proposal accordingly. |
There was a problem hiding this comment.
Let's simplify the tag service to be a mapping between tag name to a Descriptor.
987b69d to
a7703fd
Compare
|
@stevvooe I think that is a fair way to look at it, since this is the top level interface it will likely get wrapped by the final implementations in such functionality. Let's re-address in a few weeks when we have a firmer picture of the Trust architecture, any change I would image is small or additive. |
f34e3e6 to
6f6f459
Compare
This commit sketches out a series of proposed interface improvements for defining interactions between distribution components. Please see doc.go for a general overview. Signed-off-by: Stephen J Day <[email protected]>
6f6f459 to
9c28431
Compare
Signed-off-by: Stephen J Day <[email protected]>
Signed-off-by: Stephen J Day <[email protected]>
|
@dmcgowan Added the |
There was a problem hiding this comment.
What's the case you would expect this to throw an error if its just doing a string or set comparison?
There was a problem hiding this comment.
We can probably remove this. It really depends on how we define scope. If it is just a syntax-based set (ie, glob or equiv), then we don't need the error here.
What if the implementation has to ask a registry?
There was a problem hiding this comment.
If the Scope object needs to make a request elsewhere, its implementation is more complex than Scope should be. This should really be a simple string function, not a membership check.
|
+1 to Namespace change, when do you foresee this PR getting ready to merge? |
|
@dmcgowan When 1.6 settles, this is going to be my primary goal. Realistically, we'll have to phase these changes in. For instance, changing |
There was a problem hiding this comment.
We should take this into consideration now since we are defining the registry service as an implementation of Namespace. If namespace covers more than repositories (which I think we agree it does), then what does it mean for Registry to be a partial implementation? Should a registry throw an error when an Index is retrieved, or should Namespace be a composed type.
There was a problem hiding this comment.
@dmcgowan Right now, the search/index proposal is too new. I think we can make this decision in the future. A compositional type with interfaces might make sense, but let's get a few in place before going too far.
|
@stevvooe do you anticipate this going in for 2.0? |
|
@ncdc No. This will happen after 2.0. I am going to stage the changes in, starting with the blob store and working my way up. |
There was a problem hiding this comment.
@dmcgowan @tibor What do you think about removing this method completely and just supporting io.ReaderAt on blob. It allows us to abstract blobs as a series of distributed chunks and defers the io.Reader implementation to the caller (ie NewReadSeeker(length int64, blob io.ReaderAt) (io.ReadCloser, error)).
There was a problem hiding this comment.
Why not NewReadSeeker(blob io.ReaderAt) (io.ReadSeekCloser, error) then every read becomes a ReadAt and the underlying ReadSeeker will need to keep track of the read state.
There was a problem hiding this comment.
I generally like the idea as long as we are not losing any optimizations from Seek + ReadAll
|
/cc @vbatts |
There was a problem hiding this comment.
can't you just not put it here, and level up with a
type BlobWriterFrom interface {
BlobWriter
io.ReaderFrom
}There was a problem hiding this comment.
// TODO(stevvooe): This should be optional.
io.ReaderFrom is probably the most important optimization from the client perspective. Without it either making a request per write is necessary or having an open request in which Write sends to the request body.
There was a problem hiding this comment.
Understandable. Then let's drop the comment? :-)
On May 6, 2015 9:28 AM, "Derek McGowan" [email protected] wrote:
In blobs.go
#193 (comment):
- io.Closer
- Reader() (ReadSeekCloser, error)
- // Handler returns an HTTP handler which serves the blob content, either
- // by redirection or directly serving the content itself.
- Handler(r *http.Request) (http.Handler, error)
+}
+// BlobWriter provides a handle for working with a blob store. Instances
+// should be obtained from BlobService.Writer and BlobService.Resume. If
+// supported by the store, a writer can be recovered with the id.
+type BlobWriter interface {
- io.WriteSeeker
- io.WriterAt
- io.ReaderFrom // TODO(stevvooe): This should be optional.
// TODO(stevvooe): This should be optional.
io.ReaderFrom is probably the most important optimization from the client
perspective. Without it either making a request per write is necessary or
having an open request in which Write sends to the request body.—
Reply to this email directly or view it on GitHub
https://github.com/docker/distribution/pull/193/files#r29775602.
|
I believe this is being picked up by @RichardScothern. |
This commit sketches out a series of proposed interface improvements for
defining interactions between distribution components. Please see doc.go for a
general overview.
Signed-off-by: Stephen J Day [email protected]
Connects to #159
Closes #264