Page MenuHomePhabricator

Serve Superset static assets from an optimised container
Closed, ResolvedPublic

Description

As part of the Superset on Kubernetes migration, we have created a single container definition for superset in T352165: Create a superset container image using the PipelineLib framework.

Whilst this has been shown to work during our testing, it struck us that it's not very efficient to use gunicorn workers to serve static page content.

A more efficient method would be to create separate containers for the front-end and back-end components.

We could then use a dedicated webserver to serve the static assets and route the traffic to the correct container from the envoy level.
This approach would give us greater capacity and scalability. It might also work well as a means of solving: T356490: [superset-k8s] Find a solution for the requestctl-generator html page

Event Timeline

Change 1005495 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/deployment-charts@master] Add a sidecar pod to superset for serving static assets

https://gerrit.wikimedia.org/r/1005495

Change 1005495 merged by jenkins-bot:

[operations/deployment-charts@master] Add an nginx reverse proxy to superset to help with serving static assets

https://gerrit.wikimedia.org/r/1005495

Change 1005759 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/deployment-charts@master] Update the image tags for superset to reflect the actual tags

https://gerrit.wikimedia.org/r/1005759

Change 1005759 merged by jenkins-bot:

[operations/deployment-charts@master] Update the image tags for superset to reflect the actual tags

https://gerrit.wikimedia.org/r/1005759

Change 1005761 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/deployment-charts@master] Fix errant bracket in nginx configmap

https://gerrit.wikimedia.org/r/1005761

Change 1005761 merged by jenkins-bot:

[operations/deployment-charts@master] Fix errant bracket in nginx configmap

https://gerrit.wikimedia.org/r/1005761

Change 1005762 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/deployment-charts@master] Bump superset chart version

https://gerrit.wikimedia.org/r/1005762

Change 1005762 merged by jenkins-bot:

[operations/deployment-charts@master] Bump superset chart version

https://gerrit.wikimedia.org/r/1005762

Change 1005542 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/deployment-charts@master] Improve the superset nginx reverse proxy configuration

https://gerrit.wikimedia.org/r/1005542

I think that this is ready to go now. I got fairly confused because the requests to https://superset-next-k8s.wikimedia.org were actually being redirected to the mediawiki app servers, rather than to the dse-k8s ingress gateway.

image.png (1,844×531 px, 336 KB)

Anyway, I've tested it with an SSH tunnel and I'm happy that it's working with this method.

sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ssh
ssh -N -L 443:superset-next.svc.eqiad.wmnet:30443 deploy2002.codfw.wmnet

I also added an entry to my local /etc/hosts files like this:

127.0.0.1 superset-next.wikimedia.org

I was then able to log into https://superset-next.wikimedia.org although it was a bit bumpy with the OIDC settings.

I think that we should just migrate superset-next.wikimedia.org straight to dse-k8s now and do away with the superset-next-k8s alias.

Change 1005542 merged by jenkins-bot:

[operations/deployment-charts@master] Improve the superset nginx reverse proxy configuration

https://gerrit.wikimedia.org/r/1005542