-
Notifications
You must be signed in to change notification settings - Fork 1
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
Quilt native Groovy #18
Comments
|
Proposed Integration Plan End Result:
|
Implementation Proposal
|
Things you can steal from nf-quilt:
|
Requires Download (via Makefile?) from https://github.com/nextflow-io/nf-amazon/releases |
Almost:
java.lang.NullPointerException: Cannot invoke "org.pf4j.Plugin.start()" because the return value of "org.pf4j.PluginWrapper.getPlugin()" is null |
Different error if 'prod' versus 'dev'. Oddly:
java.lang.IllegalStateException: Missing plugin 'nf-amazon' required to read file: s3://quilt-example/.quilt |
Same problem as before:
|
log.info("Start plugin '{}'", getPluginLabel(pluginDescriptor));
pluginWrapper.getPlugin().start(); https://github.com/pf4j/pf4j/blob/master/pf4j/src/main/java/org/pf4j/PluginWrapper.java plugin = pluginFactory.create(this);
// Plugin create(PluginWrapper pluginWrapper); for (ClassLoadingStrategy.Source classLoadingSource : classLoadingStrategy.getSources()) {
Class<?> c = null;
try {
switch (classLoadingSource) {
case APPLICATION:
c = super.loadClass(className);
break;
case PLUGIN:
c = findClass(className);
break;
case DEPENDENCIES:
c = loadClassFromDependencies(className);
break;
}
} catch (ClassNotFoundException ignored) {}
if (c != null) {
log.trace("Found class '{}' in {} classpath", className, classLoadingSource);
return c;
} else {
log.trace("Couldn't find class '{}' in {} classpath", className, classLoadingSource);
}
}
throw new ClassNotFoundException(className);
https://github.com/pf4j/pf4j/blob/master/pf4j/src/main/java/org/pf4j/ClassLoadingStrategy.java |
/**
* One instance of this class should be created by plugin manager for every available plug-in.
* By default, this class loader is a Parent Last ClassLoader - it loads the classes from the plugin's jars
* before delegating to the parent class loader.
* Use {@link #classLoadingStrategy} to change the loading strategy.
*
* @author Decebal Suiu
*/
public class PluginClassLoader extends URLClassLoader {
public PluginClassLoader(PluginManager pluginManager, PluginDescriptor pluginDescriptor, ClassLoader parent, ClassLoadingStrategy classLoadingStrategy) {
super(new URL[0], parent);
this.pluginManager = pluginManager;
this.pluginDescriptor = pluginDescriptor;
this.classLoadingStrategy = classLoadingStrategy;
}
import java.net.URLClassLoader public String loadPlugin(Path pluginPath) {
if ((pluginPath == null) || Files.notExists(pluginPath)) {
throw new IllegalArgumentException(String.format("Specified plugin %s does not exist!", pluginPath));
}
log.debug("Loading plugin from '{}'", pluginPath);
PluginWrapper pluginWrapper = loadPluginFromPath(pluginPath);
// try to resolve the loaded plugin together with other possible plugins that depend on this plugin
resolvePlugins();
return pluginWrapper.getDescriptor().getPluginId();
} |
case APPLICATION:
c = super.loadClass(className);
break;
case PLUGIN:
c = findClass(className);
break;
case DEPENDENCIES:
c = loadClassFromDependencies(className);
break; |
Manually loading plugin finally failed on: class AmazonPlugin extends BasePlugin {
AmazonPlugin(PluginWrapper wrapper) {
super(wrapper)
}
@Override
void start() {
super.start()
FileHelper.getOrInstallProvider(S3FileSystemProvider)
}
} with:
The simplest solution might be to just catch the error and re-implement FileHelper. |
Hmm. Others seem to have had this issue:
But, their solution still seems to (obviously) require running nextflow. Hmm. |
Completed via quiltcore-java. |
Call Quilt from Groovy: bypass quilt3 command-line tool
Right now the plugin uses the command-line tool from the quilt3 pip package, specifically the 'install' and 'push' actions.
This is both an added dependency, and a 'blunt instrument'. For example, the only way to get a list of all the files in a package is to first install the package then
ls
the install directory.Alternatives include:
The text was updated successfully, but these errors were encountered: