-
Notifications
You must be signed in to change notification settings - Fork 5
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
Simplify the use of S3 bucket for work directory #25
Comments
These are very good suggestions. At least we could do item one. But we will also try item two. Thanks! |
For number two, I would be happy to help you out since it might be tricky. But it would be a huge win for you guys in terms of attracting Nextflow users, who are quite spoiled and used to not having to mount their S3 bucket. Maybe I can review your code and try to outline the changes you would need to make? |
That would be very helpful. Will let you know if we have any problem. |
Since you have a REST API as you said in #24, probably the most straightforward approach would be to model the float executor after the AWS Batch executor in Nextflow rather than the grid executor, using the REST API directly instead of the CLI. The grid executor isn't really the right abstraction for float, because float is running in the cloud and using object storage as the work directory. If that's too much work, you might be able to get away with customizing the grid task handler for float. |
Cedric, I'm going to try a few things today to see if I can get the S3 paths to work. I see that the float CLI can accept an S3 path for the job script. Can it accept the job script via stdin? |
Did you change the build system at all? I'm trying to build the plugin following the README, but I when I run it, I get the following error: $ ./gradlew compileGroovy
BUILD SUCCESSFUL in 3s
21 actionable tasks: 1 executed, 20 up-to-date
$ ./launch.sh run hello -plugins nf-float
Missing '.launch.classpath' file -- create it by running: ./gradlew exportClasspath
$ ./gradlew exportClasspath
FAILURE: Build failed with an exception.
Task 'exportClasspath' not found in root project 'nf-float'. |
Never mind the build issue, I got it to work. I will submit a PR with some general improvements separately. Let me know if the float CLI can accept stdin, but we should be able to make it work either way. |
Cedric, sorry to spam you with comments. Although I was able to build locally, I'm getting this error when I try to run a pipeline: $ ./launch.sh run hello -plugins nf-float
N E X T F L O W ~ version 23.06.0-edge
Launching `https://github.com/nextflow-io/hello` [determined_wright] DSL2 - revision: 1d71f857bb [master]
ERROR ~ Unknown executor name: float I am just following the README instructions. Please let me know if there is anything else I need to do to make it work. |
Looks like the plugin is not loaded. You may need to check |
Unfortunately, the float command command does not support stdin scripts. The work around I can think of is to download the script and put it to some temp directory. |
The nf-lfoat plugin is being loaded, but it's not registering the executor. That's all I can tell for now. I will keep digging, maybe there is a bug in Nextflow. Which version of Nextflow are you building against? As for the job script, it says the float CLI accepts an S3 path so we can just do that. |
The source code I am building against on my dev machine is 23.02.1-edge. |
Is it possible for you to create a PR in the repo? Maybe I could take a look and debug the code. |
No code changes yet, this is just the base plugin. Here is a summary of what I'm doing:
At this point I get this error:
This was the first issue I asked about. It looks like the Makefile is missing a build step, compared to nf-hello: compile:
./gradlew :nextflow:exportClasspath compileGroovy
@echo "DONE `date`" So I run When I run the plugin again, I get the missing executor error:
So, how you are building and running this plugin differently from what I have done? |
Oh, I compile and generate the zip file with |
Okay, I see how that might be more reliable. I'm not sure why the source build isn't working, could be a bug in Nextflow. I will look into it when I have time. Thanks Cedric. I think that should be enough to get me into testing. I'm going to make a PR with some general suggestions around configuration, and I will look into the improved S3 support. |
Thanks, Ben. I will also try to work on this issues these days. If I understand it correctly, I think NextFlow support s3 working directory natively and I just need to make sure those working directory are mounted to the same path on the working node. |
I will go ahead and push a PR with what I have so far. The float CLI says that it can accept an S3 path for the job script:
But when I try that, I get this error: $ float [...] sbatch --dataVolume s3://nf-ireland/work --image quay.io/nextflow/bash --cpu 1 --mem 4 --job s3://nf-ireland/work/3b/ddc65e1ca1ea8967ab197b5337a10b/.command.run --customTag nf-job-id:6mzjkv-2
Error: Invalid argument, please provide a valid s3 url (code: 1003) Is there some custom syntax required for the S3 path? |
Can you add me as a collaborator so that I can push a branch? Or would you prefer that I create a fork? |
I don't have the privilege to add cooperator. Please feel free to create a fork. |
Okay, I made a PR. Let me know what you think about the float CLI error. |
Allow user to set s3 work directory. We will create an option to tell MMC to mount the s3 bucket on the worker nodes.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of `float` related options in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of `float` related options in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of `float` related options in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of `float` related options in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of `float` related options in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of globa `float` options in the `process` scope. Remove the default task option in `float` scope. Please specify them in the `process` scope. Bump the version to 0.2.0.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of globa `float` options in the `process` scope. Remove the default task option in `float` scope. Please specify them in the `process` scope. Bump the version to 0.2.0.
Retrieve all input and analyze the mount point. If the work directory is s3, we need to mount all s3 buckets in the input. Address review comments. Copy the code to retrieve s3 credentials from NextFlow's `Global` class because it will be updated in recent releases.
Retrieve all input and analyze the mount point. If the work directory is s3, we need to mount all s3 buckets in the input. Address review comments. Copy the code to retrieve s3 credentials from NextFlow's `Global` class because it will be updated in recent releases.
Use Nextflow's default registry and container image if the image is not specified. Otherwise raise error.
Use Nextflow's default registry and container image if the image is not specified. Otherwise raise error.
Allow user to set s3 work directory. We will tell float to mount the s3fs when the work directory is in s3. After this change, the Nextflow client doesn't need direct access to the work directory any more. Remove the support of globa `float` options in the `process` scope. Remove the default task option in `float` scope. Please specify them in the `process` scope. Bump the version to 0.2.0.
Retrieve all input and analyze the mount point. If the work directory is s3, we need to mount all s3 buckets in the input. Address review comments. Copy the code to retrieve s3 credentials from NextFlow's `Global` class because it will be updated in recent releases.
Use Nextflow's default registry and container image if the image is not specified. Otherwise raise error.
Fixed by #44 |
Here is the config I used in order to use S3 as the work directory:
I also had to mount
s3://nextflow-ci-dev
to my launch environment.It would be nice to simplify the S3 usage in two ways:
If the user specifies the
workDir
as an S3 path, set thenfs
option automatically. That way they don't have to set it twice or think about how things are mounted or wonder why the setting is callednfs
when they are using it for S3 😄Leverage Nextflow's ability to transparently operate on S3 paths through the
Path
API. In other words, your executor should be able to interact with the work directory without it being mounted locally. That way, the user doesn't need to mount an S3 bucket, they can just run their pipeline.I initially tried to do this with
workDir = 's3://nextflow-ci-dev/work'
, but it failed with anUnsupportedOperationException
. No error trace unfortunately, but it is somewhere inGridTaskHandler::submit()
. This exception likely means that the executor tried to do a file operation that isn't supported by S3.The text was updated successfully, but these errors were encountered: