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 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 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 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 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 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.

@grahamc grahamc merged commit d7ca8fe into NixOS:master Dec 6, 2019
15 checks passed
15 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
prometheus on aarch64-linux Success
Details
prometheus on x86_64-linux Success
Details
@delroth delroth deleted the delroth:prom-webui branch Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.