Skip to content

Limited Port Access in Compute Containers Prevents Use of Additional Development Servers #75

@alanlujan91

Description

@alanlujan91

Description

SciServer Compute containers currently only expose port 8888 (Jupyter Lab) through the proxy system, which prevents users from accessing additional development servers running inside their containers. This limitation affects modern development workflows that rely on tools running local web servers on various ports.

Current Behavior

When users run development servers in the Jupyter Lab terminal (e.g., myst start, streamlit run app.py, python -m http.server), these servers start successfully within the container but are not accessible from the browser because:

  1. Only port 8888/tcp is bound in the Docker container configuration across all ExecutableManager implementations:

    • DefaultExecutableManager.java (lines 206-208)
    • NvidiaExecutableManager.java (lines 183-184)
    • NvidiaExecutableManager2.java (lines 189-190)
    • DsAppsExecutableManager.java (lines 192-194)
  2. Kubernetes-based deployments similarly expose only port 8888:

    • KubernetesExecutableManager.java (line 60: servicePort = 8888)
    • KubernetesExecutableManager2.java (line 63: servicePort = 8888)
  3. The proxy configuration in DockerBaseExecutableManager.java (line 58) and RegistryImpl.java (line 553) only forwards traffic to http://127.0.0.1:<assigned_port>, which maps exclusively to port 8888 inside the container

Expected Behavior

Users should be able to access web services running on additional ports within their compute containers, enabling modern development workflows.

Use Cases Affected

  • MyST Markdown: Documentation live preview servers
  • Streamlit: Data science apps (typically port 8501)
  • Dash/Plotly: Dashboard applications (typically port 8050)
  • Gradio: ML model interfaces (typically port 7860)
  • Bokeh Server: Interactive visualizations (typically port 5006)
  • FastAPI/Flask/Django: Custom API/web application development
  • Panel/Voilà: Jupyter-based dashboards
  • RStudio Server: R development (if installed)

Proposed Solutions

Option 1: Jupyter Server Proxy Integration (Recommended)

Integrate jupyter-server-proxy into SciServer compute images. This extension proxies arbitrary ports through Jupyter Lab's existing port 8888 infrastructure without requiring additional port bindings.

Advantages:

  • Minimal infrastructure changes
  • Leverages existing authentication and proxy architecture
  • Battle-tested solution used by Binder, JupyterHub, and other platforms
  • Provides intuitive UI for launching applications
  • No changes needed to ExecutableManager implementations

Implementation:

  • Add jupyter-server-proxy to container images
  • Configure proxy rules for common tools
  • Users can add custom proxies via configuration

Option 2: Multiple Port Binding

Extend container configuration to expose a range of additional ports (e.g., 8000-8010) with corresponding proxy rules.

Considerations:

  • Requires modifications to all six ExecutableManager implementations
  • Needs HttpProxyClient interface extensions
  • Port allocation management per user
  • More complex infrastructure changes

Option 3: Dynamic Port Registration API

Implement an API allowing users to request port forwarding during their session.

Considerations:

  • Most complex implementation
  • Requires new API endpoints and UI
  • Dynamic proxy reconfiguration

Current Workarounds

Users can currently:

  1. Generate static HTML files and view them through Jupyter Lab's file browser (loses live-reload functionality)
  2. Download files locally for preview (negates integrated development environment benefits)

These workarounds significantly reduce productivity and limit the appeal of SciServer for modern development workflows.

Impact

This limitation affects data scientists, researchers, and developers using modern Python development tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions