Execution of R scripting nodes on the KNIME (community) hub

Dear KNIMERs,

many of my KNIME workflows use R scripting nodes. I used them also on a KNIME server. I recently tried to also run these workflows on the KNIME hub. As recommended by KNIME staff I used a conda environment propagator with appropriate configuation for this prupose. However, I am receiving the following error when I try to execute R scripting nodes on the KNIME Hub:

ERROR Conda Environment Propagation 3:3: Execute failed: The following packages are not available from current channels: - libintl=0.22.5 Current channels: - https://conda.anaconda.org/conda-forge To search for alternate channels that may provide the conda package you’re looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

The missing libintl library indicates some principal issues with system configuration. Is there a solution for this problem or is it at present not possible to execute R code on the KNIME Hub? You can test my workflow on the KNIME hub at: https://hub.knime.com/stefan%20scholz%20team/spaces/TRANSFER/R%20availability~eD30G6rYi89LWDVw/current-state

I have also uploaded the very simple testing workflow (which I am able to run locally).

Thanks a lot in advance for help.

Kind regards

Stefan

R availability.knwf (23.3 KB)

Hi @sscholz,

libintl is only available for Windows and macOS, while the execution contexts on Community Hub run on Linux. Since there are some known issues with the portability of Conda environments across OSes, I had a look at your Conda Environment Propagation node, where I noticed two things:

  • You have explicitly selected a lot of packages (incl. some Windows-specific ones) to be included in the environment
  • There are a lot of Python packages in your environment :thinking:

When the Conda Environment Propagation node gets executed on a Community Hub Execution Context, it will try to create an environment with all the selected (“Include?”) packages with exactly the package versions on your machine (for reproducibility reasons). This will obviously fail for things like libintl and other packages that aren’t available for Linux. What I’d ask you to try is setting up a Conda environment (from the command line or the Anaconda Navigator) with only the packages mentioned in Step 2 of the documentation. Once you have done that, install only the relevant packages into the environment using the Conda CLI or Anaconda Navigator. Subsequently, give the “Include only explicitly installed” button a try in the Conda Environment Propagation node. This should only select the packages that you have explicitly requested to install into the environment and not their dependencies, which are often OS-dependent.

Hope this helps,
Stefan

3 Likes

@sscholz you can set up the conda environment specifically for a Windows or macOS (or Linux) environment and you should do that. With case switches you can then activate the one that would suite the needs - maybe in a component.

Especially when having R within a conda environment you will have to check the packages and test them. Also it is best to keep the environment as minimalistic as possible and maybe create another one for different tasks.

1 Like

Hi Stefan, thanks for the explanations. After many trials I finally got it working by

  1. Installing a very minimal conda with generic R (without indicating the version in the name, although the version was 4.3.3.), and only the r-base and r-rserve packages, and no Python libraries.

  2. in the conda environment propagation node only selecting “Inlcude only explicitly installed”

and 3)

Using KNIME in linux (I installed it under Ubuntu WSL in a windows environment).

From windows it is not working. I have yet not tried to configer the mlauber71 component for use in windows.

Thanks for the support and kind regards

Stefan

1 Like

I could also solve it now with a more generic approach as suggested by mlauber. I added Linux as a third operation system to the switch. But to do this I had to configure the workflow in Linux. I did not test it for MacOS, but it works for Linux and Windows. I have uploaded a minimal workflow to display the R version. On the KNIME hub the workflow is available at https://hub.knime.com/stefan%20scholz%20team/spaces/TRANSFER/R%20availability%20WinOS%20switch%20win%20mac%20linux~97I-s8WFV3jKQl0G/current-state

R availability WinOS switch win mac linux.knwf (65.3 KB)

One final addition: If you select “Explicitely only installed” in the conda environment propagation node, you do not need the operation system switch. Then even a workflow with R compiled on Windows appears to be executable on the KNIME hub.

2 Likes

This is what I was hoping for, @sscholz. The idea here is that r-base , r-rserve, and r-essentials are platform-agnostic. Since this seems to be the case, the Conda Environment Propagation node will request and install packages for the operating system on which it’s executed. As soon as your script requires a Conda package that is not available on the “destination operating system”, it will fail, though, and you’ll have to fall back to @mlauber71’s solution…