biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / monitoring / openobserve / default.nix
blob59a0d203e2589d7b6998e714f92a24f25ee229f3
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , pkg-config
5 , protobuf
6 , bzip2
7 , oniguruma
8 , sqlite
9 , xz
10 , zlib
11 , zstd
12 , stdenv
13 , apple_sdk
14 , buildNpmPackage
17 let
18   version = "0.9.1";
19   src = fetchFromGitHub {
20     owner = "openobserve";
21     repo = "openobserve";
22     rev = "v${version}";
23     hash = "sha256-AQxSR2cMkNst5YEv4TqVNgdriMsg/0ed5YN4W8qZKxM=";
24   };
25   web = buildNpmPackage {
26     inherit src version;
27     pname = "openobserve-ui";
29     sourceRoot = "${src.name}/web";
31     npmDepsHash = "sha256-c82NLNLfqQrS/jv7ixpLCYDMEUtx6+Mm8cSwvVis2fc=";
33     preBuild = ''
34       # Patch vite config to not open the browser to visualize plugin composition
35       substituteInPlace vite.config.ts \
36         --replace "open: true" "open: false";
37     '';
39     env = {
40       NODE_OPTIONS = "--max-old-space-size=8192";
41       # cypress tries to download binaries otherwise
42       CYPRESS_INSTALL_BINARY = 0;
43     };
45     installPhase = ''
46       runHook preInstall
47       mkdir -p $out/share
48       mv dist $out/share/openobserve-ui
49       runHook postInstall
50     '';
51   };
53 rustPlatform.buildRustPackage {
54   pname = "openobserve";
55   inherit version src;
57   patches = [
58     # prevent using git to determine version info during build time
59     ./build.rs.patch
60   ];
62   preBuild = ''
63     cp -r ${web}/share/openobserve-ui web/dist
64   '';
65   cargoLock = {
66     lockFile = ./Cargo.lock;
67     outputHashes = {
68       "enrichment-0.1.0" = "sha256-FDPSCBkx+DPeWwTBz9+ORcbbiSBC2a8tJaay9Pxwz4w=";
69     };
70   };
72   nativeBuildInputs = [
73     pkg-config
74     protobuf
75   ];
77   buildInputs = [
78     bzip2
79     oniguruma
80     sqlite
81     xz
82     zlib
83     zstd
84   ] ++ lib.optionals stdenv.isDarwin (with apple_sdk.frameworks; [
85     CoreFoundation
86     CoreServices
87     IOKit
88     Security
89     SystemConfiguration
90   ]);
92   env = {
93     RUSTONIG_SYSTEM_LIBONIG = true;
94     ZSTD_SYS_USE_PKG_CONFIG = true;
96     RUSTC_BOOTSTRAP = 1; # uses experimental features
98     # the patched build.rs file sets these variables
99     GIT_VERSION = src.rev;
100     GIT_COMMIT_HASH = "builtByNix";
101     GIT_BUILD_DATE = "1970-01-01T00:00:00Z";
102   };
104   # requires network access or filesystem mutations
105   checkFlags = [
106     "--skip handler::http::auth::tests::test_validate"
107     "--skip handler::http::router::ui::tests::test_index_not_ok"
108     "--skip handler::http::router::ui::tests::test_index_ok"
109     "--skip handler::http::request::search::saved_view::tests::test_create_view_post"
110     "--skip infra::cache::file_list::tests::test_get_file_from_cache"
111     "--skip infra::cache::tmpfs::tests::test_delete_prefix"
112     "--skip infra::cluster::tests::test_get_node_ip"
113     "--skip infra::db::tests::test_delete"
114     "--skip service::alerts::test::test_alerts"
115     "--skip service::compact::merge::tests::test_compact"
116     "--skip service::db::compact::file_list::tests::test_files"
117     "--skip service::db::compact::file_list::tests::test_file_list_offset"
118     "--skip service::db::compact::file_list::tests::test_file_list_process_offset"
119     "--skip service::db::compact::files::tests::test_compact_files"
120     "--skip service::db::user::tests::test_user"
121     "--skip service::ingestion::grpc::tests::test_get_val"
122     "--skip service::organization::tests::test_organization"
123     "--skip service::search::sql::tests::test_sql_full"
124     "--skip service::triggers::tests::test_triggers"
125     "--skip service::users::tests::test_post_user"
126     "--skip service::users::tests::test_user"
127     "--skip common::infra::cache::file_data::disk::tests::test_get_file_from_cache"
128     "--skip common::infra::db::tests::test_get"
129     "--skip common::utils::auth::tests::test_is_root_user2"
130     "--skip tests::e2e_test"
131   ];
133   meta = with lib; {
134     description = "A cloud-native observability platform built specifically for logs, metrics, traces, analytics & realtime user-monitoring";
135     homepage = "https://github.com/openobserve/openobserve";
136     license = licenses.asl20;
137     maintainers = with maintainers; [ happysalada ];
138     mainProgram = "openobserve";
139   };