This commit is contained in:
2026-08-23 13:06:39 +02:00
parent b0a5447797
commit f227d054b8
18 changed files with 819 additions and 30 deletions

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2025, Seqera Labs
*
* 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 recreationaltech.plugin
import groovy.transform.CompileStatic
import nextflow.Session
import nextflow.plugin.extension.Function
import nextflow.plugin.extension.PluginExtensionPoint
/**
* Implements a custom function which can be imported by
* Nextflow scripts.
*/
@CompileStatic
class K8sDvfsExtension extends PluginExtensionPoint {
@Override
protected void init(Session session) {
}
/**
* Say hello to the given target.
*
* @param target
*/
@Function
void sayHello(String target) {
println "Hello, ${target}!"
}
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2025, Seqera Labs
*
* 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 recreationaltech.plugin
import groovy.transform.CompileStatic
import nextflow.Session
import nextflow.trace.TraceObserver
import nextflow.trace.TraceObserverFactory
/**
* Implements a factory object required to create
* the {@link K8sDvfsObserver} instance.
*/
@CompileStatic
class K8sDvfsFactory implements TraceObserverFactory {
@Override
Collection<TraceObserver> create(Session session) {
return List.<TraceObserver>of(new K8sDvfsObserver())
}
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2025, Seqera Labs
*
* 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 recreationaltech.plugin
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import nextflow.Session
import nextflow.trace.TraceObserver
/**
* Implements an observer that allows implementing custom
* logic on nextflow execution events.
*/
@Slf4j
@CompileStatic
class K8sDvfsObserver implements TraceObserver {
@Override
void onFlowCreate(Session session) {
println "Pipeline is starting! 🚀"
}
@Override
void onFlowComplete() {
println "Pipeline complete! 👋"
}
}

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2025, Seqera Labs
*
* 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 recreationaltech.plugin
import groovy.transform.CompileStatic
import nextflow.plugin.BasePlugin
import org.pf4j.PluginWrapper
/**
* The plugin entry point
*/
@CompileStatic
class K8sDvfsPlugin extends BasePlugin {
K8sDvfsPlugin(PluginWrapper wrapper) {
super(wrapper)
}
}