Skip to content
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

feat(pkg/objstore/s3): support for prefixes #1392

Closed
wants to merge 6 commits into from
Closed

feat(pkg/objstore/s3): support for prefixes #1392

wants to merge 6 commits into from

Conversation

jaredallard
Copy link

  • [] CHANGELOG Support for s3 prefixes

Changes

I added support for s3 prefixes based on the amazing work proposed by #1318

Verification

Tested configuration changes via unit test, tested integration wise by running it.

@jaredallard
Copy link
Author

Going to fix the docs related stuff... as soon as I figure out how that works

@jaredallard
Copy link
Author

Ready to go 🎉

fix(docs/storage): run make docs
chore: move up prefix parsing into parseConfig()

Signed-off-by: Jared Allard <jaredallard@outlook.com>
Signed-off-by: Jared Allard <jaredallard@outlook.com>
@@ -92,6 +94,11 @@ func parseConfig(conf []byte) (Config, error) {
config.PartSize = defaultMinPartSize
}

// here for testing
if config.Prefix != "" {
config.Prefix = strings.TrimSuffix(config.Prefix, DirDelim) + DirDelim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the configuration parsing test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding normal code just for tests doesn't sound like a good idea, consider removing this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

pkg/objstore/s3/s3.go Outdated Show resolved Hide resolved
pkg/objstore/s3/s3.go Show resolved Hide resolved
pkg/objstore/s3/s3.go Outdated Show resolved Hide resolved
jaredallard and others added 2 commits August 12, 2019 09:51
Co-Authored-By: Povilas Versockas <p.versockas@gmail.com>
Signed-off-by: Jared Allard <jaredallard@outlook.com>
Signed-off-by: Jared Allard <jaredallard@outlook.com>
@jaredallard
Copy link
Author

@edevouge feel free to nullify this PR with your work, I needed to implement this for my own use cases, and I would much rather you get credit than I.

@bwplotka
Copy link
Member

So, it looks good, but why are we limiting ourselves to S3 implementation? If we are getting into this, I think it might be a part of our interface instead. E.g Adding Prefix to

Type ObjProvider `yaml:"type"`

This will be then consistent across all object storages.

@github-edouard-devouge
Copy link

@edevouge feel free to nullify this PR with your work, I needed to implement this for my own use cases, and I would much rather you get credit than I.

@jaredallard : I appreciate your contribution, but it would be great the next time you decided to implement a design proposal to post a small comment on the issue thread to explain your intention. Because, I was also writing some code for this feature and it's not really efficient to do the job twice. I'll let you finish the job.

@jaredallard
Copy link
Author

So, it looks good, but why are we limiting ourselves to S3 implementation? If we are getting into this, I think it might be a part of our interface instead. E.g Adding Prefix to

Type ObjProvider `yaml:"type"`

This will be then consistent across all object storages.

Good point, I'll rework this.

@AnandDevan
Copy link

hi folks, is this waiting for the equivalent implementation on the other object stores for merging?
would like to see prefix supported for s3 soon

@stale
Copy link

stale bot commented Feb 7, 2020

This issue/PR has been automatically marked as stale because it has not had recent activity. Please comment on status otherwise the issue will be closed in a week. Thank you for your contributions.

@stale stale bot added the stale label Feb 7, 2020
@stale stale bot closed this Feb 14, 2020
@svyotov
Copy link

svyotov commented Jul 17, 2020

This looks like a good feature, do you think it will re-open?

@@ -87,6 +89,11 @@ func parseConfig(conf []byte) (Config, error) {
return Config{}, err
}

// here for testing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -90,6 +90,7 @@ config:
insecure_skip_verify: false
trace:
enable: false
prefix: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be curious and actually I think it's must-have to actually make this change on bucket level, not each bucket client level.. WDYT? (:

@bwplotka
Copy link
Member

Well it really depends on @jaredallard if he is willing to continue this change.

I believe to merge it we need to do it per global object storage config, not just S3, so all providers can reuse this prefix logic (: We can also discuss if it should be Prefix or Prefixes potentially on issue: #1318

Help wanted, we definitely would like to have this in!

@jaredallard
Copy link
Author

Hey, I'm likely to not drive this work to completion. I am no longer on the team that needed this change at my company (they have maintained a fork with this AFAIK). I may come and do it in my spare time, but I have a massive backlog of things to do outside of work and this is pretty low on that list for that reason 😓

Sorry everyone!

@bwplotka
Copy link
Member

This is totally ok (: No worries, and good luck!

It's best if you are transparent about the priorities, so someone else can take your work. :+1 Thanks!

so... let's keep it close and help wanted (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants