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

prometheus: bundle the webui assets and build the new React UI #74987

Merged
merged 1 commit into from Dec 6, 2019

Conversation

delroth
Copy link
Contributor

@delroth delroth commented Dec 4, 2019

Motivation for this change

v2.14 introduced a new experimental React UI and changed how web assets
are bundled with Prometheus. A separate pre-build command is required to
generate an asset bundle that gets statically linked into the Prometheus
binary.

Fixes #74844.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

v2.14 introduced a new experimental React UI and changed how web assets
are bundled with Prometheus. A separate pre-build command is required to
generate an asset bundle that gets statically linked into the Prometheus
binary.
@grahamc
Copy link
Member

grahamc commented Dec 4, 2019

I'm not keen on adding 12,000 lines of code for an experimental UI. Is it required for operation?

@delroth
Copy link
Contributor Author

delroth commented Dec 4, 2019

Not yet, but I expect it will be within a few versions, it's intended to be a full replacement. Some light patching will also be required to have the assets bundling work without building the new UI.

The 12K lines of code is a general problem with JavaScript and Nix as far as I can tell. Many of the URLs in there are actually already cached on cache.nixos.org, so I expect we have a few overlapping gigantic lock files in nixpkgs.

@globin
Copy link
Member

globin commented Dec 5, 2019

I think the solution is fine, I'd propose merging, we don't have any better solution until recursive nix etc.

@bjornfor
Copy link
Contributor

bjornfor commented Dec 6, 2019

-1 on adding 550 KiB of nix expressions for one package. Isn't there something else that can be done?

@yorickvP
Copy link
Contributor

yorickvP commented Dec 6, 2019

For vault, we package the upstream binary of the WebUI instead. Alternatively, we could use one of those tools to parse the lockfile, but that will take IFD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prometheus: error reading base template: open templates/_base.html: no such file or directory
5 participants