Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for base URL in new argo UI server #2100

Closed
fsiegmund opened this issue Jan 30, 2020 · 2 comments · Fixed by #2105
Closed

Support for base URL in new argo UI server #2100

fsiegmund opened this issue Jan 30, 2020 · 2 comments · Fixed by #2105
Assignees
Labels
type/bug type/regression Regression from previous behavior (a specific type of bug)
Milestone

Comments

@fsiegmund
Copy link
Contributor

fsiegmund commented Jan 30, 2020

Summary

Support for base URL in new argo UI server

Motivation

This was supported before v 2.5. Without this feature, deployment is limited to / route.

Proposal

Similar implementation to previous version (< 2.5). I tried to patch the base attribute in index.html via an nginx proxy, but changes are required within the UI code to get it to work correctly.


Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@fsiegmund fsiegmund added the type/feature Feature request label Jan 30, 2020
@alexec alexec added this to the v2.5 milestone Jan 30, 2020
@alexec
Copy link
Contributor

alexec commented Jan 30, 2020

Thank you. Can you point me to how you used to configure this please so I can ensure feature parity?

@alexec alexec self-assigned this Jan 30, 2020
@alexec alexec added type/bug type/regression Regression from previous behavior (a specific type of bug) and removed type/feature Feature request labels Jan 30, 2020
@fsiegmund
Copy link
Contributor Author

fsiegmund commented Jan 30, 2020

The base url was set before via BASE_HREF environment variable. If you switch to v2.4.3 repo and search for BASE_HREF you will find how it was used during deployment e.g. I was setting it to /ui/argo/ and created appropriate ingress and service rules, and also deployed an nginx reverse proxy for remapping API calls from the UI.

See #716

argoproj/argo-ui@31c1a0a

Setting this variable resulted base element being set in index.html

<head>
    <meta charset="UTF-8">
    <title>Argo</title>
    <base href="/ui/argo/">

The reverse proxy has to remap /ui/argo/ to / e.g. for nginx:

location /ui/argo/ {
      auth_request /argo_auth;
      auth_request_set $auth_status $upstream_status;
      proxy_pass http://127.0.0.1:8001/;
}

argo-ui repo:
Dockerfile:

CMD node api/api/main.js --uiDist /app/app --inCluster ${IN_CLUSTER} --namespace ${ARGO_NAMESPACE} --force-namespace-isolation ${FORCE_NAMESPACE_ISOLATION} --instanceId ${INSTANCE_ID:-''} --enableWebConsole ${ENABLE_WEB_CONSOLE:-'false'} --uiBaseHref ${BASE_HREF:-'/'} --ip ${IP:-'0.0.0.0'} --port ${PORT:-'8001'}

app.ts:

const serveIndex = (req: express.Request, res: express.Response) => {
        fileToString(`${uiDist}/index.html`).then((content) => {
            return content.replace(`<base href="/">`, `<base href="${uiBaseHref}">`);
        })
        .then((indexContent) => res.send(indexContent))
        .catch((err) => res.send(err));
    };

I tried to patch index.html with same logic in reverse proxy, but something in the UI code for workflow route has changed that would display a wrong route in the browser. Navigation was working fine, but forcing the browser to refresh was broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug type/regression Regression from previous behavior (a specific type of bug)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants