pghero: init at 3.5.0

This commit is contained in:
Ivan Trubach 2023-11-22 11:53:43 +03:00
parent b1a4e835b6
commit ee429344a5
5 changed files with 1457 additions and 0 deletions

View File

@ -0,0 +1,14 @@
source "https://rubygems.org"
gem "rails", "~> 7.0.0"
gem "propshaft"
gem "puma"
gem "pg"
gem "activerecord-nulldb-adapter", require: false
# See also https://github.com/ankane/pghero/blob/v3.3.4/guides/Rails.md
gem "pghero"
gem "pg_query"
gem "aws-sdk-cloudwatch"
gem "google-apis-monitoring_v3"
gem "azure_mgmt_monitor"

View File

@ -0,0 +1,280 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.3)
actionpack (= 7.0.8.3)
activesupport (= 7.0.8.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.3)
actionpack (= 7.0.8.3)
activejob (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.3)
actionpack (= 7.0.8.3)
actionview (= 7.0.8.3)
activejob (= 7.0.8.3)
activesupport (= 7.0.8.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.3)
actionview (= 7.0.8.3)
activesupport (= 7.0.8.3)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.3)
actionpack (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.3)
activesupport (= 7.0.8.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8.3)
activesupport (= 7.0.8.3)
globalid (>= 0.3.6)
activemodel (7.0.8.3)
activesupport (= 7.0.8.3)
activerecord (7.0.8.3)
activemodel (= 7.0.8.3)
activesupport (= 7.0.8.3)
activerecord-nulldb-adapter (1.0.1)
activerecord (>= 5.2.0, < 7.2)
activestorage (7.0.8.3)
actionpack (= 7.0.8.3)
activejob (= 7.0.8.3)
activerecord (= 7.0.8.3)
activesupport (= 7.0.8.3)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
aws-eventstream (1.3.0)
aws-partitions (1.935.0)
aws-sdk-cloudwatch (1.91.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.196.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
azure_mgmt_monitor (0.19.0)
ms_rest_azure (~> 0.12.0)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.2.4)
concurrent-ruby (1.2.3)
crass (1.0.6)
date (3.3.4)
declarative (0.0.20)
domain_name (0.6.20240107)
erubi (1.12.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
globalid (1.2.1)
activesupport (>= 6.1)
google-apis-core (0.15.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-monitoring_v3 (0.62.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-env (2.1.1)
faraday (>= 1.0, < 3.a)
google-protobuf (4.27.0)
bigdecimal
rake (>= 13)
googleauth (1.11.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
jwt (2.8.1)
base64
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.4)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.23.1)
ms_rest (0.7.6)
concurrent-ruby (~> 1.0)
faraday (>= 0.9, < 2.0.0)
timeliness (~> 0.3.10)
ms_rest_azure (0.12.0)
concurrent-ruby (~> 1.0)
faraday (>= 0.9, < 2.0.0)
faraday-cookie_jar (~> 0.0.6)
ms_rest (~> 0.7.6)
multi_json (1.15.0)
multipart-post (2.4.1)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
os (1.1.4)
pg (1.5.6)
pg_query (5.1.0)
google-protobuf (>= 3.22.3)
pghero (3.5.0)
activerecord (>= 6)
propshaft (0.9.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
public_suffix (5.0.5)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
rack (2.2.9)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.3)
actioncable (= 7.0.8.3)
actionmailbox (= 7.0.8.3)
actionmailer (= 7.0.8.3)
actionpack (= 7.0.8.3)
actiontext (= 7.0.8.3)
actionview (= 7.0.8.3)
activejob (= 7.0.8.3)
activemodel (= 7.0.8.3)
activerecord (= 7.0.8.3)
activestorage (= 7.0.8.3)
activesupport (= 7.0.8.3)
bundler (>= 1.15.0)
railties (= 7.0.8.3)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.3)
actionpack (= 7.0.8.3)
activesupport (= 7.0.8.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.8)
strscan (>= 3.0.9)
ruby2_keywords (0.0.5)
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
strscan (3.1.0)
thor (1.3.1)
timeliness (0.3.10)
timeout (0.4.1)
trailblazer-option (0.1.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.15)
PLATFORMS
ruby
DEPENDENCIES
activerecord-nulldb-adapter
aws-sdk-cloudwatch
azure_mgmt_monitor
google-apis-monitoring_v3
pg
pg_query
pghero
propshaft
puma
rails (~> 7.0.0)
BUNDLED WITH
2.5.9

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
{ lib
, stdenv
, ruby
, bundlerEnv
, buildPackages
, fetchFromGitHub
, makeBinaryWrapper
, callPackage
}:
stdenv.mkDerivation (finalAttrs:
let
# Use bundlerEnvArgs from passthru to allow overriding bundlerEnv arguments.
rubyEnv = bundlerEnv finalAttrs.passthru.bundlerEnvArgs;
# We also need a separate nativeRubyEnv to precompile assets on the build
# host. If possible, reuse existing rubyEnv derivation.
nativeRubyEnv =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then rubyEnv
else buildPackages.bundlerEnv finalAttrs.passthru.bundlerEnvArgs;
bundlerEnvArgs = {
name = "${finalAttrs.pname}-${finalAttrs.version}-gems";
gemdir = ./.;
};
in
{
pname = "pghero";
version = "3.5.0";
src = fetchFromGitHub {
owner = "pghero";
repo = "pghero";
rev = "v${finalAttrs.version}";
hash = "sha256-6JShYn3QfxPdAVcrJ7/kxzxa4dBEzSkUiLguIH+VCRQ=";
};
strictDeps = true;
nativeBuildInputs = [ nativeRubyEnv makeBinaryWrapper ];
inherit rubyEnv;
buildPhase = ''
runHook preBuild
DATABASE_URL=nulldb:/// RAILS_ENV=production rake assets:precompile
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p -- "$out"/{share,bin}
cp -a -- . "$out"/share/pghero
makeWrapper "$rubyEnv"/bin/puma "$out"/bin/pghero \
--add-flags -C \
--add-flags config/puma.rb \
--chdir "$out"/share/pghero
runHook postInstall
'';
passthru = {
inherit bundlerEnvArgs;
updateScript = callPackage ./update.nix { };
};
meta = {
homepage = "https://github.com/ankane/pghero";
description = "Performance dashboard for Postgres";
mainProgram = "pghero";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.tie ];
};
})

View File

@ -0,0 +1,59 @@
{ lib
, writeShellScript
, git
, nix
, bundler
, bundix
, coreutils
, common-updater-scripts
}:
writeShellScript "update-script" ''
set -eu
PATH=${lib.makeBinPath [
git
nix
bundler
bundix
coreutils
common-updater-scripts
]}
nix() {
command nix --extra-experimental-features nix-command "$@"
}
bundle() {
BUNDLE_FORCE_RUBY_PLATFORM=1 command bundle "$@"
}
attrPath=''${UPDATE_NIX_ATTR_PATH:-pghero}
toplevel=$(git rev-parse --show-toplevel)
position=$(nix eval --file "$toplevel" --raw "$attrPath.meta.position")
gemdir=$(dirname "$position")
cd "$gemdir"
tempdir=$(mktemp -d)
cleanup() {
rc=$?
rm -r -- "$tempdir" || true
exit $rc
}
trap cleanup EXIT
cp gemset.nix "$tempdir"
bundle lock --update --lockfile="$tempdir"/Gemfile.lock
bundix --lockfile="$tempdir"/Gemfile.lock --gemset="$tempdir"/gemset.nix
oldVersion=''${UPDATE_NIX_OLD_VERSION-}
newVersion=$(nix eval --file "$tempdir"/gemset.nix --raw pghero.version)
if [ "$oldVersion" = "$newVersion" ]; then
exit
fi
cp "$tempdir"/{Gemfile.lock,gemset.nix} .
cd "$toplevel"
update-source-version "$attrPath" "$newVersion" --file="$gemdir"/package.nix --ignore-same-hash
''