From 4107cd5083226885600a2258dd29fcf86026cb8c Mon Sep 17 00:00:00 2001 From: atheo89 Date: Tue, 23 Sep 2025 10:38:05 +0200 Subject: [PATCH 1/4] Remove supervisord and fcgi from rstudio --- rstudio/c9s-python-3.11/Dockerfile.cpu | 26 ++++++++---- rstudio/c9s-python-3.11/httpd/httpd.conf | 42 +++++++++++++++++++ .../c9s-python-3.11/httpd/rstudio-cgi.conf | 19 +++++++++ .../nginx/serverconf/proxy.conf.template | 15 ++++--- .../serverconf/proxy.conf.template_nbprefix | 15 ++++--- rstudio/c9s-python-3.11/run-rstudio.sh | 6 +-- .../supervisord/supervisord.conf | 10 ----- 7 files changed, 96 insertions(+), 37 deletions(-) create mode 100644 rstudio/c9s-python-3.11/httpd/httpd.conf create mode 100644 rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf delete mode 100644 rstudio/c9s-python-3.11/supervisord/supervisord.conf diff --git a/rstudio/c9s-python-3.11/Dockerfile.cpu b/rstudio/c9s-python-3.11/Dockerfile.cpu index e8ba4ef8c..09e9cdbf2 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cpu +++ b/rstudio/c9s-python-3.11/Dockerfile.cpu @@ -105,7 +105,8 @@ RUN R -f ./install_packages.R && \ rm ./install_packages.R # Install NGINX to proxy RStudio and pass probes check -ENV NGINX_VERSION=1.24 \ +ENV APP_ROOT=/opt/app-root \ + NGINX_VERSION=1.24 \ NGINX_SHORT_VER=124 \ NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -117,17 +118,24 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN dnf -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ + INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl httpd" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +# Configure httpd for CGI processing +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/codeserver-cgi.conf /etc/httpd/conf.d/codeserver-cgi.conf # Copy extra files to the image. COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / +# Configure nginx +COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ + # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model # is to run the container under random UID, but GID=0 @@ -146,21 +154,23 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + # Make CGI script executable + chmod +x /opt/app-root/api/kernels/access.cgi && \ rpm-file-permissions -# Configure nginx -COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ - # Launcher WORKDIR /opt/app-root/bin diff --git a/rstudio/c9s-python-3.11/httpd/httpd.conf b/rstudio/c9s-python-3.11/httpd/httpd.conf new file mode 100644 index 000000000..c0f2b72eb --- /dev/null +++ b/rstudio/c9s-python-3.11/httpd/httpd.conf @@ -0,0 +1,42 @@ +# Basic httpd configuration for CGI processing +ServerRoot "/etc/httpd" +Listen 8080 + +# Load modules +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule mime_module modules/mod_mime.so +LoadModule dir_module modules/mod_dir.so +LoadModule cgi_module modules/mod_cgi.so +LoadModule rewrite_module modules/mod_rewrite.so + +# User and Group - run as the container user (OpenShift assigns random UIDs) +# User 1001 +# Group 0 + +# Server configuration +ServerAdmin root@localhost +ServerName localhost + +# Document root +DocumentRoot "/opt/app-root" + +# Directory configuration + + AllowOverride none + Require all denied + + + + AllowOverride None + Options +ExecCGI + Require all granted + AddHandler cgi-script .cgi + + +# Error and access logs +ErrorLog "/var/log/httpd/error_log" +LogLevel warn + +# Include additional configurations +# IncludeOptional conf.d/*.conf diff --git a/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf b/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf new file mode 100644 index 000000000..95847b18b --- /dev/null +++ b/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf @@ -0,0 +1,19 @@ +# RStudio-server CGI configuration +# This configuration handles the /api/kernels/ endpoint for culling + +# Enable CGI for the kernels API endpoint + + SetHandler cgi-script + Options +ExecCGI + Require all granted + + +# Set the CGI script path +ScriptAlias /api/kernels/ /opt/app-root/api/kernels/ + +# Ensure the CGI script is executable + + Options +ExecCGI + AddHandler cgi-script .cgi + Require all granted + diff --git a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template index 69c6304b2..c469d4898 100644 --- a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template +++ b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template @@ -25,14 +25,13 @@ location = /api/kernels { } location /api/kernels/ { - index access.cgi; - fastcgi_index access.cgi; - gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### diff --git a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix index fc494d18c..ee2b7bd8c 100644 --- a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix +++ b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix @@ -44,14 +44,13 @@ location ${NB_PREFIX}/api/kernels/ { } location /api/kernels/ { - index access.cgi; - fastcgi_index access.cgi; - gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### diff --git a/rstudio/c9s-python-3.11/run-rstudio.sh b/rstudio/c9s-python-3.11/run-rstudio.sh index 71c979bd2..e7e20840b 100755 --- a/rstudio/c9s-python-3.11/run-rstudio.sh +++ b/rstudio/c9s-python-3.11/run-rstudio.sh @@ -4,9 +4,9 @@ SCRIPT_DIR=$(dirname -- "$0") source ${SCRIPT_DIR}/utils/*.sh -# Start nginx and supervisord +# Start nginx and httpd run-nginx.sh & -/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & +/usr/sbin/httpd -D FOREGROUND & # Add .bashrc for custom promt if not present @@ -22,7 +22,7 @@ do if [ ! -d "/opt/app-root/src/Rpackages/4.4/$package_folder" ]; then cp -r /opt/app-root/bin/Rpackages/4.4/$package_folder /opt/app-root/src/Rpackages/4.4/ fi -done +done # rstudio terminal can't see environment variables set by the container runtime; # so we set all env variables to the Renviron.site config file. For kubectl, we need the KUBERNETES_* env vars at least. # Also, we store proxy-related env vars lowercased by key so RStudio projects work with proxy by default diff --git a/rstudio/c9s-python-3.11/supervisord/supervisord.conf b/rstudio/c9s-python-3.11/supervisord/supervisord.conf deleted file mode 100644 index b9927e6f8..000000000 --- a/rstudio/c9s-python-3.11/supervisord/supervisord.conf +++ /dev/null @@ -1,10 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/tmp/supervisord.log -pidfile=/tmp/supervisord.pid - -[program:fcgiwrap] -command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket -autostart=true -autorestart=true -redirect_stderr=true From cc975d7ff0bb8b4fa8381e5aa2fd9b27d5a8f4e7 Mon Sep 17 00:00:00 2001 From: atheo89 Date: Tue, 23 Sep 2025 10:47:26 +0200 Subject: [PATCH 2/4] update cuda c9s rstudio changes to dockerfile --- rstudio/c9s-python-3.11/Dockerfile.cpu | 2 +- rstudio/c9s-python-3.11/Dockerfile.cuda | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/rstudio/c9s-python-3.11/Dockerfile.cpu b/rstudio/c9s-python-3.11/Dockerfile.cpu index 09e9cdbf2..6f91d4a7a 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cpu +++ b/rstudio/c9s-python-3.11/Dockerfile.cpu @@ -35,7 +35,7 @@ USER 1001 WORKDIR /opt/app-root/src ##################### -# rstudio # +# rstudio # ##################### FROM cpu-base AS rstudio diff --git a/rstudio/c9s-python-3.11/Dockerfile.cuda b/rstudio/c9s-python-3.11/Dockerfile.cuda index 498a33a26..440685c46 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cuda +++ b/rstudio/c9s-python-3.11/Dockerfile.cuda @@ -119,17 +119,24 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN dnf -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ + INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl httpd" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +# Configure httpd for CGI processing +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/codeserver-cgi.conf /etc/httpd/conf.d/codeserver-cgi.conf # Copy extra files to the image. COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / +# Configure nginx +COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ + # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model # is to run the container under random UID, but GID=0 @@ -148,21 +155,23 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + # Make CGI script executable + chmod +x /opt/app-root/api/kernels/access.cgi && \ rpm-file-permissions -# Configure nginx -COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ - # Launcher WORKDIR /opt/app-root/bin From 664aee1ba7fde94f0e82eaf09fef0a98ec768ce9 Mon Sep 17 00:00:00 2001 From: atheo89 Date: Tue, 23 Sep 2025 11:05:56 +0200 Subject: [PATCH 3/4] Add to rhel --- rstudio/c9s-python-3.11/Dockerfile.cpu | 6 ++- rstudio/c9s-python-3.11/Dockerfile.cuda | 9 ++-- rstudio/c9s-python-3.11/httpd/httpd.conf | 20 +++++-- .../c9s-python-3.11/httpd/rstudio-cgi.conf | 20 ++++--- .../nginx/serverconf/proxy.conf.template | 25 ++++++--- .../serverconf/proxy.conf.template_nbprefix | 23 +++++--- rstudio/c9s-python-3.11/run-rstudio.sh | 15 ++++++ rstudio/rhel9-python-3.11/Dockerfile.cpu | 32 +++++++---- rstudio/rhel9-python-3.11/Dockerfile.cuda | 30 +++++++---- rstudio/rhel9-python-3.11/httpd/httpd.conf | 54 +++++++++++++++++++ .../rhel9-python-3.11/httpd/rstudio-cgi.conf | 27 ++++++++++ .../nginx/serverconf/proxy.conf.template | 40 ++++++++------ .../serverconf/proxy.conf.template_nbprefix | 40 ++++++++------ rstudio/rhel9-python-3.11/run-rstudio.sh | 21 ++++++-- .../supervisord/supervisord.conf | 10 ---- 15 files changed, 278 insertions(+), 94 deletions(-) create mode 100644 rstudio/rhel9-python-3.11/httpd/httpd.conf create mode 100644 rstudio/rhel9-python-3.11/httpd/rstudio-cgi.conf delete mode 100644 rstudio/rhel9-python-3.11/supervisord/supervisord.conf diff --git a/rstudio/c9s-python-3.11/Dockerfile.cpu b/rstudio/c9s-python-3.11/Dockerfile.cpu index 6f91d4a7a..60e641402 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cpu +++ b/rstudio/c9s-python-3.11/Dockerfile.cpu @@ -126,7 +126,7 @@ RUN dnf -y module enable nginx:$NGINX_VERSION && \ # Configure httpd for CGI processing COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/codeserver-cgi.conf /etc/httpd/conf.d/codeserver-cgi.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/rstudio-cgi.conf /etc/httpd/conf.d/rstudio-cgi.conf # Copy extra files to the image. COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / @@ -167,8 +167,10 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ - # Make CGI script executable + # Make CGI scripts executable and set proper ownership chmod +x /opt/app-root/api/kernels/access.cgi && \ + chmod +x /opt/app-root/api/probe.cgi && \ + chown -R 1001:0 /opt/app-root/api && \ rpm-file-permissions # Launcher diff --git a/rstudio/c9s-python-3.11/Dockerfile.cuda b/rstudio/c9s-python-3.11/Dockerfile.cuda index 440685c46..960fe1054 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cuda +++ b/rstudio/c9s-python-3.11/Dockerfile.cuda @@ -107,7 +107,8 @@ RUN R -f ./install_packages.R && \ rm ./install_packages.R # Install NGINX to proxy RStudio and pass probes check -ENV NGINX_VERSION=1.24 \ +ENV APP_ROOT=/opt/app-root \ + NGINX_VERSION=1.24 \ NGINX_SHORT_VER=124 \ NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -127,7 +128,7 @@ RUN dnf -y module enable nginx:$NGINX_VERSION && \ # Configure httpd for CGI processing COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/codeserver-cgi.conf /etc/httpd/conf.d/codeserver-cgi.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/rstudio-cgi.conf /etc/httpd/conf.d/rstudio-cgi.conf # Copy extra files to the image. COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / @@ -168,8 +169,10 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ - # Make CGI script executable + # Make CGI scripts executable and set proper ownership chmod +x /opt/app-root/api/kernels/access.cgi && \ + chmod +x /opt/app-root/api/probe.cgi && \ + chown -R 1001:0 /opt/app-root/api && \ rpm-file-permissions # Launcher diff --git a/rstudio/c9s-python-3.11/httpd/httpd.conf b/rstudio/c9s-python-3.11/httpd/httpd.conf index c0f2b72eb..e755f034a 100644 --- a/rstudio/c9s-python-3.11/httpd/httpd.conf +++ b/rstudio/c9s-python-3.11/httpd/httpd.conf @@ -4,15 +4,21 @@ Listen 8080 # Load modules LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule unixd_module modules/mod_unixd.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule mime_module modules/mod_mime.so +LoadModule alias_module modules/mod_alias.so LoadModule dir_module modules/mod_dir.so +LoadModule autoindex_module modules/mod_autoindex.so LoadModule cgi_module modules/mod_cgi.so LoadModule rewrite_module modules/mod_rewrite.so # User and Group - run as the container user (OpenShift assigns random UIDs) -# User 1001 -# Group 0 +User default +Group root + +# PidFile for process management +PidFile /var/run/httpd/httpd.pid # Server configuration ServerAdmin root@localhost @@ -38,5 +44,11 @@ DocumentRoot "/opt/app-root" ErrorLog "/var/log/httpd/error_log" LogLevel warn -# Include additional configurations -# IncludeOptional conf.d/*.conf +# Types configuration +TypesConfig /etc/mime.types + +# Include additional configurations (exclude SSL) +IncludeOptional conf.d/autoindex.conf +IncludeOptional conf.d/userdir.conf +IncludeOptional conf.d/welcome.conf +IncludeOptional conf.d/rstudio-cgi.conf diff --git a/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf b/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf index 95847b18b..7d8e645b4 100644 --- a/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf +++ b/rstudio/c9s-python-3.11/httpd/rstudio-cgi.conf @@ -1,17 +1,25 @@ # RStudio-server CGI configuration -# This configuration handles the /api/kernels/ endpoint for culling +# This configuration handles the /api/ endpoints for culling and health checks -# Enable CGI for the kernels API endpoint - +# Set the CGI script paths +ScriptAlias /api/kernels/ /opt/app-root/api/kernels/access.cgi +ScriptAlias /api/probe /opt/app-root/api/probe.cgi +ScriptAlias /api /opt/app-root/api/probe.cgi + +# Enable CGI for the API endpoints + SetHandler cgi-script Options +ExecCGI Require all granted -# Set the CGI script path -ScriptAlias /api/kernels/ /opt/app-root/api/kernels/ +# Ensure the CGI scripts are executable + + Options +ExecCGI + AddHandler cgi-script .cgi + Require all granted + -# Ensure the CGI script is executable Options +ExecCGI AddHandler cgi-script .cgi diff --git a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template index c469d4898..ba824cd19 100644 --- a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template +++ b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template @@ -6,17 +6,16 @@ rewrite ^/auth-sign-out(.*) "$custom_scheme://$http_host/rstudio/auth-sign-out$1 ############### ############### -# api calls from probes get to CGI processing +# api calls from probes get to CGI processing via Apache ############### location /api/ { - index probe.cgi; - fastcgi_index probe.cgi; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + access_log off; } location = /api/kernels { @@ -33,6 +32,16 @@ location /api/kernels/ { gzip off; access_log off; } + +location = /api/probe { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; +} ############### ############### diff --git a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix index ee2b7bd8c..ca4d388fe 100644 --- a/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix +++ b/rstudio/c9s-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix @@ -19,14 +19,23 @@ location ${NB_PREFIX}/api/ { } location /api/ { - index probe.cgi; - fastcgi_index probe.cgi; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + access_log off; +} + +location = /api/probe { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### diff --git a/rstudio/c9s-python-3.11/run-rstudio.sh b/rstudio/c9s-python-3.11/run-rstudio.sh index e7e20840b..addcc707e 100755 --- a/rstudio/c9s-python-3.11/run-rstudio.sh +++ b/rstudio/c9s-python-3.11/run-rstudio.sh @@ -6,7 +6,22 @@ source ${SCRIPT_DIR}/utils/*.sh # Start nginx and httpd run-nginx.sh & + +# Start Apache httpd with error checking +echo "Starting Apache httpd..." /usr/sbin/httpd -D FOREGROUND & +HTTPD_PID=$! +sleep 2 + +# Check if Apache started successfully +if ! kill -0 $HTTPD_PID 2>/dev/null; then + echo "ERROR: Apache httpd failed to start" + echo "Checking Apache configuration..." + /usr/sbin/httpd -t + exit 1 +else + echo "Apache httpd started successfully (PID: $HTTPD_PID)" +fi # Add .bashrc for custom promt if not present diff --git a/rstudio/rhel9-python-3.11/Dockerfile.cpu b/rstudio/rhel9-python-3.11/Dockerfile.cpu index 0fc2110f0..8fee26d75 100644 --- a/rstudio/rhel9-python-3.11/Dockerfile.cpu +++ b/rstudio/rhel9-python-3.11/Dockerfile.cpu @@ -30,7 +30,7 @@ USER 1001 WORKDIR /opt/app-root/src ##################### -# rstudio # +# rstudio # ##################### FROM base AS rstudio @@ -117,7 +117,8 @@ COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf RUN R -e "install.packages('Rcpp')" # Install NGINX to proxy RStudio and pass probes check -ENV NGINX_VERSION=1.24 \ +ENV APP_ROOT=/opt/app-root \ + NGINX_VERSION=1.24 \ NGINX_SHORT_VER=124 \ NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -129,16 +130,23 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN dnf -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ + INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl httpd" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +# Configure httpd for CGI processing +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/rstudio-cgi.conf /etc/httpd/conf.d/rstudio-cgi.conf # Copy extra files to the image. -COPY ${RSTUDIO_SOURCE_CODE}/nginx/root/ / +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / + +# Configure nginx +COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -158,21 +166,25 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + # Make CGI scripts executable and set proper ownership + chmod +x /opt/app-root/api/kernels/access.cgi && \ + chmod +x /opt/app-root/api/probe.cgi && \ + chown -R 1001:0 /opt/app-root/api && \ rpm-file-permissions -# Configure nginx -COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ - # Launcher WORKDIR /opt/app-root/bin diff --git a/rstudio/rhel9-python-3.11/Dockerfile.cuda b/rstudio/rhel9-python-3.11/Dockerfile.cuda index ab7bae270..ac2c3e05f 100644 --- a/rstudio/rhel9-python-3.11/Dockerfile.cuda +++ b/rstudio/rhel9-python-3.11/Dockerfile.cuda @@ -247,7 +247,8 @@ COPY ${RSTUDIO_SOURCE_CODE}/rsession.conf /etc/rstudio/rsession.conf RUN R -e "install.packages('Rcpp')" # Install NGINX to proxy RStudio and pass probes check -ENV NGINX_VERSION=1.24 \ +ENV APP_ROOT=/opt/app-root \ + NGINX_VERSION=1.24 \ NGINX_SHORT_VER=124 \ NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -259,16 +260,23 @@ ENV NGINX_VERSION=1.24 \ # Modules does not exist RUN dnf -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl fcgiwrap initscripts chkconfig supervisor" && \ + INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl httpd" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' -COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +# Configure httpd for CGI processing +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/httpd.conf /etc/httpd/conf/httpd.conf +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/httpd/rstudio-cgi.conf /etc/httpd/conf.d/rstudio-cgi.conf # Copy extra files to the image. -COPY ${RSTUDIO_SOURCE_CODE}/nginx/root/ / +COPY --chown=1001:0 ${RSTUDIO_SOURCE_CODE}/nginx/root/ / + +# Configure nginx +COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ +COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -288,21 +296,25 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + # Create httpd directories and set permissions + mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + chmod -R ug+rwX /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + # Make CGI scripts executable and set proper ownership + chmod +x /opt/app-root/api/kernels/access.cgi && \ + chmod +x /opt/app-root/api/probe.cgi && \ + chown -R 1001:0 /opt/app-root/api && \ rpm-file-permissions -# Configure nginx -COPY ${RSTUDIO_SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/ -COPY ${RSTUDIO_SOURCE_CODE}/nginx/api/ /opt/app-root/api/ - # Launcher WORKDIR /opt/app-root/bin diff --git a/rstudio/rhel9-python-3.11/httpd/httpd.conf b/rstudio/rhel9-python-3.11/httpd/httpd.conf new file mode 100644 index 000000000..e755f034a --- /dev/null +++ b/rstudio/rhel9-python-3.11/httpd/httpd.conf @@ -0,0 +1,54 @@ +# Basic httpd configuration for CGI processing +ServerRoot "/etc/httpd" +Listen 8080 + +# Load modules +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule unixd_module modules/mod_unixd.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule mime_module modules/mod_mime.so +LoadModule alias_module modules/mod_alias.so +LoadModule dir_module modules/mod_dir.so +LoadModule autoindex_module modules/mod_autoindex.so +LoadModule cgi_module modules/mod_cgi.so +LoadModule rewrite_module modules/mod_rewrite.so + +# User and Group - run as the container user (OpenShift assigns random UIDs) +User default +Group root + +# PidFile for process management +PidFile /var/run/httpd/httpd.pid + +# Server configuration +ServerAdmin root@localhost +ServerName localhost + +# Document root +DocumentRoot "/opt/app-root" + +# Directory configuration + + AllowOverride none + Require all denied + + + + AllowOverride None + Options +ExecCGI + Require all granted + AddHandler cgi-script .cgi + + +# Error and access logs +ErrorLog "/var/log/httpd/error_log" +LogLevel warn + +# Types configuration +TypesConfig /etc/mime.types + +# Include additional configurations (exclude SSL) +IncludeOptional conf.d/autoindex.conf +IncludeOptional conf.d/userdir.conf +IncludeOptional conf.d/welcome.conf +IncludeOptional conf.d/rstudio-cgi.conf diff --git a/rstudio/rhel9-python-3.11/httpd/rstudio-cgi.conf b/rstudio/rhel9-python-3.11/httpd/rstudio-cgi.conf new file mode 100644 index 000000000..7d8e645b4 --- /dev/null +++ b/rstudio/rhel9-python-3.11/httpd/rstudio-cgi.conf @@ -0,0 +1,27 @@ +# RStudio-server CGI configuration +# This configuration handles the /api/ endpoints for culling and health checks + +# Set the CGI script paths +ScriptAlias /api/kernels/ /opt/app-root/api/kernels/access.cgi +ScriptAlias /api/probe /opt/app-root/api/probe.cgi +ScriptAlias /api /opt/app-root/api/probe.cgi + +# Enable CGI for the API endpoints + + SetHandler cgi-script + Options +ExecCGI + Require all granted + + +# Ensure the CGI scripts are executable + + Options +ExecCGI + AddHandler cgi-script .cgi + Require all granted + + + + Options +ExecCGI + AddHandler cgi-script .cgi + Require all granted + diff --git a/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template b/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template index 69c6304b2..ba824cd19 100644 --- a/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template +++ b/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template @@ -6,17 +6,16 @@ rewrite ^/auth-sign-out(.*) "$custom_scheme://$http_host/rstudio/auth-sign-out$1 ############### ############### -# api calls from probes get to CGI processing +# api calls from probes get to CGI processing via Apache ############### location /api/ { - index probe.cgi; - fastcgi_index probe.cgi; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + access_log off; } location = /api/kernels { @@ -25,14 +24,23 @@ location = /api/kernels { } location /api/kernels/ { - index access.cgi; - fastcgi_index access.cgi; - gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; +} + +location = /api/probe { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### diff --git a/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix b/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix index fc494d18c..cddc18df3 100644 --- a/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix +++ b/rstudio/rhel9-python-3.11/nginx/serverconf/proxy.conf.template_nbprefix @@ -6,7 +6,7 @@ rewrite ^/auth-sign-out(.*) "$custom_scheme://$http_host/rstudio/auth-sign-out$1 ############### ############### -# api calls from probes get to CGI processing +# api calls from probes get to CGI processing via Apache ############### location = ${NB_PREFIX}/api { return 302 /api/; @@ -19,14 +19,23 @@ location ${NB_PREFIX}/api/ { } location /api/ { - index probe.cgi; - fastcgi_index probe.cgi; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + access_log off; +} + +location = /api/probe { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### @@ -44,14 +53,13 @@ location ${NB_PREFIX}/api/kernels/ { } location /api/kernels/ { - index access.cgi; - fastcgi_index access.cgi; - gzip off; - access_log off; - root /opt/app-root; - fastcgi_pass unix:/var/run/fcgiwrap.socket; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME /opt/app-root$fastcgi_script_name; + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + gzip off; + access_log off; } ############### diff --git a/rstudio/rhel9-python-3.11/run-rstudio.sh b/rstudio/rhel9-python-3.11/run-rstudio.sh index 71c979bd2..addcc707e 100755 --- a/rstudio/rhel9-python-3.11/run-rstudio.sh +++ b/rstudio/rhel9-python-3.11/run-rstudio.sh @@ -4,9 +4,24 @@ SCRIPT_DIR=$(dirname -- "$0") source ${SCRIPT_DIR}/utils/*.sh -# Start nginx and supervisord +# Start nginx and httpd run-nginx.sh & -/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & + +# Start Apache httpd with error checking +echo "Starting Apache httpd..." +/usr/sbin/httpd -D FOREGROUND & +HTTPD_PID=$! +sleep 2 + +# Check if Apache started successfully +if ! kill -0 $HTTPD_PID 2>/dev/null; then + echo "ERROR: Apache httpd failed to start" + echo "Checking Apache configuration..." + /usr/sbin/httpd -t + exit 1 +else + echo "Apache httpd started successfully (PID: $HTTPD_PID)" +fi # Add .bashrc for custom promt if not present @@ -22,7 +37,7 @@ do if [ ! -d "/opt/app-root/src/Rpackages/4.4/$package_folder" ]; then cp -r /opt/app-root/bin/Rpackages/4.4/$package_folder /opt/app-root/src/Rpackages/4.4/ fi -done +done # rstudio terminal can't see environment variables set by the container runtime; # so we set all env variables to the Renviron.site config file. For kubectl, we need the KUBERNETES_* env vars at least. # Also, we store proxy-related env vars lowercased by key so RStudio projects work with proxy by default diff --git a/rstudio/rhel9-python-3.11/supervisord/supervisord.conf b/rstudio/rhel9-python-3.11/supervisord/supervisord.conf deleted file mode 100644 index b9927e6f8..000000000 --- a/rstudio/rhel9-python-3.11/supervisord/supervisord.conf +++ /dev/null @@ -1,10 +0,0 @@ -[supervisord] -nodaemon=true -logfile=/tmp/supervisord.log -pidfile=/tmp/supervisord.pid - -[program:fcgiwrap] -command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket -autostart=true -autorestart=true -redirect_stderr=true From 284537a7e809e05552d0a2a3a55c849f5ed18079 Mon Sep 17 00:00:00 2001 From: atheo89 Date: Tue, 23 Sep 2025 16:52:50 +0200 Subject: [PATCH 4/4] Clean up dublicates --- rstudio/c9s-python-3.11/Dockerfile.cpu | 3 +-- rstudio/c9s-python-3.11/Dockerfile.cuda | 3 +-- rstudio/rhel9-python-3.11/Dockerfile.cpu | 3 +-- rstudio/rhel9-python-3.11/Dockerfile.cuda | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rstudio/c9s-python-3.11/Dockerfile.cpu b/rstudio/c9s-python-3.11/Dockerfile.cpu index 60e641402..d1a2cc5f0 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cpu +++ b/rstudio/c9s-python-3.11/Dockerfile.cpu @@ -160,8 +160,7 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - # Create httpd directories and set permissions - mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + chown -R 1001:0 /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ diff --git a/rstudio/c9s-python-3.11/Dockerfile.cuda b/rstudio/c9s-python-3.11/Dockerfile.cuda index 960fe1054..e58f0d260 100644 --- a/rstudio/c9s-python-3.11/Dockerfile.cuda +++ b/rstudio/c9s-python-3.11/Dockerfile.cuda @@ -162,8 +162,7 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - # Create httpd directories and set permissions - mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + chown -R 1001:0 /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ diff --git a/rstudio/rhel9-python-3.11/Dockerfile.cpu b/rstudio/rhel9-python-3.11/Dockerfile.cpu index 8fee26d75..8999b74d9 100644 --- a/rstudio/rhel9-python-3.11/Dockerfile.cpu +++ b/rstudio/rhel9-python-3.11/Dockerfile.cpu @@ -172,8 +172,7 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - # Create httpd directories and set permissions - mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + chown -R 1001:0 /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ diff --git a/rstudio/rhel9-python-3.11/Dockerfile.cuda b/rstudio/rhel9-python-3.11/Dockerfile.cuda index ac2c3e05f..31c7eecaa 100644 --- a/rstudio/rhel9-python-3.11/Dockerfile.cuda +++ b/rstudio/rhel9-python-3.11/Dockerfile.cuda @@ -302,8 +302,7 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - # Create httpd directories and set permissions - mkdir -p /var/log/httpd /var/run/httpd /etc/httpd/logs && \ + chown -R 1001:0 /var/log/httpd /var/run/httpd /etc/httpd/logs && \ chmod ug+rw ${NGINX_CONF_PATH} && \ chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \