Skip to content

feat: add base URL for deploymentΒ #1820

@schwarbf

Description

@schwarbf

We currently have many Streamlit applications deployed on our Kubernetes cluster. The Kubernetes Ingress routes the requests to the corresponding deployment in Kubernetes with a base URL path. This means that when we try to access https://demo.com/baseurl in our browsers, the request gets routed to the specific Kubernetes deployment where the Streamlit app is running.

This can easily be configured instreamlit using for example the config baseUrlPath (See here for more information). For example, we deploy our Streamlit app under https://demo.com/app1 by launching streamlit in the Deployment:

streamlit run /app/streamlit_dashboard.py --server.port 5000 --server.baseUrlPath /app1

We wanted to replace many of those Streamlit apps with Python Shiny apps. However, as of today, this seems not possible for us. A similar issue was posted on StackOverflow. The problem is that the Shiny doesn't provide the a equivalent parameter to baseUrlPath.

We have already unsuccessfully tried the following approaches:

1. Use --root-path flag in uvicorn
We tried to deploy the app using uvicorn shiny_demo.shiny.run:app --host 0.0.0.0 --port 5000 --root-path/shiny_demo. However, this parameter does not solve our issue. Rather, it appends the root path to every incoming request.
Shiny doesn't recognize such a path and returns a 404 error.

2. Modify the ingress to remove the base URL when it reaches the deployment
This didn't work either because Shiny tries to access several .js and .css files that do not have the base url prefix.

Any suggestion or help is highly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions