Conda Environment Propagation

This node ensures the existence of a specific configurable Conda environment and propagates the environment to Python, R, or other Conda-aware downstream nodes. This is useful to make workflows that contain Conda-aware nodes more portable by allowing to recreate the Conda environment used on the source machine (for example your personal computer) on the target machine (for example a KNIME Server instance). The node is intended to be used as follows:

  1. On your local machine, you need to have Conda set up and configured in the Preferences of the KNIME Python Integration as described in the corresponding installation guide.
  2. Configure this node by selecting the Conda environment to propagate and selecting the packages to include in the environment in case it needs to be recreated.
  3. Connect the output port of the node to the variable input port of any Conda-aware node. For more details on this, see the flow control guide.
  4. Successively open the configuration dialogues of the Conda-aware node and all subsequent Conda-aware nodes in the flow that you want to make portable.
    Python nodes: On each node's Executable Selection tab, enable Use Conda environment variable and choose the variable propagating the configured Conda environment from the selection box.
    R nodes: In the Advanced tab of each R node, enable Overwrite default path to R home, select Use conda environment to find R home, and choose the variable propagating the configured Conda environment from the selection box.
  5. Deploy the workflow by uploading it to the KNIME Server, sharing it via the KNIME Hub, or exporting it. Make sure that this node is reset before or during the deployment process.
  6. On the target machine, Conda must also be set up and configured in the Preferences of the KNIME Python Integration. If the target machine runs a KNIME Server, you may need to contact your server administrator and/or refer to the server administration guides in order to do this.
  7. During execution (on either machine), the node will check whether a local Conda environment exists that matches its configured environment. The node will recreate the environment if necessary, ensuring its availability to the connected and properly configured downstream Conda-aware nodes.

Options

Conda environment
The Conda environment whose existence to ensure during the execution of the node and which to propagate to downstream Conda-aware nodes.
Packages
The list of packages contained in the selected Conda environment. For each individual package, you can configure whether to include it in the environment in case the environment needs to be recreated. Not all packages are available or required on each platform (operating system). Deselecting individual packages may therefore be necessary to configure an environment that can be recreated across different platforms.
Include only explicitly installed: selects only those packages from the environment that Conda has explicitly been asked for to install (that is, automatically resolved dependencies are excluded). This can facilitate configuring an environment that is compatible with different platforms. Note, however, that this also excludes any packages installed via pip, regardless of whether they have been installed explicitly. This option is only available when using Conda version 4.7.12 or newer.
Environment validation
Defines how the node checks whether it has to recreate the configured environment.
  • Check name only: if this option is selected, the configured environment will only be recreated if there is no local Conda environment of the same name.
  • Check name and packages: if this option is selected, the configured environment will be recreated if either there is no local environment of the same name or if there is an environment of the same name that does not contain all of the included packages, in which case the existing environment will be overwritten. This option enforces the exact configured package versions and channels. The configured build specs are only enforced if the platforms of the source and target machines are the same. Note that additional packages present in the local environment are ignored, that is, the local environment is allowed to contain a superset of the packages configured in this node.
  • Always overwrite existing environment: if this option is selected, the configured environment will be recreated in any case, overwriting any possibly existing environment of the same name.
Output variable name
The name of the output flow variable that propagates the configured Conda environment. The default name is conda.environment. You can specify a custom name to avoid name collisions that may otherwise occur when employing multiple Conda Environment Propagation nodes in a single workflow.
Preserve a possibly incomplete Conda environment if the creation fails
If this checkbox is checked, the Conda environment will not be removed if the creation of the environment failed. This can be useful for debugging why the environment creation failed. WARNING: if the node is executed again and "Check name only" is selected, this might lead to an executed node with missing packages in the Conda environment. Downstream nodes might fail.

Input Ports

This node has no input ports

Output Ports

Icon
Flow variable of the specified name that points to the configured Conda environment.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.