afero icon indicating copy to clipboard operation
afero copied to clipboard

Added Support for openstack swift object storage

Open kolaente opened this issue 5 years ago • 14 comments

This pr adds support for openstack swift object storage.

To run the tests, you'll need access to an openstack swift store, I've used the one from ovh since its pretty cheap (at least for testing). You'll then need to set the env variables SWIFT_APIUSER, SWIFT_APIKEY, SWIFT_AUTHURL and SWIFT_DOMAIN. Also someone needs to do this in travis if we want to run these tests in the ci.

kolaente avatar May 06 '19 20:05 kolaente

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 06 '19 20:05 CLAassistant

Needs a rebase

0xmichalis avatar Sep 12 '20 21:09 0xmichalis

@kargakis Done!

kolaente avatar Sep 26 '20 10:09 kolaente

I force-pushed the changes again since I kind messed up the rebase and accidentally included a lot of unrelated changes in the branch. Now it's all nice and clean.

kolaente avatar Sep 26 '20 10:09 kolaente

Can you document how to configure a Swift backend in https://github.com/spf13/afero#available-backends? Also the unit tests seem to fail in CI, please have a look.

0xmichalis avatar Sep 26 '20 10:09 0xmichalis

The test fails in ci because it needs a swift store to run the test and no access keys were provided. Someone with access to the ci needs to set the env variables SWIFT_APIUSER, SWIFT_APIKEY, SWIFT_AUTHURL and SWIFT_DOMAIN.

I'll add docs about how to use the backend.

kolaente avatar Sep 26 '20 10:09 kolaente

@spf13 please have a look and let us know how do you want to proceed with unit testing the Swift backend.

0xmichalis avatar Sep 26 '20 10:09 0xmichalis

@kargakis Added the documentation.

IMHO, "classic" unit testing this does not really make sense since most of the package is glue code between afero and the swift package. I think this kind of integration test with talking to a "real" storage server makes the most sense. Maybe we could put one (through docker?) in the ci though to reduce dependency on external services. Not sure how much of a hassle that would be.

kolaente avatar Sep 26 '20 11:09 kolaente

IMHO, "classic" unit testing this does not really make sense since most of the package is glue code between afero and the swift package. I think this kind of integration test with talking to a "real" storage server makes the most sense. Maybe we could put one (through docker?) in the ci though to reduce dependency on external services. Not sure how much of a hassle that would be.

This is nitpicking but you are right, my bad on using the word "unit". In any case, my question to @spf13 still stands, I am not sure how easy or whether it is possible at all to run our own services in Travis and/or AppVeyor.

0xmichalis avatar Sep 26 '20 11:09 0xmichalis

As with the GCS implementation, we can go ahead and merge this without "real" storage tests, just need to note in README that there is experimental support.

https://github.com/spf13/afero/pull/331

0xmichalis avatar Feb 27 '22 18:02 0xmichalis

@kolaente can you rebase on top of latest master?

0xmichalis avatar Feb 27 '22 18:02 0xmichalis

@kargakis wow I completely forgot I had this PR open :upside_down_face:

Just rebased, what should we do with the tests? Since they can't really run in CI as of now.

kolaente avatar Feb 27 '22 21:02 kolaente

Does the Swift library you are using have a mock client?

0xmichalis avatar Feb 27 '22 21:02 0xmichalis

The swift library has a fake swift server which stores everything in memory. As far as I understand it, that's kind of a mock client but more on the integration side. Not sure if we can use this here.

kolaente avatar Feb 27 '22 21:02 kolaente