Skip to content

Commit

Permalink
Add support for rclone as stageOutMode option
Browse files Browse the repository at this point in the history
This commit add support for rclone as stageOutMode
used by Nextflow to control how output files are copied
from the local scratch directory to the task work dir.

The use of rclone is may provide more efficient copy of
large data files over network file system.

Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Jan 14, 2023
1 parent f333954 commit fde2ac2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,7 @@ Value Description
copy Output files are copied from the scratch directory to the work directory.
move Output files are moved from the scratch directory to the work directory.
rsync Output files are copied from the scratch directory to the work directory by using the ``rsync`` utility.
rclone Output files are copied from the scratch directory to the work directory by using the `rclone <https://rclone.org>`_ utility (note: it must be available in your cluster computing nodes, requires version ``23.01.0-edge`` or later).
======= ==================

See also: `scratch`_.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class SimpleFileCopyStrategy implements ScriptFileCopyStrategy {
* @return A shell copy or move command string
*/

static final List<String> VALID_STAGE_OUT_MODES = ['copy', 'move', 'rsync']
static final List<String> VALID_STAGE_OUT_MODES = ['copy', 'move', 'rsync', 'rclone']

protected String stageOutCommand( String source, Path targetDir, String mode ) {
def scheme = getPathScheme(targetDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ nxf_fs_rsync() {
rsync -rRl $1 $2
}

nxf_fs_rclone() {
rclone copyto $1 $2/$1
}

on_exit() {
exit_status=${nxf_main_ret:=$?}
printf $exit_status {{exit_file}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ nxf_fs_rsync() {
rsync -rRl $1 $2
}

nxf_fs_rclone() {
rclone copyto $1 $2/$1
}

on_exit() {
exit_status=${nxf_main_ret:=$?}
printf $exit_status > {{folder}}/.exitcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ nxf_fs_rsync() {
rsync -rRl $1 $2
}

nxf_fs_rclone() {
rclone copyto $1 $2/$1
}

on_exit() {
exit_status=${nxf_main_ret:=$?}
printf $exit_status > {{folder}}/.exitcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ nxf_fs_rsync() {
rsync -rRl $1 $2
}

nxf_fs_rclone() {
rclone copyto $1 $2/$1
}

on_exit() {
exit_status=${nxf_main_ret:=$?}
printf $exit_status > {{folder}}/.exitcode
Expand Down

0 comments on commit fde2ac2

Please sign in to comment.