-
Notifications
You must be signed in to change notification settings - Fork 100
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: add s3 backend support (without GC and dedupe) #216
storage: add s3 backend support (without GC and dedupe) #216
Conversation
examples/config-s3.json
Outdated
"version": "0.1.0-dev", | ||
"storage": { | ||
"rootDirectory": "/zot", | ||
"objectStoreParams": { |
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.
let's review this part carefully.
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.
Instead of "objectStorageParams", let's just call it "storageDriver"
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.
fixed
052bd63
to
e32460c
Compare
Codecov Report
@@ Coverage Diff @@
## main #216 +/- ##
==========================================
- Coverage 79.25% 77.97% -1.29%
==========================================
Files 43 30 -13
Lines 5360 5066 -294
==========================================
- Hits 4248 3950 -298
+ Misses 818 804 -14
- Partials 294 312 +18
Continue to review full report at Codecov.
|
55a0cb0
to
266c4a3
Compare
f4c208d
to
2378d65
Compare
7f10c1e
to
3c643e0
Compare
fecccff
to
cbe0f4d
Compare
But I'm not using the sdk directly, I'm using "github.com/docker/distribution/registry/storage/driver/factory" |
181122b
to
e650fd7
Compare
examples/config-s3.json
Outdated
"version": "0.1.0-dev", | ||
"storage": { | ||
"rootDirectory": "/zot", | ||
"objectStoreParams": { |
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.
Instead of "objectStorageParams", let's just call it "storageDriver"
examples/config-s3.json
Outdated
}, | ||
"subPaths": { | ||
"/devops": { | ||
"rootDirectory": "/zot-devops" |
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.
Each of these "rootDirectory" could potentially have their own "storageDriver"s
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.
Can we mix filesystem and s3? In the current implementation we can.
"storage": { | ||
"rootDirectory": "/zot", | ||
"objectStoreParams": { | ||
"name": "s3", |
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.
Is this the name of the driver or the KeyID for aws storage?
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.
it's both, I will add a document specifying all the parameters
pkg/api/controller.go
Outdated
storeName := fmt.Sprintf("%v", c.Config.Storage.ObjectStoreParams["name"]) | ||
|
||
// Init a Storager from connection string. | ||
store, err := factory.Create(storeName, c.Config.Storage.ObjectStoreParams) |
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.
Can we create a factory.Create("s3mock"...)? so we control its behaviour?
And specify driver=s3mock in config.
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.
I don;t understand the question.
You can do that already if you want with regionendpoint parameter.
"storageDriver": {
"name": "s3",
"region": "us-east-2",
"regionendpoint": "localhost:4566",
"bucket": "zot-storage",
"secure": false,
"skipverify": false
}
localhost:4566 is https://github.com/localstack/localstack
8d1d632
to
140c309
Compare
f563ac1
to
6053051
Compare
e5c9af7
to
54536c2
Compare
pkg/api/controller_test.go
Outdated
|
||
storageDriverParams := map[string]interface{}{ | ||
"rootDir": "zot", | ||
"name": "s3", |
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.
Make this S3StorageDriverName
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.
and other places too
pkg/api/controller_test.go
Outdated
conf.HTTP.Port = port | ||
storageDriverParams := map[string]interface{}{ | ||
"rootDir": "zot", | ||
"name": "s3", |
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.
Change this to the string constant.
54536c2
to
6cb11ee
Compare
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
6cb11ee
to
4ecc97c
Compare
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.
lgtm
pkg/api/controller_test.go
Outdated
|
||
storageDriverParams := map[string]interface{}{ | ||
"rootDir": "zot", | ||
"name": "s3", |
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.
Same here.
using: https://github.com/distribution/distribution/tree/main/registry/storage/driver
Supports a lot of storages types.