https://flyte.org logo
#contribute
Title
# contribute
e

Ethan Brown

04/03/2024, 6:01 PM
I'm starting to look into being able to subpath the ingress -- and I've hit my first snag. It looks like the
BASE_URL
value in flyteconsole was at one point intended to be settable at runtime. See original commit at https://github.com/flyteorg/flyte/commit/506408bb4d23287b9f0e1ab76af432aaa44dbd91#diff-bbb462dd82add45799ac05fd25[…]8c07651b2612af98aa2e3a2f79f58R68 However,
BASE_URL
is used not only at runtime, but also at build time in flyteconsole at https://github.com/flyteorg/flyteconsole/blob/master/Dockerfile#L22 To double check things, I tried setting
BASE_URL
but all the javascript resources inside the image were still looking for assets at
/console
rather than the value I set. Should this one be filed as a bug? Or is this not supported any longer?
Ok, I was able to sort this out -- but it was tricky because it requires: • Building the console image and setting
BASE_URL
to hardcode the correct paths into index.html for all the links to webpack scripts -- i.e.
/flyte/console
• Making sure to set that same value at runtime on the container (if it's set to the default of
/console
the web app misbehaves) • Additionally setting
BASE_HREF
in the console container (otherwise the uris in the browser history are wrong, and reloading the page will fail) • Set the
ADMIN_API_URL
to point to the right place - like
<https://foo.com/flyte>
• Updating the ingress to add the subpath support... carefully. ◦ The console endpoints must remain intact - so requests from
/flyte/console
must go to
/flyte/console
in flyteconsole service ◦ The API endpoints must be rewritten by the ingress -- so requests to
/flyte/api/...
must be rewritten as
/api/...
for all the API endpoints This could be made a lot simpler... but I don't see a good way around setting all this configuration like this right now (primarily b/c the console build process uses static absolute paths rather than relative)
I've also found that the code here does not appear to be right as
/console
is hardcoded -- https://github.com/flyteorg/flyteconsole/blob/34edde1cb2c7df2f77da6f9fabdefbe2d89c6353/packages/common/src/routes/index.ts#L25 I'm going to fork / build from that fork to confirm
r

Richard Liu

04/04/2024, 7:36 PM
small flyteconsole PR to fix missing breadcrumbs for custom base paths (i.e. when configured to something instead of
/console
)
2 Views