Skip to content
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

RStudio: make workbench env variables HTTP_PROXY and HTTPS_PROXY available in REnviron.site #795

Open
shalberd opened this issue Dec 4, 2024 · 0 comments · May be fixed by #797
Open

RStudio: make workbench env variables HTTP_PROXY and HTTPS_PROXY available in REnviron.site #795

shalberd opened this issue Dec 4, 2024 · 0 comments · May be fixed by #797

Comments

@shalberd
Copy link

shalberd commented Dec 4, 2024

Why you need this feature:
Regardless whether installing packages or interacting with version control / git in RStudio, there may be situations where certain URLs
are only available through a proxy.
In ODH notebooks / workbenches, if present at level of global cluster config, for the main notebook container[0], envs HTTP_PROXY and
HTTS_PROXY are filled in with the value of the corporate proxy server.

However, for i.e. accessing a Gitlab instance that is only available through a proxy, RStudio does not recognize those container-level env variables.

I found this background article: https://support.posit.co/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy
and this current interesting bit in run-rstudio.sh:

https://github.com/opendatahub-io/notebooks/blob/main/rstudio/c9s-python-3.9/run-rstudio.sh#L26

Describe the solution you'd like:
@guimou Also add the env variable and value of HTTP_PROXY and HTTPS_PROXY from container envs, lowercased for purposes of RStudio, i.e.
http_proxy and https_proxy, to the global Renviron.site in run_rstudio.sh

env | grep HTTP_PROXY | tr '[:upper:]' '[:lower:]' >> /usr/lib64/R/etc/Renviron.site
env | grep HTTPS_PROXY | tr '[:upper:]' '[:lower:]' >> /usr/lib64/R/etc/Renviron.site

Anything else you would like to add:
I had a new project, with version control, where the gitlab url required passing through a proxy. Setting the two values
http_proxy=http://myproxy.com:5234
https_proxy=http://myproxy.com5234
at file ~/.Renviron allowed me to work with connections over a proxy.
The idea of this enhancement request is to add http_proxy= and https_proxy= entries to /usr/lib64/R/etc/Renviron.site

Current content is only KUBERNETES* ENV VAR like

cat /usr/lib64/R/etc/Renviron.site
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_PORT_443_TCP=tcp://172.30.0.1:443
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP_ADDR=172.30.0.1
KUBERNETES_SERVICE_HOST=172.30.0.1
KUBERNETES_PORT=tcp://172.30.0.1:443
KUBERNETES_PORT_443_TCP_PORT=443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
1 participant