-
Notifications
You must be signed in to change notification settings - Fork 55
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
Evaluate adding R/Py to $PATH in Connect Content images #821
Comments
This probably should be a Connect feature request, as we will want to ensure that only the target version of R is on the path when executing Python content. |
@aronatkins fair point -- my interpretation of Connect build logs is that currently Connect does not add the target version of R/Py to path until the end of the content build process. Do I have that right? And you're suggesting that the content build process should instead add those to path at the beginning of the build process? |
Building an R environment or a Python environment for some content item happens independently -- R packages are installed without knowing the target Python interpreter and the Python virtual environment is created without knowing the target R interpreter. The constructed packages/environment are not bound to some other language interpreter version. Are you implying that the target R interpreter is needed while installing Python packages (or vice versa)? |
That's right -- this is specifically the case for
|
Thanks for that output. Unfortunately, this implies that the resulting rpy2 installation (and the containing Python virtual environment) would be restricted to a specific R interpreter. Because Connect does not know about this restriction, I believe Connect could incorrectly try to use that same virtual environment for content that wants to use a different version of R. Connect can share virtual environments and uses only the Python interpreter and package requirements to determine if an existing virtual environment can be reused. In the very narrow example where an image has a single R and Python installation and those interpreter versions never change, the approach you outline appears safe, but outside that situation, reuse does not feel appropriate. CC @mmarchetti - in case there are other alternatives. |
In our connect content images currently neither R nor Py are referenced in $PATH. In certain cases this can create unexpected errors -- I discovered this via using Databricks with Connect, where the R Databricks packages require reticulate, python and rpy2, and do not build without R referenced in $PATH. I confirmed via custom image where I added
ENV PATH=$PATH:/opt/R/${R_VERSION}/bin
that adding R and Py to $PATH fixes the above issue.The text was updated successfully, but these errors were encountered: