-
Notifications
You must be signed in to change notification settings - Fork 594
/
ScriptFileCopyStrategy.groovy
88 lines (77 loc) · 2.84 KB
/
ScriptFileCopyStrategy.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* Copyright 2013-2019, Centre for Genomic Regulation (CRG)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nextflow.executor
import java.nio.file.Path
/**
* Declares file operations used in the task wrapper script
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
interface ScriptFileCopyStrategy {
/**
* @return A BASH snippet included in the wrapper script to be executed *before* the task execution itself
*/
String getBeforeStartScript()
/**
* @param inputFiles All the input files as a map of <stage name, store path> pairs
* @return A BASH snippet included in the wrapper script that stages the task input files
*/
String getStageInputFilesScript(Map<String,Path> inputFiles)
/**
* @param outputFiles List of the output file names to unstage
* @param targetDir The directory where output files need to be unstaged ie. stored
* @return A BASH snippet included in the wrapper script that un-stages the task output files
*/
String getUnstageOutputFilesScript(List<String> outputFiles, Path targetDir)
/**
* Command to 'touch' a file
*
* @param file The absolute path of the file to be 'touched'
* @return The touch command script
*/
String touchFile( Path file )
/**
* @param file A file {@link Path}
* @return the path string given a {@link Path} object
*/
String fileStr( Path file )
/**
* The command to copy a path to the specified target folder
*
* @param name The name of the file to copy
* @param target The target directory
* @return The command to copy the file in the target folder
*/
String copyFile( String name, Path target )
/**
* @param file The {@link Path} to the exit file
* @return The exit file as a string
*/
String exitFile( Path file )
/**
* BASH command to redirect the specified file on the standard input
*
* @param file The file to be piped as an input
* @return BASH redirection for the specified file
*/
String pipeInputFile( Path file )
/**
* @param environment The task environment
* @param container Whenever the environment needs to be exported by a container engine
* @return The environment initialisation snippet
*/
String getEnvScript(Map environment, boolean container)
}