展开

nextflow编译打包原理

最后发布时间 : 2024-06-11 20:30:12 浏览量 :

学习资源

nextflow 打包使用了capsule技术

capsule 'io.nextflow:capsule:1.1.1'

可以看到在文件packing.gradle中使用的包 fork自puniverse/capsule-maven

生信小木屋

编译打包

当我们使用下面命令打包时

export JAVA_HOME=/home/wy/software/jdk-19
export PATH=$JAVA_HOME/bin:$PATH
BUILD_PACK=1 gradle8.4  packAll

会生成以下文件

nextflow-prj/build
├── docker
│   └── Dockerfile
├── libs
│   └── nextflow-23.11.0-edge-all.jar
├── releases
│   └── nextflow-23.11.0-edge-all
└── tmp
    └── packAll
        └── MANIFEST.MF

文件nextflow-23.11.0-edge-all可以之间运行,前提条件时保证java 19环境已经安装成功

bash nextflow-23.11.0-edge-all

那么如何运行nextflow-23.11.0-edge-all.jar呢?
首先可以肯定的是文件nextflow-23.11.0-edge-all.jar里包含了所有的依,解压可以看到下列文件

/home/wy/workspace/nextflow-prj/build/libs/nextflow-23.11.0-edge-all
├── activation-1.1.1.jar
...
├── capsule
├── Capsule.class
...
├── META-INF
...
└── zstd-jni-1.4.4-7.jar

但是直接使用java -jar是不能直接运行的

为什么nextflow-23.11.0-edge-all可以运行,而nextflow-23.11.0-edge-all.jar不能运行呢?
可以看到在文件packing.gradle中有下列代码

task packAll(type: Jar) {
....
    doLast {
        file(releaseDir).mkdir()
        // cleanup
        def source = file("$buildDir/libs/nextflow-${version}-all.jar")
        def target = file("$releaseDir/nextflow-${version}-all"); target.delete()
        // append the big jar
        target.withOutputStream {
            it << file('nextflow').text.replaceAll(/NXF_PACK\=.*/, 'NXF_PACK=all')
            it << new FileInputStream(source)
        }
        // execute permission
        "chmod +x $target".execute()
    }
}

注意it << file('nextflow').text.replaceAll(/NXF_PACK\=.*/, 'NXF_PACK=all')这一行将bash文件nextflow(项目根目录下)中的NXF_PACK=.*替换为了NXF_PACK=all

我们将文件nextflow中的NXF_PACK=one改为NXF_PACK=all,那么会遇到下列错误。

生信小木屋

在shell文件中定位到错误位置
生信小木屋

我们发现只是变量NXF_BIN的值不对
生信小木屋

可以看到在NXF_PACK=all这里会对NXF_BIN值进行修改

打印echo $NXF_BIN发现该变量指向的路径是

/home/wy/.nextflow/framework/23.11.0-edge/nextflow-23.11.0-edge-all.jar

此时将文件nextflow-23.11.0-edge-all.jar拷贝到变量NXF_BIN指向的路径,再次运行nextflow即可成功。

日志级别设置

生信小木屋

https://www.nextflow.io/docs/latest/cli.html
Enable trace level logging for the specified packages. Multiple packages can be provided separating them with a comma, e.g. -trace nextflow,io.seqera.













源码安装

make pack
BUILD_PACK=1 gradle8.4 publishToMavenLocal -Dmaven.repo.local=${PWD}/build/docker/.nextflow/capsule/deps/

/home/wy/workspace/nextflow-prj/docs/developer/nextflow.ast.md

debug插件

生信小木屋

Class definition not found: groovy/yaml/YamlRuntimeException
https://www.nextflow.io/docs/latest/plugins.html
export PATH=/home/wy/software/jdk-11.0.20/bin:$PATH
./launch.sh
 ./gradlew exportClasspath
idea.sh 
/home/wy/workspace/nextflow/modules/nextflow/src/main/groovy/nextflow/Session.groovy
   if( config.resume ) {
            resumeMode = true
            uniqueId = UUID.fromString(config.resume as String)
        }
        else {
           uniqueId = systemEnv.get('NXF_UUID') ? UUID.fromString(systemEnv.get('NXF_UUID')) : UUID.randomUUID()
        }

    @PackageScope
    List<TraceObserver> createObservers() {

        final result = new ArrayList(10)

        // stats is created as first because others may depend on it
        statsObserver = new WorkflowStatsObserver(this)
        result.add(statsObserver)

        for( TraceObserverFactory f : Plugins.getExtensions(TraceObserverFactory) ) {
            log.debug "Observer factory: ${f.class.simpleName}"
            result.addAll(f.create(this))
        }

        return result
    }

/home/wy/workspace/nextflow/modules/nextflow/src/main/groovy/nextflow/script/ScriptRunner.groovy
    def execute( List<String> args = null, String entryName=null ) {
        assert scriptFile

        // init session
        session.init(scriptFile, args)

        // start session
        session.start()

nextflow数据类型

nextflow的数据类型包括 queue channels、value channels。

DataflowBroadcast、DataflowQueue、DataflowVariable

A value channel is created using the value factory method or by operators returning a single value

println Channel.fromSRA(['SRR8924749', 'SRR6326268 ', 'ERR908505'])
println Channel.from( 1, 3, 5, 7 )
println Channel.fromPath( 'download.csv' )
println Channel.value( 'Hello there' )
DataflowQueue(queue=[])
DataflowBroadcast around DataflowStream[?]
DataflowBroadcast around DataflowStream[?]
DataflowVariable(value=null)

创建Channel

使用SRA获取fastq文件
函数fromSRA可以从SRA获取数据

ch_sra = Channel.fromSRA(['SRR8924749', 'SRR6326268', 'ERR908505'])
ch_sra.view()

首选需要构建一个查询对象

def target = new DataflowQueue()
def explorer = new SraExplorer(target, opts).setQuery(query)

接下来执行查询操作

session.addIgniter { fetchSraFiles0(explorer.apply()) }

explorer.apply()执行query0绑定数据

    DataflowWriteChannel apply() {
        query0(query)
		
        target.bind(Channel.STOP)
        return target
    }

query0主要执行target.bind( [acc, files] )进行绑定

void query0(){
	target.bind( [acc, files] )
}

从mysql创建Channel

ch_qu = channel.fromQuery('select run_id from seqdata where is_check =TRUE', db: 'foo').take(10)

创建handler对象

final channel = CH.create()
final dataSource = dataSourceFromOpts(opts)
final handler = new QueryHandler()
	.withDataSource(dataSource)
	.withStatement(query)
	.withTarget(channel)
	.withOpts(opts)

执行查询

session.addIgniter {-> handler.perform(true) }

handler.perform(true)可以进行异步和同步的查询

QueryHandler perform(boolean async=false) {
	final conn = connect(dataSource ?: SqlDataSource.DEFAULT)
	if( async )
		queryAsync(conn)
	else
		queryExec(conn)
	return this
}
 QueryHandler perform(boolean async=false) {
        final conn = connect(dataSource ?: SqlDataSource.DEFAULT)
		queryAsync(conn)
        return this
    }

queryAsync主要执行对数据的绑定

try {
	target.bind(item)
}finally {
	target.bind(Channel.STOP)
}

Operator函数的源码解读

使类用nextflow.extension.OperatorImpl的类有
nextflow.plugin.extension.PluginExtensionProvider

    private Set<String> loadDefaultOperators() {
        final result = getDeclaredOperatorExtensionMethods0(OperatorImpl.class, true)
        for( String it : result )
            operatorExtensions.put(it, new PluginExtensionMethod(method: it, target: OperatorImpl.instance))
        return result
    }
    protected PluginExtensionProvider loadPluginExtensionMethods(String pluginId, PluginExtensionPoint ext, Map<String, String> includedNames){
        // find all operators defined in the plugin
        final definedOperators= getDeclaredOperatorExtensionMethods0(ext.getClass())
        // find all factories defined in the plugin
        final definedFactories= getDeclaredFactoryExtensionMethods0(ext.getClass())
        // find all functions defined in the plugin
        final definedFunctions= getDeclaredFunctionsExtensionMethods0(ext.getClass())

groovy脚本

nextflow.splitter.SplitterEx

def sample = file('/data/sample.txt')
println sample.countLines()
static long countLines(Path self, Map opts=EMPTY) {
	new TextSplitter().options(opts) .target(self) .count()
}

git仓库共享流程

BaseScript

private void setup() {
        binding.owner = this
        session = binding.getSession()
        processFactory = session.newProcessFactory(this)

        binding.setVariable( 'baseDir', session.baseDir )
        binding.setVariable( 'projectDir', session.baseDir )
        binding.setVariable( 'workDir', session.workDir )
        binding.setVariable( 'workflow', session.workflowMetadata )
        binding.setVariable( 'nextflow', NextflowMeta.instance )
        binding.setVariable('launchDir', Paths.get('./').toRealPath())
        binding.setVariable('moduleDir', meta.moduleDir )
    }

    protected process( String name, Closure<BodyDef> body ) {
        if( NF.isDsl2() ) {
            def process = new ProcessDef(this,body,name)
            meta.addDefinition(process)
        }
        else {
            throw new UnsupportedOperationException("DSL1 is not supported anymore")
        }
    }





# Verify nextflow jar is available
if [ ! -f "$NXF_BIN" ]; then
    [ -f "$NXF_PATH" ] && rm "$NXF_PATH"
    mkdir -p "$NXF_PATH" || exit $?
    tmpfile=$(make_temp)
    get "$NXF_URL" "$tmpfile" "$NXF_BIN"
    mv "$tmpfile" "$NXF_BIN"
fi

生信小木屋

cli=($("$JAVA_CMD" "${JAVA_OPTS[@]}" -jar "$NXF_BIN"))

java \
    -Dfile.encoding=UTF-8 -Dcapsule.trampoline \
    -Dcapsule.java.cmd=/home/gitpod/.sdkman/candidates/java/current/bin/java \
    -Dcom.sun.security.enableAIAcaIssuers=true \
    -Djava.awt.headless=true \
    -Dcapsule.java.home=/home/gitpod/.sdkman/candidates/java/current \
    -XX:+TieredCompilation \
    -XX:TieredStopAtLevel=1 \
    -jar nextflow-22.10.7-one.jar
Picked up JAVA_TOOL_OPTIONS:
  -Xmx3489m
"/home/gitpod/.sdkman/candidates/java/current/bin/java" "-Xmx3489m" "-XX:
+TieredCompilation" "-XX:
TieredStopAtLevel=1" "-Djava.library.path=/usr/java/packages/lib:
/usr/lib64:
/lib64:
/lib:
/usr/lib" "-Dfile.encoding=UTF-8" "-Dcapsule.app=nextflow_22.10.7" "-Djava.awt.headless=true" "
-Dcapsule.jar=/workspace/nextflow/a/nextflow-22.10.7-one.jar" "
-Dcom.sun.security.enableAIAcaIssuers=true" "
-classpath" "/workspace/nextflow/a/nextflow-22.10.7-one.jar:
/home/gitpod/.capsule/deps/io/nextflow/nextflow/22.10.7/nextflow-22.10.7.jar:
/home/gitpod/.capsule/deps/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar:
/home/gitpod/.capsule/deps/io/nextflow/nf-httpfs/22.10.7/nf-httpfs-22.10.7.jar:
/home/gitpod/.capsule/deps/io/nextflow/nf-commons/22.10.7/nf-commons-22.10.7.jar:
/home/gitpod/.capsule/deps/org/codehaus/groovy/groovy-nio/3.0.13/groovy-nio-3.0.13.jar:
/home/gitpod/.capsule/deps/org/codehaus/groovy/groovy-templates/3.0.13/groovy-templates-3.0.13.jar:
/home/gitpod/.capsule/deps/org/codehaus/groovy/groovy-xml/3.0.13/groovy-xml-3.0.13.jar:
/home/gitpod/.capsule/deps/org/codehaus/groovy/groovy-json/3.0.13/groovy-json-3.0.13.jar:
/home/gitpod/.capsule/deps/org/codehaus/groovy/groovy/3.0.13/groovy-3.0.13.jar:
/home/gitpod/.capsule/deps/org/slf4j/jcl-over-slf4j/1.7.36/jcl-over-slf4j-1.7.36.jar:
/home/gitpod/.capsule/deps/org/slf4j/jul-to-slf4j/1.7.36/jul-to-slf4j-1.7.36.jar:
/home/gitpod/.capsule/deps/org/slf4j/log4j-over-slf4j/1.7.36/log4j-over-slf4j-1.7.36.jar:
/home/gitpod/.capsule/deps/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar:
/home/gitpod/.capsule/deps/ch/qos/logback/logback-core/1.2.11/logback-core-1.2.11.jar:
/home/gitpod/.capsule/deps/org/codehaus/gpars/gpars/1.2.1/gpars-1.2.1.jar:
/home/gitpod/.capsule/deps/ch/grengine/grengine/1.3.0/grengine-1.3.0.jar:
/home/gitpod/.capsule/deps/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:
/home/gitpod/.capsule/deps/org/pf4j/pf4j-update/2.3.0/pf4j-update-2.3.0.jar:
/home/gitpod/.capsule/deps/commons-codec/commons-codec/1.15/commons-codec-1.15.jar:
/home/gitpod/.capsule/deps/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:
/home/gitpod/.capsule/deps/com/beust/jcommander/1.35/jcommander-1.35.jar:
/home/gitpod/.capsule/deps/com/esotericsoftware/kryo/kryo/2.24.0/kryo-2.24.0.jar:
/home/gitpod/.capsule/deps/org/iq80/leveldb/leveldb/0.12/leveldb-0.12.jar:
/home/gitpod/.capsule/deps/org/eclipse/jgit/org.eclipse.jgit/6.2.0.202206071550-r/org.eclipse.jgit-6.2.0.202206071550-r.jar:
/home/gitpod/.capsule/deps/javax/mail/mail/1.4.7/mail-1.4.7.jar:
/home/gitpod/.capsule/deps/javax/activation/activation/1.1.1/activation-1.1.1.jar:
/home/gitpod/.capsule/deps/org/yaml/snakeyaml/1.30/snakeyaml-1.30.jar:
/home/gitpod/.capsule/deps/org/jsoup/jsoup/1.14.3/jsoup-1.14.3.jar:
/home/gitpod/.capsule/deps/jline/jline/2.9/jline-2.9.jar:
/home/gitpod/.capsule/deps/org/pf4j/pf4j/3.4.1/pf4j-3.4.1.jar:
/home/gitpod/.capsule/deps/dev/failsafe/failsafe/3.1.0/failsafe-3.1.0.jar:
/home/gitpod/.capsule/deps/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar:
/home/gitpod/.capsule/deps/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:
/home/gitpod/.capsule/deps/org/multiverse/multiverse-core/0.7.0/multiverse-core-0.7.0.jar:
/home/gitpod/.capsule/deps/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar:
/home/gitpod/.capsule/deps/org/objenesis/objenesis/2.1/objenesis-2.1.jar:
/home/gitpod/.capsule/deps/org/iq80/leveldb/leveldb-api/0.12/leveldb-api-0.12.jar:
/home/gitpod/.capsule/deps/com/googlecode/javaewah/JavaEWAH/1.1.13/JavaEWAH-1.1.13.jar:
/home/gitpod/.capsule/deps/com/github/zafarkhaja/java-semver/0.9.0/java-semver-0.9.0.jar:
/home/gitpod/.capsule/deps/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:
/home/gitpod/.capsule/deps/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:
/home/gitpod/.capsule/deps/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:
/home/gitpod/.capsule/deps/org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar:
/home/gitpod/.capsule/deps/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.jar:
/home/gitpod/.capsule/deps/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:
/home/gitpod/.capsule/deps/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar" "nextflow.cli.Launcher"
/home/gitpod/.sdkman/candidates/java/current/bin/java 
    --add-opens=java.base/java.lang=ALL-UNNAMED 
    --add-opens=java.base/java.io=ALL-UNNAMED 
    --add-opens=java.base/java.nio=ALL-UNNAMED 
    --add-opens=java.base/java.net=ALL-UNNAMED 
    --add-opens=java.base/java.util=ALL-UNNAMED 
    --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED 
    --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED 
    --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED 
    --add-opens=java.base/sun.nio.ch=ALL-UNNAMED 
    --add-opens=java.base/sun.nio.fs=ALL-UNNAMED 
    --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED 
    --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED 
    --add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED 
    --add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED 
    --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED -XX:+TieredCompilation -XX:TieredStopAtLevel=1 
        -Djava.library.path=/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib 
        -Dfile.encoding=UTF-8 
        -Dcapsule.app=nextflow_22.10.7 
        -Djava.awt.headless=true 
        -Dcapsule.jar=/home/gitpod/.nextflow/framework/22.10.7/nextflow-22.10.7-one.jar 
        -Dcom.sun.security.enableAIAcaIssuers=true 
        -classpath /home/gitpod/.nextflow/framework/22.10.7/nextflow-22.10.7-one.jar:
        /home/gitpod/.nextflow/capsule/deps/io/nextflow/nextflow/22.10.7/nextflow-22.10.7.jar:
        /home/gitpod/.nextflow/capsule/deps/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar:
        /home/gitpod/.nextflow/capsule/deps/io/nextflow/nf-httpfs/22.10.7/nf-httpfs-22.10.7.jar:
        /home/gitpod/.nextflow/capsule/deps/io/nextflow/nf-commons/22.10.7/nf-commons-22.10.7.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/groovy/groovy-nio/3.0.13/groovy-nio-3.0.13.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/groovy/groovy-templates/3.0.13/groovy-templates-3.0.13.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/groovy/groovy-xml/3.0.13/groovy-xml-3.0.13.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/groovy/groovy-json/3.0.13/groovy-json-3.0.13.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/groovy/groovy/3.0.13/groovy-3.0.13.jar:
        /home/gitpod/.nextflow/capsule/deps/org/slf4j/jcl-over-slf4j/1.7.36/jcl-over-slf4j-1.7.36.jar:
        /home/gitpod/.nextflow/capsule/deps/org/slf4j/jul-to-slf4j/1.7.36/jul-to-slf4j-1.7.36.jar:
        /home/gitpod/.nextflow/capsule/deps/org/slf4j/log4j-over-slf4j/1.7.36/log4j-over-slf4j-1.7.36.jar:
        /home/gitpod/.nextflow/capsule/deps/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar:
        /home/gitpod/.nextflow/capsule/deps/ch/qos/logback/logback-core/1.2.11/logback-core-1.2.11.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/gpars/gpars/1.2.1/gpars-1.2.1.jar:
        /home/gitpod/.nextflow/capsule/deps/ch/grengine/grengine/1.3.0/grengine-1.3.0.jar:
        /home/gitpod/.nextflow/capsule/deps/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:
        /home/gitpod/.nextflow/capsule/deps/org/pf4j/pf4j-update/2.3.0/pf4j-update-2.3.0.jar:
        /home/gitpod/.nextflow/capsule/deps/commons-codec/commons-codec/1.15/commons-codec-1.15.jar:
        /home/gitpod/.nextflow/capsule/deps/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:
        /home/gitpod/.nextflow/capsule/deps/com/beust/jcommander/1.35/jcommander-1.35.jar:
        /home/gitpod/.nextflow/capsule/deps/com/esotericsoftware/kryo/kryo/2.24.0/kryo-2.24.0.jar:
        /home/gitpod/.nextflow/capsule/deps/org/iq80/leveldb/leveldb/0.12/leveldb-0.12.jar:
        /home/gitpod/.nextflow/capsule/deps/org/eclipse/jgit/org.eclipse.jgit/6.2.0.202206071550-r/org.eclipse.jgit-6.2.0.202206071550-r.jar:
        /home/gitpod/.nextflow/capsule/deps/javax/mail/mail/1.4.7/mail-1.4.7.jar:
        /home/gitpod/.nextflow/capsule/deps/javax/activation/activation/1.1.1/activation-1.1.1.jar:
        /home/gitpod/.nextflow/capsule/deps/org/yaml/snakeyaml/1.30/snakeyaml-1.30.jar:
        /home/gitpod/.nextflow/capsule/deps/org/jsoup/jsoup/1.14.3/jsoup-1.14.3.jar:
        /home/gitpod/.nextflow/capsule/deps/jline/jline/2.9/jline-2.9.jar:
        /home/gitpod/.nextflow/capsule/deps/org/pf4j/pf4j/3.4.1/pf4j-3.4.1.jar:
        /home/gitpod/.nextflow/capsule/deps/dev/failsafe/failsafe/3.1.0/failsafe-3.1.0.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar:
        /home/gitpod/.nextflow/capsule/deps/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:
        /home/gitpod/.nextflow/capsule/deps/org/multiverse/multiverse-core/0.7.0/multiverse-core-0.7.0.jar:
        /home/gitpod/.nextflow/capsule/deps/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar:
        /home/gitpod/.nextflow/capsule/deps/org/objenesis/objenesis/2.1/objenesis-2.1.jar:
        /home/gitpod/.nextflow/capsule/deps/org/iq80/leveldb/leveldb-api/0.12/leveldb-api-0.12.jar:
        /home/gitpod/.nextflow/capsule/deps/com/googlecode/javaewah/JavaEWAH/1.1.13/JavaEWAH-1.1.13.jar:
        /home/gitpod/.nextflow/capsule/deps/com/github/zafarkhaja/java-semver/0.9.0/java-semver-0.9.0.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:
        /home/gitpod/.nextflow/capsule/deps/org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/errorprone/error_prone_annotations/2.11.0/error_prone_annotations-2.11.0.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:
        /home/gitpod/.nextflow/capsule/deps/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar nextflow.cli.Launcher
-cp :
/workspace/nextflow/modules/nf-httpfs/build/libs/nf-httpfs-23.02.0-edge.jar:
/workspace/nextflow/modules/nf-commons/build/libs/nf-commons-23.02.0-edge.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-nio/3.0.15/fb0ec7070c5b3314c95f7b72a5bdda5e147c7a69/groovy-nio-3.0.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-templates/3.0.15/8abaf437341b845cc5b340c4dc381fafabd13589/groovy-templates-3.0.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-xml/3.0.15/c7788e04850ec4a49a7c1ea964fbb4b53ca2343c/groovy-xml-3.0.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-json/3.0.15/6a18f5afe5538acd3e753db828111b8b136af9f5/groovy-json-3.0.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/3.0.15/472c60adeb4e62e3a516e7c76da2df7c65348a9a/groovy-3.0.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.36/d877e195a05aca4a2f1ad2ff14bfec1393af4b5e/jcl-over-slf4j-1.7.36.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.36/ed46d81cef9c412a88caef405b58f93a678ff2ca/jul-to-slf4j-1.7.36.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.slf4j/log4j-over-slf4j/1.7.36/2a753acda077203a4794f106871bb237501c9a53/log4j-over-slf4j-1.7.36.jar:
/workspace/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.11/4741689214e9d1e8408b206506cbe76d1c6a7d60/logback-classic-1.2.11.jar:
/workspace/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.11/a01230df5ca5c34540cdaa3ad5efb012f1f1f792/logback-core-1.2.11.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.gpars/gpars/1.2.1/c3ea0fbcd67a163bd5e3a3efdaa3428262d0d437/gpars-1.2.1.jar:
/workspace/.gradle/caches/modules-2/files-2.1/ch.artecat.grengine/grengine/3.0.0/a882ab181d64a08d4c65e705639b10bda40e91c3/grengine-3.0.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/ce1edb914c94ebc388f086c6827e8bdeec71ac2/commons-lang-2.6.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.pf4j/pf4j-update/2.3.0/27b5ac44b6017013ed29727383026b592c351478/pf4j-update-2.3.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.15/49d94806b6e3dc933dacbd8acb0fdbab8ebd1e5d/commons-codec-1.15.jar:
/workspace/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.11.0/a2503f302b11ebde7ebc3df41daebe0e4eea3689/commons-io-2.11.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.35/47592e181b0bdbbeb63029e08c5e74f6803c4edd/jcommander-1.35.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.esotericsoftware.kryo/kryo/2.24.0/c6b206e80cfd97e66a1364003724491c757b92f/kryo-2.24.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.iq80.leveldb/leveldb/0.12/12ea5d0e5640d91695210bfb065562ee969a25ff/leveldb-0.12.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.eclipse.jgit/org.eclipse.jgit/6.2.0.202206071550-r/d59e7ae8528fcc3854acbb307de8443b28a5c945/org.eclipse.jgit-6.2.0.202206071550-r.jar:
/workspace/.gradle/caches/modules-2/files-2.1/javax.mail/mail/1.4.7/9add058589d5d85adeb625859bf2c5eeaaedf12d/mail-1.4.7.jar:
/workspace/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.33/2cd0a87ff7df953f810c344bdf2fe3340b954c69/snakeyaml-1.33.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.15.3/f6e1d8a8819f854b681c8eaa57fd59a42329e10c/jsoup-1.15.3.jar:
/workspace/.gradle/caches/modules-2/files-2.1/jline/jline/2.9/84693d4d75aa2a3af8447873cac8c0aed25ce863/jline-2.9.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.pf4j/pf4j/3.4.1/6ba44242fa925f48af1784b3e57d9ab7fd186215/pf4j-3.4.1.jar:
/workspace/.gradle/caches/modules-2/files-2.1/dev.failsafe/failsafe/3.1.0/3a5bda837103d319e841f8fe7a3eb98f2bdb480a/failsafe-3.1.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/31.1-jre/60458f877d055d0c9114d9e1a2efb737b4bc282c/guava-31.1-jre.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.36/6c62681a2f655b49963a5983b8b0950a6120ae14/slf4j-api-1.7.36.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.multiverse/multiverse-core/0.7.0/db77d55199bc5672f05f5d725b70dd10033251ed/multiverse-core-0.7.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.codehaus.jsr166-mirror/jsr166y/1.7.0/8547fcb1c29b4f8c745c3f49a536aca58fc30f54/jsr166y-1.7.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.1/87c0ea803b69252868d09308b4618f766f135a96/objenesis-2.1.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.iq80.leveldb/leveldb-api/0.12/c97c934e9de3be7b48f6677385e1294c9ec25cc6/leveldb-api-0.12.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.googlecode.javaewah/JavaEWAH/1.1.13/32cd724a42dc73f99ca08453d11a4bb83e0034c7/JavaEWAH-1.1.13.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.github.zafarkhaja/java-semver/0.9.0/59a83ca73c72a5e25b3f0b1bb305230a11000329/java-semver-0.9.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0.1/1dcf1de382a0bf95a3d8b0849546c88bac1292c9/failureaccess-1.0.1.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/b421526c5f297295adef1c886e5246c39d4ac629/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/3.12.0/d5692f0526415fcc6de94bb5bfbd3afd9dd3b3e5/checker-qual-3.12.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.11.0/c5a0ace696d3f8b1c1d8cc036d8c03cc0cbe6b69/error_prone_annotations-2.11.0.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.3/ba035118bc8bac37d7eff77700720999acd9986d/j2objc-annotations-1.3.jar:
/workspace/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a60a5e993c98c864010053cb901b7eab25306568/gson-2.2.4.jar:
/workspace/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.32/cdcff33940d9f2de763bc41ea05a0be5941176c3/slf4j-api-1.7.32.jar:
/workspace/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/4b95f4897fa13f2cd904aee711aeafc0c5295cd8/commons-codec-1.10.jar:
/workspace/nextflow/modules/nextflow/build/libs/nextflow-23.02.0-edge.jar nextflow.cli.Launcher
allprojects{
    repositories {
        def ALIYUN_REPOSITORY = 'https://maven.aliyun.com/repository/public/'
        def ALIYUN_JCENTER= 'https://maven.aliyun.com/repository/jcenter/'
        def ALIYUN_GOOGLE = 'https://maven.aliyun.com/repository/google/'
        def ALIYUN_GRADLE_PLUGIN = 'https://maven.aliyun.com/repository/gradle-plugin/'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY."
                    remove repo
                }
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER."
                    remove repo
                }
                if (url.startsWith('https://dl.google.com/dl/android/maven2/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_GOOGLE."
                    remove repo
                }
                if (url.startsWith('https://plugins.gradle.org/m2/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_GRADLE_PLUGIN."
                    remove repo
                }
            }
        }
        maven { url ALIYUN_REPOSITORY }
        maven { url ALIYUN_JCENTER }
        maven { url ALIYUN_GOOGLE }
        maven { url ALIYUN_GRADLE_PLUGIN}
    }
}
 java  -Dcapsule.log=verbose  -jar build/libs/nextflow-23.02.0-edge-all.jar 
/home/wangyang/workspace/nextflow/modules/nextflow/src/test/groovy/nextflow/script/ScriptRunnerTest.groovy
import groovyx.gpars.dataflow.DataflowQueue
import nextflow.script.TestScriptRunner

import java.nio.file.Paths

import groovyx.gpars.dataflow.DataflowVariable
import nextflow.Channel
import nextflow.Session
import spock.lang.Specification
import spock.lang.Timeout
class OperatorImplTest extends Specification {

    def setupSpec() {
        new Session()
    }
 
    def 'test process' () {

        setup:
        def runner = new TestScriptRunner([process:[executor:'nope']])

        /*
         * Test a task with a very simple body.
         * For testing purposes the processor just return the script itself as result
         */
        when:
        def script =
                """
            process sayHello  {
                "echo Hello world"
            }
            """

        runner.setScript(script).execute()

        // when no outputs are specified, the 'stdout' is the default output
        then:
        println runner.result.val
//        runner.result instanceof DataflowQueue
//        runner.result.val == "echo Hello world"

    }
}

http://www.gpars.org/webapp/guide/index.html
http://www.gpars.org/webapp/quickstart/index.html

sendMail(
    to: 'you@gmail.com',
    subject: 'Catch up',
    body: 'Hi, how are you!',
    attach: '/some/path/attachment/file.txt'
)

生信小木屋

生信小木屋