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

s3 storage: NIO S3 library does not support glob #398

Open
buchanae opened this issue Dec 20, 2017 · 3 comments
Open

s3 storage: NIO S3 library does not support glob #398

buchanae opened this issue Dec 20, 2017 · 3 comments

Comments

@buchanae
Copy link
Contributor

In short, while using the S3 backend with TES, I realized the cwl.output.json was not being created. An uncaught exception was silently killing the server. The exception occurs because the S3 library doesn't support glob.

This line:
https://github.com/rabix/bunny/blob/develop/rabix-bindings-cwl/src/main/java/org/rabix/bindings/cwl/service/impl/CWLGlobServiceImpl.java#L57

Results in an uncaught exception, which maybe should be caught here:
https://github.com/rabix/bunny/blob/develop/rabix-bindings-cwl/src/main/java/org/rabix/bindings/cwl/CWLProcessor.java#L150

The stacktrace:

15:08:38.923 [pool-2-thread-1] ERROR org.rabix.bindings.cwl.CWLProcessor - Uncaught exception 
java.lang.UnsupportedOperationException: null
	at com.upplication.s3fs.S3FileSystem.getPathMatcher(S3FileSystem.java:105) ~[Amazon-S3-FileSystem-NIO2-b3456a1692f82d500c302f9e33ab803d9348bbc6.jar:na]
	at org.rabix.bindings.cwl.service.impl.CWLGlobServiceImpl.glob(CWLGlobServiceImpl.java:57) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.globFiles(CWLProcessor.java:380) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.collectOutput(CWLProcessor.java:316) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.collectOutputs(CWLProcessor.java:178) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.postprocess(CWLProcessor.java:147) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLBindings.postprocess(CWLBindings.java:198) [classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl.success(LocalTESWorkerServiceImpl.java:119) [classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl.access$100(LocalTESWorkerServiceImpl.java:78) [classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl$1.run(LocalTESWorkerServiceImpl.java:168) [classes/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_102]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
15:08:38.924 [pool-2-thread-1] ERROR o.r.b.t.s.i.LocalTESWorkerServiceImpl - Couldn't process job
org.rabix.bindings.BindingException: java.lang.UnsupportedOperationException
	at org.rabix.bindings.cwl.CWLProcessor.postprocess(CWLProcessor.java:154) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLBindings.postprocess(CWLBindings.java:198) ~[classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl.success(LocalTESWorkerServiceImpl.java:119) [classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl.access$100(LocalTESWorkerServiceImpl.java:78) [classes/:na]
	at org.rabix.backend.tes.service.impl.LocalTESWorkerServiceImpl$1.run(LocalTESWorkerServiceImpl.java:168) [classes/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_102]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_102]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
Caused by: java.lang.UnsupportedOperationException: null
	at com.upplication.s3fs.S3FileSystem.getPathMatcher(S3FileSystem.java:105) ~[Amazon-S3-FileSystem-NIO2-b3456a1692f82d500c302f9e33ab803d9348bbc6.jar:na]
	at org.rabix.bindings.cwl.service.impl.CWLGlobServiceImpl.glob(CWLGlobServiceImpl.java:57) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.globFiles(CWLProcessor.java:380) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.collectOutput(CWLProcessor.java:316) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.collectOutputs(CWLProcessor.java:178) ~[classes/:na]
	at org.rabix.bindings.cwl.CWLProcessor.postprocess(CWLProcessor.java:147) ~[classes/:na]
	... 11 common frames omitted
@buchanae
Copy link
Contributor Author

The method that needs to be implemented is here:
https://github.com/Upplication/Amazon-S3-FileSystem-NIO2/blob/master/src/main/java/com/upplication/s3fs/S3FileSystem.java#L102

I'm thinking of implementing a wrapper around that library that implements that method for globs on s3. I can't find any other libraries for NIO + S3. Thoughts?

@buchanae
Copy link
Contributor Author

buchanae commented Jan 3, 2018

I tried to implement a wrapper for this today, but got stuck at the NIO file system provider magic. Apparently it loads filesystem implementations from the classpath + JAR files, meaning it's not straightforward to implement a wrapper. At least, it's beyond my java skills for now.

With a little advice on how to deal with that issue, I can help implement glob.

@milos-ljubinkovic
Copy link
Contributor

The library supports file walking, it's just that the path matcher isn't implemented, but using a regular UnixPath matcher works just as well. I've made this change in the latest release.

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

2 participants