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

Caching DownloadToolResult #14

Open
lordofthejars opened this issue Oct 2, 2014 · 6 comments
Open

Caching DownloadToolResult #14

lordofthejars opened this issue Oct 2, 2014 · 6 comments

Comments

@lordofthejars
Copy link
Member

DownloadTool can be an expensive operative (for example you may download a database engine (MySQL for instance) and install it. You can achive the same result by implementing by yourself, but I think it would be great that before downloading something we could check if the file is already downloaded and if it is the case skip the download. Of course we could add a flag to remove this behavior.

WDYT?

@kpiwko
Copy link
Member

kpiwko commented Oct 2, 2014

Absolutely. Or timestamp based check.

Side note, plenty of these ideas are already implemented in our Gradle Test Env Plugin - this one for instance here https://github.com/aerogear/aerogear-testing-tools/blob/master/aerogear-test-env-plugin/src/main/groovy/org/jboss/aerogear/test/Installation.groovy#L131-L142

I'm looking forward to push these concepts back to Spacelift. @lordofthejars if you could help on Spacelift API definitions, that would be awesome!

@kpiwko
Copy link
Member

kpiwko commented Oct 2, 2014

@lordofthejars
Copy link
Member Author

Yes I have seen this class but I think that there are only interfaces not implementation.

@smiklosovic
Copy link
Member

We are not sure about how this all installation stuff should be done, it is only POC interface and it will likely change as the shape of current API is under the constant revision.

@smiklosovic
Copy link
Member

If it helps temporarily, just implement easy caching on your own. I am doing the same thing when I am downloading Selendroid server for Droidium in runtime here (1). Download it to $HOME/.mongodbcache/file and check if it is present or not. If it is there, you download nothing, if it is not there, download it there and use it. The next time you look into .mongodbcache you will find it there so you can skip downloading completely.

By the way, you can see nice example of task chaining there, when you download that file with DownloadTool, process method returns you downloaded File which is put on UnzipTool's input (into its process method) automatically so you are just unzipping it instantly. Pretty slick, that is Spacelift in action ;)

(1) https://github.com/arquillian/arquillian-droidium/blob/master/droidium-native/arquillian-droidium-native/src/main/java/org/arquillian/droidium/native_/configuration/SelendroidDownloader.java#L66-L78

@lordofthejars
Copy link
Member Author

Related with https://issues.jboss.org/browse/ARQ-1869

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

No branches or pull requests

3 participants