-
Notifications
You must be signed in to change notification settings - Fork 39
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
Build the UI and bundle it in Python packages #1219
Comments
Thanks, I guess we can build the front end in the CI pipeline and then use |
Yes, that could work, in principle. I would use Does any facility do customisation of the UI? |
The idea is that the all customization that is needed can be done through configuration files, the removal of the |
Not working on this right now, but it came to my mind anyway... The idea would be to have the UI built in the wheels (and sdist), is that right? But does anyone install mxcubeweb directly from a wheel? Currently at MaxIV we don't, we install from a git checkout. |
I guess it could be done by building the UI automatically and placing it somewhere in the repository like this it can be used both by "git checked-out" sources and then possible included in a package. The first would probably be a quite straight forward thing to do (but perhaps a bit unconventional) |
In this case, my vote would go for "no". Unconventional indeed :D ... I do not think the pros would outweigh the cons in this case. I am not sure how we would make sure that things do not go out of sync, that the built code is always up-to-date. I am not against the idea of having the built UI in the sdist and wheel, though, if it helps anyone. Do we know of any setup where mxcubeweb is installed directly from a sdist or a wheel (from PyPI)? |
Hmm, I definitely wouldn't version-control the front-end build output. Deploying MXCuBE via The ideal deployment, in my opinion, should not require: 1. installing Node and pnpm, 2. installing front-end dependencies, 3. building the front-end bundle. This all has to be done in a dedicated, controlled environment ahead of time (e.g. CI machine). Embedding the front-end build output in the wheels would definitely meet this requirement, but as you said @fabcor-maxiv if nobody deploys from the wheels, there's no point in doing it. Perhaps this issue is a bit premature and the first step should be to write high-level deployment "best practices" and let each facility find the technical solutions that suit its needs (Docker, etc.)? |
Well, we are not currently deploying from wheels but we could in theory do it, we build a package for each version we deploy on the beamlines. However, the really big disadvantage of deploying a package (and the reason we are currently not doing it) is for debugging on the beamline. |
This is where having two side by side environments could help:
|
Yes to this. That is why I started writing this document: https://mxcubeweb.readthedocs.io/en/latest/dev/deployment.html. And I hope the questionnaire will help uncover more things that need documenting.
Yes, this is feasible, but I am not sure how much can be done in a way that works for all. In other words, not sure how much can be done here on GitHub. Probably every facility needs to do this for themselves. And so we are back to: we need to write documentation. [Aside: I am always a bit torn on writing this kind of documentation, because in the end, it is nothing specific to MXCuBE, it is just standard practices when working with Python, Node.js, web applications, software in general. There is way better documentation out there than what we could possibly write.]
Yes, same for us. Although up to now my impression was that debugging at the beamline mostly involves debugging the Python back-end and rarely the JavaScript UI front-end. So I guess, at least in our case at MAX IV, we could built the JavaScript UI front-end in our CI pipelines, upload it to our internal npm package repository and install it at the beamlines from our internal npm package repository.
Maybe, I have not considered this... No idea if that would help at MaxIV... I would need to think about it... |
Agreed, our documentation should just point to external resources, maybe like this or that.
Even having the Python code here and there makes it tempting to try to fix bugs directly in the production environment, but this can break things even more... The process and scope of debugging on the beamlines is definitely worth thinking about too (and documenting). Maybe something like this (though I'm far from an expert and have no experience doing this whatsoever):
Note that beamline staff would easily be able to handle 2. and 3. The steps between fixing a bug in the codebase and redeploying to staging/production could for instance be done via a dedicated, facility-hosted repository with a Docker file and some manually-triggered CI workflows designed to:
Sorry for going way out of scope of the initial issue... 😅 |
It could be helpful to have pre-built UI in Python packages for easier deployment. This should be investigated.
The text was updated successfully, but these errors were encountered: