Merge pull request #141477 from eyJhb/prometheus-2.3.3
prometheus: 2.27.1 -> 2.30.3
This commit is contained in:
commit
3e019f7577
12 changed files with 98089 additions and 12830 deletions
|
@ -1,6 +1,9 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, go
|
||||
, pkgs
|
||||
, nodejs
|
||||
, nodePackages
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, mkYarnPackage
|
||||
|
@ -9,27 +12,59 @@
|
|||
}:
|
||||
|
||||
let
|
||||
version = "2.27.1";
|
||||
version = "2.30.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "prometheus";
|
||||
repo = "prometheus";
|
||||
sha256 = "0836ygyvld5skjycd7366i6vyf451s6cay5ng6c2fwq0skvp2gj2";
|
||||
sha256 = "1as6x5bsp7mxa4rp7jhyjlpcvzqm1zngnwvp73rc4rwhz8w8vm3k";
|
||||
};
|
||||
|
||||
goPackagePath = "github.com/prometheus/prometheus";
|
||||
|
||||
webui = mkYarnPackage {
|
||||
src = "${src}/web/ui/react-app";
|
||||
packageJSON = ./webui-package.json;
|
||||
yarnNix = ./webui-yarndeps.nix;
|
||||
codemirrorNode = import ./webui/codemirror-promql {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
webuiNode = import ./webui/webui {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
|
||||
# The standard yarn2nix directory management causes build failures with
|
||||
# Prometheus's webui due to using relative imports into node_modules. Use
|
||||
# an extremely simplified version of it instead.
|
||||
configurePhase = "ln -s $node_modules node_modules";
|
||||
buildPhase = "PUBLIC_URL=. yarn build";
|
||||
codemirror = stdenv.mkDerivation {
|
||||
name = "prometheus-webui-codemirror-promql";
|
||||
src = "${src}/web/ui/module/codemirror-promql";
|
||||
|
||||
buildInputs = [ nodejs nodePackages.typescript codemirrorNode.nodeDependencies ];
|
||||
|
||||
configurePhase = ''
|
||||
ln -s ${codemirrorNode.nodeDependencies}/lib/node_modules node_modules
|
||||
'';
|
||||
buildPhase = ''
|
||||
PUBLIC_URL=. npm run build
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
mv lib dist $out
|
||||
'';
|
||||
distPhase = ":";
|
||||
};
|
||||
|
||||
|
||||
webui = stdenv.mkDerivation {
|
||||
name = "prometheus-webui";
|
||||
src = "${src}/web/ui/react-app";
|
||||
|
||||
buildInputs = [ nodejs webuiNode.nodeDependencies ];
|
||||
|
||||
# create `node_modules/.cache` dir (we need writeable .cache)
|
||||
# and then copy the rest over.
|
||||
configurePhase = ''
|
||||
mkdir -p node_modules/{.cache,.bin}
|
||||
cp -a ${webuiNode.nodeDependencies}/lib/node_modules/. node_modules
|
||||
'';
|
||||
buildPhase = "PUBLIC_URL=. npm run build";
|
||||
installPhase = "mv build $out";
|
||||
distPhase = "true";
|
||||
};
|
||||
|
@ -38,13 +73,23 @@ buildGoModule rec {
|
|||
pname = "prometheus";
|
||||
inherit src version;
|
||||
|
||||
vendorSha256 = "0dq3p7hga7m1aq78har5rr136hlb0kp8zhh2wzqlkxrk1f33w54p";
|
||||
vendorSha256 = "0qyv8vybx5wg8k8hwvrpp4hz9wv6g4kf9sq5v5qc2bxx6apc0s9r";
|
||||
|
||||
excludedPackages = [ "documentation/prometheus-mixin" ];
|
||||
|
||||
nativeBuildInputs = [ nodejs ];
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${webui.node_modules} web/ui/react-app/node_modules
|
||||
# we don't want this anyways, as we
|
||||
# build modules for them
|
||||
echo "exit 0" > web/ui/module/build.sh
|
||||
|
||||
ln -s ${webuiNode.nodeDependencies}/lib/node_modules web/ui/react-app/node_modules
|
||||
ln -s ${webui} web/ui/static/react
|
||||
|
||||
# webui-codemirror
|
||||
ln -s ${codemirror}/dist web/ui/module/codemirror-promql/dist
|
||||
ln -s ${codemirror}/lib web/ui/module/codemirror-promql/lib
|
||||
'';
|
||||
|
||||
tags = [ "builtinassets" ];
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -I nixpkgs=../../../.. -i bash -p wget yarn2nix-moretea.yarn2nix
|
||||
|
||||
# This script is based upon:
|
||||
# pkgs/applications/networking/instant-messengers/riot/update-riot-desktop.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 1 ] || [[ "$1" == -* ]]; then
|
||||
echo "Regenerates the Yarn dependency lock files for the prometheus package."
|
||||
echo "Usage: $0 <git release tag>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROM_WEB_SRC="https://raw.githubusercontent.com/prometheus/prometheus/$1"
|
||||
|
||||
wget "$PROM_WEB_SRC/web/ui/react-app/package.json" -O webui-package.json
|
||||
wget "$PROM_WEB_SRC/web/ui/react-app/yarn.lock" -O yarn.lock
|
||||
yarn2nix --lockfile=yarn.lock > webui-yarndeps.nix
|
||||
rm yarn.lock
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../../../../development/node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
9436
pkgs/servers/monitoring/prometheus/webui/codemirror-promql/node-packages.nix
generated
Normal file
9436
pkgs/servers/monitoring/prometheus/webui/codemirror-promql/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
22167
pkgs/servers/monitoring/prometheus/webui/codemirror-promql/package-lock.json
generated
Normal file
22167
pkgs/servers/monitoring/prometheus/webui/codemirror-promql/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"name": "codemirror-promql",
|
||||
"version": "0.17.0",
|
||||
"description": "a CodeMirror mode for the PromQL language",
|
||||
"main": "cjs/index.js",
|
||||
"module": "esm/index.js",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server --config webpack.config.cjs --open",
|
||||
"build": "npm run build:grammar && npm run build:lib && npm run build:app",
|
||||
"build:grammar": "lezer-generator src/lang-promql/grammar/promql.grammar -o src/lang-promql/grammar/parser",
|
||||
"build:lib": "bash ./build.sh",
|
||||
"build:app": "webpack --config webpack.config.cjs",
|
||||
"test": "npm run build:grammar && ts-mocha -p tsconfig.json src/**/*.test.ts",
|
||||
"test-coverage": "npm run build:grammar && nyc ts-mocha -p ./tsconfig.json ./**/*.test.ts",
|
||||
"codecov": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||
"lint": "eslint src/ --ext .ts",
|
||||
"lint:fix": "eslint --fix src/ --ext .ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/prometheus-community/codemirror-promql.git"
|
||||
},
|
||||
"keywords": [
|
||||
"promql",
|
||||
"codemirror",
|
||||
"mode",
|
||||
"prometheus"
|
||||
],
|
||||
"author": "Prometheus Authors <prometheus-developers@googlegroups.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/prometheus-community/codemirror-promql/issues"
|
||||
},
|
||||
"homepage": "https://github.com/prometheus-community/codemirror-promql/blob/master/README.md",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codemirror/autocomplete": "^0.18.3",
|
||||
"@codemirror/basic-setup": "^0.18.0",
|
||||
"@codemirror/highlight": "^0.18.3",
|
||||
"@codemirror/language": "^0.18.0",
|
||||
"@codemirror/lint": "^0.18.1",
|
||||
"@codemirror/state": "^0.18.2",
|
||||
"@codemirror/view": "^0.18.1",
|
||||
"@types/chai": "^4.2.12",
|
||||
"@types/lru-cache": "^5.1.0",
|
||||
"@types/mocha": "^8.0.3",
|
||||
"@types/node": "^14.0.13",
|
||||
"@typescript-eslint/eslint-plugin": "^2.22.0",
|
||||
"@typescript-eslint/parser": "^2.22.0",
|
||||
"chai": "^4.2.0",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"codecov": "^3.8.1",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-flowtype": "^5.2.0",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"html-webpack-plugin": "^4.3.0",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"lezer": "^0.13.1",
|
||||
"lezer-generator": "^0.13.1",
|
||||
"mocha": "^8.1.2",
|
||||
"nock": "^13.0.11",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier": "^2.0.5",
|
||||
"ts-loader": "^7.0.4",
|
||||
"ts-mocha": "^8.0.0",
|
||||
"ts-node": "^9.0.0",
|
||||
"typescript": "^4.2.3",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.11.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@codemirror/autocomplete": "^0.18.3",
|
||||
"@codemirror/highlight": "^0.18.3",
|
||||
"@codemirror/language": "^0.18.0",
|
||||
"@codemirror/lint": "^0.18.1",
|
||||
"@codemirror/state": "^0.18.2",
|
||||
"@codemirror/view": "^0.18.1",
|
||||
"lezer": "^0.13.0"
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"printWidth": 150
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
}
|
32
pkgs/servers/monitoring/prometheus/webui/update-web-deps.sh
Executable file
32
pkgs/servers/monitoring/prometheus/webui/update-web-deps.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "$#" -ne 1 || "$1" == -* ]]; then
|
||||
echo "Regenerates the npm dependency lock files for the prometheus package."
|
||||
echo "Usage: $0 <git release tag>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
update() {
|
||||
RELEASE_TAG=$1
|
||||
GIT_PATH=$2
|
||||
OUTPUT_PATH=$3
|
||||
NODE_ENV=$4
|
||||
|
||||
PROM_WEB_SRC="https://raw.githubusercontent.com/prometheus/prometheus/$1"
|
||||
wget "$PROM_WEB_SRC/$GIT_PATH/package.json" -O package.json
|
||||
wget "$PROM_WEB_SRC/$GIT_PATH/package-lock.json" -O package-lock.json
|
||||
|
||||
node2nix \
|
||||
--lock package-lock.json \
|
||||
--development \
|
||||
--node-env $NODE_ENV \
|
||||
--no-copy-node-env
|
||||
|
||||
mkdir -p $OUTPUT_PATH
|
||||
mv default.nix node-packages.nix package.json package-lock.json $OUTPUT_PATH
|
||||
}
|
||||
|
||||
update $1 "web/ui/module/codemirror-promql" "codemirror-promql" ../../../../../development/node-packages/node-env.nix
|
||||
update $1 "web/ui/react-app" "webui" ../../../../../development/node-packages/node-env.nix
|
17
pkgs/servers/monitoring/prometheus/webui/webui/default.nix
Normal file
17
pkgs/servers/monitoring/prometheus/webui/webui/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../../../../development/node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
17600
pkgs/servers/monitoring/prometheus/webui/webui/node-packages.nix
generated
Normal file
17600
pkgs/servers/monitoring/prometheus/webui/webui/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
48650
pkgs/servers/monitoring/prometheus/webui/webui/package-lock.json
generated
Normal file
48650
pkgs/servers/monitoring/prometheus/webui/webui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -19,13 +19,11 @@
|
|||
"@fortawesome/fontawesome-svg-core": "^1.2.14",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.7.1",
|
||||
"@fortawesome/react-fontawesome": "^0.1.4",
|
||||
"@reach/router": "^1.2.1",
|
||||
"@nexucis/fuzzy": "^0.3.0",
|
||||
"bootstrap": "^4.6.0",
|
||||
"codemirror-promql": "^0.15.0",
|
||||
"codemirror-promql": "^0.17.0",
|
||||
"css.escape": "^1.5.1",
|
||||
"downshift": "^3.4.8",
|
||||
"enzyme-to-json": "^3.4.3",
|
||||
"fuzzy": "^0.1.3",
|
||||
"i": "^0.3.6",
|
||||
"jquery": "^3.5.1",
|
||||
"jquery.flot.tooltip": "^0.9.0",
|
||||
|
@ -37,20 +35,19 @@
|
|||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"react-dom": "^16.7.0",
|
||||
"react-resize-detector": "^5.0.7",
|
||||
"react-scripts": "3.4.4",
|
||||
"react-router-dom": "^5.2.1",
|
||||
"react-test-renderer": "^16.9.0",
|
||||
"reactstrap": "^8.9.0",
|
||||
"sanitize-html": "^2.3.3",
|
||||
"sass": "1.32.10",
|
||||
"sass": "1.39.0",
|
||||
"tempusdominus-bootstrap-4": "^5.1.2",
|
||||
"tempusdominus-core": "^5.0.3",
|
||||
"typescript": "^3.3.3",
|
||||
"use-media": "^1.4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test --runInBand",
|
||||
"test": "react-scripts test --runInBand --resetMocks=false",
|
||||
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
|
||||
"eject": "react-scripts eject",
|
||||
"lint:ci": "eslint --quiet \"src/**/*.{ts,tsx}\"",
|
||||
|
@ -71,36 +68,31 @@
|
|||
"@testing-library/react-hooks": "^3.1.1",
|
||||
"@types/enzyme": "^3.10.3",
|
||||
"@types/enzyme-adapter-react-16": "^1.0.5",
|
||||
"@types/flot": "0.0.31",
|
||||
"@types/jest": "^26.0.10",
|
||||
"@types/flot": "0.0.32",
|
||||
"@types/jest": "^27.0.0",
|
||||
"@types/jquery": "^3.5.1",
|
||||
"@types/moment-timezone": "^0.5.10",
|
||||
"@types/node": "^12.11.1",
|
||||
"@types/reach__router": "^1.2.6",
|
||||
"@types/react": "^16.8.2",
|
||||
"@types/react-copy-to-clipboard": "^5.0.0",
|
||||
"@types/react-dom": "^16.8.0",
|
||||
"@types/react-resize-detector": "^5.0.0",
|
||||
"@types/react-router-dom": "^5.1.8",
|
||||
"@types/reactstrap": "^8.7.2",
|
||||
"@types/sanitize-html": "^1.20.2",
|
||||
"@types/sinon": "^9.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "2.x",
|
||||
"@typescript-eslint/parser": "2.x",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.15.1",
|
||||
"eslint": "6.x",
|
||||
"eslint-config-prettier": "^6.4.0",
|
||||
"eslint-config-react-app": "^5.0.2",
|
||||
"eslint-plugin-flowtype": "4.x",
|
||||
"eslint-plugin-import": "2.x",
|
||||
"eslint-plugin-jsx-a11y": "6.x",
|
||||
"eslint-plugin-prettier": "^3.1.1",
|
||||
"eslint-plugin-react": "7.x",
|
||||
"eslint-plugin-react-hooks": "2.x",
|
||||
"enzyme-to-json": "^3.4.3",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-react-app": "^6.0.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"mutationobserver-shim": "^0.3.7",
|
||||
"prettier": "^1.18.2",
|
||||
"sinon": "^9.0.3"
|
||||
"prettier": "^2.3.2",
|
||||
"react-scripts": "4.0.3",
|
||||
"sinon": "^9.0.3",
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"proxy": "http://localhost:9090",
|
||||
"jest": {
|
||||
|
@ -110,5 +102,8 @@
|
|||
"transformIgnorePatterns": [
|
||||
"/node_modules/(?!codemirror-promql).+(js|jsx)$"
|
||||
]
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "^2.3.2"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue