Skip to content

Commit

Permalink
Merge branch 'master' into singularity-oci-pwd-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso authored Nov 8, 2023
2 parents bfb0c16 + f5d7246 commit 0585bad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
5 changes: 4 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1648,10 +1648,13 @@ The following environment variables control the configuration of the Nextflow ru
: Allows the setting Java VM options. This is similar to `NXF_OPTS` however it's only applied the JVM running Nextflow and not to any java pre-launching commands.

`NXF_OFFLINE`
: When `true` disables the project automatic download and update from remote repositories (default: `false`).
: When `true` prevents Nextflow from automatically downloading and updating remote project repositories (default: `false`).
: :::{versionchanged} 23.09.0-edge
This option also disables the automatic version check (see `NXF_DISABLE_CHECK_LATEST`).
:::
: :::{versionchanged} 23.11.0-edge
This option also prevents plugins from being downloaded. Plugin versions must be specified in offline mode, or else Nextflow will fail.
:::

`NXF_OPTS`
: Provides extra options for the Java and Nextflow runtime. It must be a blank separated list of `-Dkey[=value]` properties.
Expand Down
18 changes: 12 additions & 6 deletions modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class PluginUpdater extends UpdateManager {
safeMove(dir, pluginPath)
}
catch (IOException e) {
throw new PluginRuntimeException(e, "Failed to write file '$pluginPath' to plugins folder");
throw new PluginRuntimeException(e, "Failed to write file '$pluginPath' to plugins folder")
}

return pluginPath
Expand Down Expand Up @@ -318,8 +318,14 @@ class PluginUpdater extends UpdateManager {

if( version == null )
version = getLastPluginRelease(id)?.version
if( !version )
throw new IllegalStateException("Cannot find latest version of $id plugin")

final offline = SysEnv.get('NXF_OFFLINE')=='true'
if( !version ) {
final msg = offline
? "Cannot find version for $id plugin -- plugin versions MUST be specified in offline mode"
: "Cannot find latest version of $id plugin"
throw new IllegalStateException(msg)
}

def pluginPath = pluginsStore.resolve("$id-$version")
if( !FilesEx.exists(pluginPath) ) {
Expand Down Expand Up @@ -363,7 +369,7 @@ class PluginUpdater extends UpdateManager {
// resolve the plugins
pluginManager.resolvePlugins()
// finally start it
PluginState state = pluginManager.startPlugin(id);
PluginState state = pluginManager.startPlugin(id)
return PluginState.STARTED == state
}

Expand All @@ -381,13 +387,13 @@ class PluginUpdater extends UpdateManager {
throw new PluginRuntimeException("Plugin $id cannot be updated since it is not installed")
}

PluginInfo pluginInfo = getPluginsMap().get(id);
PluginInfo pluginInfo = getPluginsMap().get(id)
if (pluginInfo == null) {
throw new PluginRuntimeException("Plugin $id does not exist in any repository")
}

if (!pluginManager.deletePlugin(id)) {
return false;
return false
}

load0(id, version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PluginsFacade implements PluginStateListener {
PluginsFacade() {
mode = getPluginsMode()
root = getPluginsDir()
if( mode=='dev' && root.toString()=='plugins' && !isRunningFromDistArchive() )
if( mode==DEV_MODE && root.toString()=='plugins' && !isRunningFromDistArchive() )
root = detectPluginsDevRoot()
System.setProperty('pf4j.mode', mode)
}
Expand Down

0 comments on commit 0585bad

Please sign in to comment.