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

GH-391 Add Support for Other Storage Solutions #387

Merged
merged 13 commits into from
May 10, 2021
Merged

Conversation

Haven-King
Copy link
Contributor

@Haven-King Haven-King commented Mar 1, 2021

This pull request adds several storage options as alternatives to storing artifacts on the local disk storage. It does this by abstracting away most of the file manipulation logic into three concrete implementations of the StorageProvider interface:

  • FileSystemStorageProvider - Implements behavior identical to the current solution; stores all artifacts to disk.
  • S3StorageProvider - Uploads artifacts and metadata to Amazon S3. Useful for highly available systems, as well as serving artifacts statically.
  • RestAPIStorageProvider - Uploads artifacts and metadata to an external HTTP/HTTPS server which can handle the saving/loading of artifacts itself. This option will be useful for people aiming to customize their Reposilite server to a very high degree.

This PR is still a draft.

� Conflicts:
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/Reposilite.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/metadata/MetadataService.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/DeployService.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/DiskQuota.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/FileDetailsDto.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiEndpoint.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/stats/StatsStorage.java
�	reposilite-backend/src/main/java/org/panda_lang/reposilite/utils/FilesUtils.java
�	reposilite-backend/src/test/groovy/org/panda_lang/reposilite/repository/RepositoryServiceTest.groovy
�	reposilite-backend/src/test/workspace/reposilite.cdn
@dzikoysk
Copy link
Owner

dzikoysk commented Mar 1, 2021

Hey there! :)

Interesting changes, it might be kinda tricky to properly rewrite all of it at once. Also, as you can see, there is a lot of places that lost on the readability, for instance:

image

I think it might be a good idea to write some extra utilities to improve the readability of nio api. Let me know when you feel that PR is ready for review and ask whenever you think it might be helpful to discuss some aspects.

@dzikoysk dzikoysk changed the title Migrates from java.io to java.nio GH-391 Migrates from java.io to java.nio Mar 1, 2021
@dzikoysk dzikoysk linked an issue Mar 1, 2021 that may be closed by this pull request
@Haven-King
Copy link
Contributor Author

Alright. I was going to do some larger scale abstractions on storage in a separate PR, but doing so now would help clean up a lot of these things, so I'll go ahead and put them here.

@dzikoysk
Copy link
Owner

dzikoysk commented Mar 1, 2021

I think you could start by reporting issues that address motivations behind these changes. It's easier to work around it 😛

@dzikoysk dzikoysk mentioned this pull request Mar 9, 2021
…g, but everything seems to basically work. The S3StorageProvider needs to be tested, and a config option of some kind needs to be added to specify which storage provider to use.
@Haven-King Haven-King changed the title GH-391 Migrates from java.io to java.nio Add Support for Other Storage Solutions Mar 12, 2021
@Haven-King
Copy link
Contributor Author

Haven-King commented Mar 12, 2021

There's still some work that needs to be done before this is done, but most of the framework is there, so I thought I'd push to give you an idea of what I'm working with right now. What still needs to be done:

  • Make sure current tests pass for the FileSystemStorageProvider
  • Implement RestAPIStorageProvider
  • Add a way to specify which storage provider to use
  • Test the S3StorageProvider
  • Test the RestAPIStorageProvider

@Haven-King Haven-King changed the title Add Support for Other Storage Solutions GH-391 Add Support for Other Storage Solutions Mar 12, 2021
@dzikoysk
Copy link
Owner

It's hard to track all of these changes, but tests contain various scenarios and should inform about possible regressions. Tbh there is a little to much tests. Some of them are kinda messy, so if you see something strange that does not make any sense for you, just ask about it.

@dzikoysk dzikoysk added the breaking Issue breaks the compatibility with previous versions label Mar 13, 2021
@dzikoysk dzikoysk added this to the 2.10.x milestone Mar 13, 2021
@dzikoysk dzikoysk linked an issue Mar 13, 2021 that may be closed by this pull request
Haven-King and others added 3 commits April 20, 2021 17:29
…sically work. The S3StorageProvider needs to be tested. Config options have been added, but the no redeploy option has not been implemented yet. The REST API storage provider has not been implemented yet.
Most of the work for StorageProviders is done.
@Haven-King
Copy link
Contributor Author

Most of the work for StorageProviders is done. Everything seems to basically work. The S3StorageProvider needs to be tested. Config options have been added, but the no redeploy option has not been implemented yet. The REST API storage provider has not been implemented yet. There is definitely still work to be done, but I'm pretty happy with the direction it's moving in now.

@dzikoysk
Copy link
Owner

Great, remember that you don't have to provide all implementations at once in this PR. For instance, REST based provider could be just supported later in another, dedicated PR. By reviewing latest issues I also wonder if we want to keep compatibility with 2.x branch or we can just drop it and focus on something like 3.x 🤔

@Haven-King
Copy link
Contributor Author

Sure, bumping to 3.x would probably be reasonable. There are certainly a lot of changes in the works.

@dzikoysk
Copy link
Owner

dzikoysk commented May 2, 2021

I've stared rewriting frontend on 3.0 branch (as a draft #465). I'll try to limit changes on backend as much as possibile to relatively easy merge both of our PRs to master. As soon as you'll finish this PR, I'll fork master into 2.x branch and we will continue development of 3.0 on master.

@dzikoysk dzikoysk changed the base branch from master to nio May 10, 2021 21:12
# Conflicts:
#	.run/Reposilite.run.xml
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/Reposilite.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/ReposiliteUtils.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/config/ConfigurationLoader.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/DeployService.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupApiEndpoint.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/LookupService.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/ProxyService.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryAuthenticator.java
#	reposilite-backend/src/main/java/org/panda_lang/reposilite/repository/RepositoryStorage.java
#	reposilite-backend/src/test/groovy/org/panda_lang/reposilite/ReposiliteUtilsTest.groovy
#	reposilite-backend/src/test/groovy/org/panda_lang/reposilite/config/ConfigurationLoaderTest.groovy
#	reposilite-backend/src/test/groovy/org/panda_lang/reposilite/repository/ProxyServiceTest.groovy
#	reposilite-backend/src/test/groovy/org/panda_lang/reposilite/repository/RepositoryStorageTest.groovy
@dzikoysk
Copy link
Owner

This was unlinked from issues May 10, 2021
@dzikoysk dzikoysk merged commit 1af5b2b into dzikoysk:nio May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Issue breaks the compatibility with previous versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants