You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by Martyn Gigg - STFC UKRI <ma...@stfc.ac.uk.INVALID> on 2025/01/24 13:09:46 UTC

[DISCUSS] [SIP-112]

Hi,

A while back I wanted to revive the discussion on deploying Superset under a path prefix: https://github.com/apache/superset/issues/26319.

After a little more time than I would have liked I have a working implementation at https://github.com/apache/superset/pull/30134 that I’m fairly happy with and I’m just nursing some PR checks through.

The approach I have taken is to add some middleware in superset.app:create_app<https://github.com/apache/superset/pull/30134/files#diff-9689cb75a0ebe47604d59e0a54c904040cd60b45a283a87d0f8d77cac60751d8> that translates the paths that have a prefix into un-prefixed paths for the remainder of the application. This is similar to how Flask recommends deploying apps that need to run in the same process but on different paths.

For the frontend I have passed the application root through the bootstrap_data<https://github.com/apache/superset/pull/30134/files#diff-8a676fb002920d1d142fa9b19ded1ecb7b8b8d682cf9b9fe80f01b1a2314c86dR336> and used this to prefix paths as necessary across the frontend. This has the advantage of not requiring a separate webpack build of the frontend assets for each new prefix.

Does this sound like a reasonable approach?

Best,

Martyn

ISIS Computing Division
Science and Technology Facilities Council


Re: [DISCUSS] [SIP-112]

Posted by Beto Dealmeida <ro...@dealmeida.net.INVALID>.
I think this is a big win, and making sure we're able to deploy superset under a custom prefix will improve the code quality.

Jan 24, 2025 8:10:48 AM Martyn Gigg - STFC UKRI <ma...@stfc.ac.uk.INVALID>:

> Hi,
> 
> A while back I wanted to revive the discussion on deploying Superset under a path prefix: https://github.com/apache/superset/issues/26319.
> 
> After a little more time than I would have liked I have a working implementation at https://github.com/apache/superset/pull/30134 that I’m fairly happy with and I’m just nursing some PR checks through.
> 
> The approach I have taken is to add some middleware in superset.app:create_app<https://github.com/apache/superset/pull/30134/files#diff-9689cb75a0ebe47604d59e0a54c904040cd60b45a283a87d0f8d77cac60751d8> that translates the paths that have a prefix into un-prefixed paths for the remainder of the application. This is similar to how Flask recommends deploying apps that need to run in the same process but on different paths.
> 
> For the frontend I have passed the application root through the bootstrap_data<https://github.com/apache/superset/pull/30134/files#diff-8a676fb002920d1d142fa9b19ded1ecb7b8b8d682cf9b9fe80f01b1a2314c86dR336> and used this to prefix paths as necessary across the frontend. This has the advantage of not requiring a separate webpack build of the frontend assets for each new prefix.
> 
> Does this sound like a reasonable approach?
> 
> Best,
> 
> Martyn
> 
> ISIS Computing Division
> Science and Technology Facilities Council