-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage Driver: Ceph Object Storage (RADOS) #443
Conversation
@gierschv This is looking promising. Can't wait to see the testsuites passing. Will you be able to maintain this in the future? |
a10d23a
to
287ebfc
Compare
@stevvooe Yes, I can maintain it in the future. For the CI, I installed a ceph micro cluster in Circle CI, as done in go-ceph for travis and it works pretty fine: ok github.com/docker/distribution/registry/storage/driver/rados 58.569s coverage: 78.3% of statements |
// Remove a file from the files hierarchy | ||
func (d *driver) DeleteOid(path string) error { | ||
// Remove object reference | ||
directory := filepath.Dir(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that we don't want the path layout to change when running on unix or windows, this should use the path
package rather than filepath
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I replaced filepath
by path
.
Added dotnwat/go-ceph#19 (which is now merged) for the third todo ("List all the keys of the omaps without a fixed limit of keys"). I'll work on it tomorrow. |
} | ||
|
||
// Reference a object and its hierarchy | ||
func (d *driver) PutOid(objectPath string, oid string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these methods need to be exported?
@gierschv Another thought here: Will a user require to the librados libraries to be available to build the registry? If so, should we hide rados support behind a compilation flag. We'll build the official images with rados built-in but developers shouldn't be required to build with it. |
@stevvooe Indeed, for now it requires the librados to build it. |
@gierschv I think explicit build tags are the right approach. No need for a separate build script, as that is outside the scope of this PR. Just make sure the build tag is easy to use and let's add some documentation to |
@gierschv is it possible to reference a specific tag or branch for go-ceph from dependencies such as this pull request? I would like to avoid cutting a stable release since the API is still be hashed out, but would be happy to cut a branch or tag since it looks like we have more than a couple users now. |
2abc046
to
3bc9587
Compare
This driver implements the storagedriver.StorageDriver interface and uses Ceph Object Storage as storage backend. Since RADOS is an object storage and no hierarchy notion, the following convention is used to keep the filesystem notions stored in this backend: * All the objects data are stored with opaque UUID names prefixed (e.g. "blob:d3d232ff-ab3a-4046-9ab7-930228d4c164). * All the hierarchy information are stored in rados omaps, where the omap object identifier is the virtual directory name, the keys in a specific are the relative filenames and the values the blob object identifier (or empty value for a sub directory). e.g. For the following hierarchy: /directory1 /directory1/object1 /directory1/object2 /directory1/directory2/object3 The omap "/directory1" will contains the following key / values: - "object1" "blob:d3d232ff-ab3a-4046-9ab7-930228d4c164" - "object2" "blob:db2e359d-4af0-4bfb-ba1d-d2fd029866a0" - "directory2" "" The omap "/directory1/directory2" will contains: - "object3" "blob:9ae2371c-81fc-4945-80ac-8bf7f566a5d9" * The MOVE is implemented by changing the reference to a specific blob in its parent virtual directory omap. This driver stripes rados objects to a fixed size (e.g. 4M). The idea is to keep small objects (as done by RBD on the top of RADOS) that will be easily synchronized accross OSDs. The information of the original object (i.e total size of the chunks) is stored as a Xattr in the first chunk object. Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
LGTM! Do we want this to ship with the official registry? Do we need to make adjustments to the dockerfile to ensure this works? |
@stevvooe I can change the Dockerfile if we ship the drive with the registry :) Please let me know, I'll make the changes. |
@gierschv Want to do that in a separate PR? |
@stevvooe ok, I'll do that. |
Storage Driver: Ceph Object Storage (RADOS)
@gierschv I still got error while make
Is that you missed add |
@RyanDeng This tag is present in the |
@gierschv Thanks for looking into this. I saw the tag in |
@stevvooe that makes sense. Thanks for your advice. |
Would be nice to have some basic documentation along with this, in terms of what's needed to run the backend properly. So far I've tried adding |
@farcaller @yadutaf Please don't comment on closed or merged issues. |
Storage Driver: Ceph Object Storage (RADOS)
Storage Driver: Ceph Object Storage (RADOS)
This driver implements the storagedriver.StorageDriver interface and
uses Ceph Object Storage as storage backend.
Since RADOS is an object storage and no hierarchy notion, the
following convention is used to keep the filesystem notions stored in
this backend:
All the objects data are stored with opaque UUID names prefixed
(e.g. "blob:d3d232ff-ab3a-4046-9ab7-930228d4c164).
All the hierarchy information are stored in rados omaps, where the
omap object identifier is the virtual directory name, the keys in
a specific are the relative filenames and the values the blob
object identifier (or empty value for a sub directory).
e.g. For the following hierarchy:
/directory1
/directory1/object1
/directory1/object2
/directory1/directory2/object3
The omap "/directory1" will contains the following key / values:
The omap "/directory1/directory2" will contains:
The MOVE is implemented by changing the reference to a specific
blob in its parent virtual directory omap.
Todo for this WIP driver:
to keep small objects (as done by RBD on the top of RADOS) that
will be easily synchronized accross OSDs. The information of the
original object (i.e total size of the chunks) will be stored as a
Xattr in the first chunk object.
to list virtual directories).
Related: #40
Dependencies: dotnwat/go-ceph#15, dotnwat/go-ceph#16 and dotnwat/go-ceph#19 (merged)
Signed-off-by: Vincent Giersch vincent.giersch@ovh.net