@cryptotaxi247 / netdata-1 / commits / e588f9608

netdata/packaging: Enable built-in support for prometheus remote write in packaging (#6480)

* netdata/packaging: [ci skip] Add prometheus remote write plugin deps * netdata/packaging: [ci skip] adjust for the tests * netdata/packaging: [ci skip] Apparently we need proto-c too * netdata/packaging: [ci skip] Add dependencies also * netdata/packaging: [ci skip] fix suse dependency * netdata/packaging: [ci skip] epel-release should always go first dumdum * netdata/packaging: [ci skip] g++ needed for prometheus * netdata/packaging: First prepare the repo, then start throwing in packages * netdata/packaging: [ci skip] fix attempt for missing snappy on some debian-based packages * netdata/packaging: [ci skip] protobuf compiler dep * netdata/packaging: [ci skip] Add the generic maintainer info and the new website. Also stop pushing snappy to Debian/Stretch, doesnt have it * netdata/packaging: [ci skip] Remove branch dev setup * Empty commit to re-trigger Travis

Paul Emm. Katsoulakis committed Jul 17, 2019 at 22:22 UTC e588f9608d8e23b001c117a09a39990d001f390f
6 files changed +95 -23
.travis/package_management/common.py
+42 -12
@@ -61,43 +61,73 @@ def run_command_in_host(cmd):
61 print('Error: ' + e.decode('ascii'))
62 print('code: ' + str(proc.returncode))
63
64 -def install_common_dependendencies(container):
64 +def prepare_repo(container):
65 if str(os.environ["REPO_TOOL"]).count("zypper") == 1:
66 run_command(container, [os.environ["REPO_TOOL"], "clean", "-a"])
67 run_command(container, [os.environ["REPO_TOOL"], "--no-gpg-checks", "update", "-y"])
68 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "json-glib-devel"])
69 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "freeipmi-devel"])
70 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "cups-devel"])
68
69 elif str(os.environ["REPO_TOOL"]).count("yum") == 1:
70 run_command(container, [os.environ["REPO_TOOL"], "clean", "all"])
71 run_command(container, [os.environ["REPO_TOOL"], "update", "-y"])
75 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "json-c-devel"])
76 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "freeipmi-devel"])
77 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "cups-devel"])
72
73 if os.environ["BUILD_STRING"].count("el/7") == 1 and os.environ["BUILD_ARCH"].count("i386") == 1:
74 print ("Skipping epel-release install for %s-%s" % (os.environ["BUILD_STRING"], os.environ["BUILD_ARCH"]))
75 else:
76 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "epel-release"])
77 +
78 elif str(os.environ["REPO_TOOL"]).count("apt-get") == 1:
79 run_command(container, [os.environ["REPO_TOOL"], "update", "-y"])
80 + else:
81 + run_command(container, [os.environ["REPO_TOOL"], "update", "-y"])
82 +
83 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "sudo"])
84 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "wget"])
85 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "bash"])
86 +
87 +def install_common_dependendencies(container):
88 + if str(os.environ["REPO_TOOL"]).count("zypper") == 1:
89 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "gcc-c++"])
90 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "json-glib-devel"])
91 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "freeipmi-devel"])
92 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "cups-devel"])
93 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "snappy-devel"])
94 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-devel"])
95 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-c"])
96 +
97 + elif str(os.environ["REPO_TOOL"]).count("yum") == 1:
98 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "gcc-c++"])
99 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "json-c-devel"])
100 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "freeipmi-devel"])
101 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "cups-devel"])
102 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "snappy-devel"])
103 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-devel"])
104 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-c-devel"])
105 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-compiler"])
106 +
107 + elif str(os.environ["REPO_TOOL"]).count("apt-get") == 1:
108 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "g++"])
109 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libipmimonitoring-dev"])
110 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libjson-c-dev"])
111 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libcups2-dev"])
112 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libsnappy-dev"])
113 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libprotobuf-dev"])
114 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libprotoc-dev"])
115 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-compiler"])
116 + if os.environ["BUILD_STRING"].count("debian/jessie") == 1:
117 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "snappy"])
118 else:
119 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "gcc-c++"])
120 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "cups-devel"])
121 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "freeipmi-devel"])
122 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "json-c-devel"])
92 - run_command(container, [os.environ["REPO_TOOL"], "update", "-y"])
123 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "snappy-devel"])
124 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-devel"])
125 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-c-devel"])
126 + run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "protobuf-compiler"])
127
128 if os.environ["BUILD_STRING"].count("el/6") <= 0:
129 run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "autogen"])
130
97 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "sudo"])
98 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "wget"])
99 - run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "bash"])
100 -
131 def prepare_version_source(dest_archive, pkg_friendly_version, tag=None):
132 print(".0 Preparing local implementation tarball for version %s" % pkg_friendly_version)
133 tar_file = os.environ['LXC_CONTAINER_ROOT'] + dest_archive
.travis/package_management/configure_deb_lxc_environment.py
+6 -3
@@ -47,8 +47,8 @@ print("1. Adding user %s" % os.environ['BUILDER_NAME'])
47 common.run_command(container, ["useradd", "-m", os.environ['BUILDER_NAME']])
48
49 # Fetch package dependencies for the build
50 -print("2. Installing package dependencies within LXC container")
51 -common.install_common_dependendencies(container)
50 +print("2. Preparing repo on LXC container")
51 +common.prepare_repo(container)
52
53 print("2.1 Install .DEB build support packages")
54 common.run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "dpkg-dev"])
@@ -62,10 +62,13 @@ print("2.2 Add more dependencies")
62 common.run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libnetfilter-acct-dev"])
63 common.run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libcups2-dev"])
64
65 -print ("3. Run install-required-packages scriptlet")
65 +print ("3.1 Run install-required-packages scriptlet")
66 common.run_command(container, ["wget", "-T", "15", "-O", "%s/.install-required-packages.sh" % build_path, "https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh"])
67 common.run_command(container, ["bash", "%s/.install-required-packages.sh" % build_path, "netdata", "--dont-wait", "--non-interactive"])
68
69 +print("3.2 Installing package dependencies within LXC container")
70 +common.install_common_dependendencies(container)
71 +
72 friendly_version=""
73 dest_archive=""
74 download_url=""
.travis/package_management/configure_rpm_lxc_environment.py
+8 -4
@@ -46,11 +46,15 @@ print("1. Adding user %s" % os.environ['BUILDER_NAME'])
46 common.run_command(container, ["useradd", "-m", os.environ['BUILDER_NAME']])
47
48 # Fetch package dependencies for the build
49 -print("2. Installing package dependencies within LXC container")
50 -common.install_common_dependendencies(container)
49 +print("2.1 Preparing repo on LXC container")
50 +common.prepare_repo(container)
51 +
52 +common.run_command(container, ["wget", "-T", "15", "-O", "/home/%s/.install-required-packages.sh" % (os.environ['BUILDER_NAME']), "https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh"])
53 +common.run_command(container, ["bash", "/home/%s/.install-required-packages.sh" % (os.environ['BUILDER_NAME']), "netdata", "--dont-wait", "--non-interactive"])
54
55 # Exceptional cases, not available everywhere
56 #
57 +print("2.2 Running uncommon dependencies and preparing LXC environment")
58 # Not on Centos-7
59 if os.environ["BUILD_STRING"].count("el/7") <= 0:
60 common.run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "libnetfilter_acct-devel"])
@@ -59,8 +63,8 @@ if os.environ["BUILD_STRING"].count("el/7") <= 0:
63 if os.environ["BUILD_STRING"].count("el/6") <= 0:
64 common.run_command(container, [os.environ["REPO_TOOL"], "install", "-y", "autoconf-archive"])
65
62 -common.run_command(container, ["wget", "-T", "15", "-O", "/home/%s/.install-required-packages.sh" % (os.environ['BUILDER_NAME']), "https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh"])
63 -common.run_command(container, ["bash", "/home/%s/.install-required-packages.sh" % (os.environ['BUILDER_NAME']), "netdata", "--dont-wait", "--non-interactive"])
66 +print("2.3 Installing common dependencies")
67 +common.install_common_dependendencies(container)
68
69 print("3. Setting up macros")
70 common.run_command(container, ["sudo", "-u", os.environ['BUILDER_NAME'], "/bin/echo", "'%_topdir %(echo /home/" + os.environ['BUILDER_NAME'] + ")/rpmbuild' > /home/" + os.environ['BUILDER_NAME'] + "/.rpmmacros"])
contrib/debian/control
+10 -3
@@ -14,17 +14,21 @@ Build-Depends: debhelper (>= 9),
14 libcups2-dev,
15 libipmimonitoring-dev,
16 libnetfilter-acct-dev,
17 + libsnappy-dev,
18 + libprotobuf-dev,
19 + libprotoc-dev,
20 autogen,
21 autoconf,
22 automake,
23 pkg-config,
24 curl,
22 - gcc
25 + gcc,
26 + g++
27 Section: net
28 Priority: optional
25 -Maintainer: Costa Tsaousis <costa@tsaousis.gr>
29 +Maintainer: Netdata Builder <bot@netdata.cloud>
30 Standards-Version: 3.9.6
27 -Homepage: https://github.com/netdata/netdata/wiki
31 +Homepage: https://netdata.cloud
32
33 Package: netdata
34 Architecture: any
@@ -42,6 +46,9 @@ Depends: adduser,
46 cups,
47 freeipmi,
48 libnetfilter-acct1,
49 + libprotobuf-c1,
50 + libsnappy1v5,
51 + libprotoc10,
52 ${misc:Depends},
53 ${shlibs:Depends}
54 Description: real-time charts for system monitoring
contrib/debian/control.jessie
+8 -1
@@ -13,12 +13,16 @@ Build-Depends: debhelper (>= 9),
13 libcups2-dev,
14 libipmimonitoring-dev,
15 libnetfilter-acct-dev,
16 + libsnappy-dev,
17 + libprotobuf-dev,
18 + libprotoc-dev,
19 autogen,
20 autoconf,
21 automake,
22 pkg-config,
23 curl,
21 - gcc
24 + gcc,
25 + g++
26 Section: net
27 Priority: optional
28 Maintainer: Costa Tsaousis <costa@tsaousis.gr>
@@ -40,6 +44,9 @@ Depends: adduser,
44 cups,
45 freeipmi,
46 libnetfilter-acct1,
47 + libprotobuf-c1,
48 + libsnappy1v5,
49 + libprotoc10,
50 ${misc:Depends},
51 ${shlibs:Depends}
52 Description: real-time charts for system monitoring
netdata.spec.in
+21
@@ -92,6 +92,7 @@ URL: http://my-netdata.io
92 # Build dependencies
93 #
94 BuildRequires: gcc
95 +BuildRequires: gcc-c++
96 BuildRequires: make
97 BuildRequires: git
98 BuildRequires: autoconf
@@ -190,6 +191,26 @@ BuildRequires: cups-devel
191 Requires: cups
192 # end - cups plugin dependencies
193
194 +# Prometheus remote write dependencies
195 +BuildRequires: snappy-devel
196 +BuildRequires: protobuf-devel
197 +%if 0%{?suse_version}
198 +BuildRequires: libprotobuf-c-devel
199 +%else
200 +BuildRequires: protobuf-c-devel
201 +%endif
202 +
203 +%if 0%{?suse_version}
204 +Requires: libsnappy1
205 +Requires: protobuf-c
206 +Requires: libprotobuf15
207 +%else
208 +Requires: snappy
209 +Requires: protobuf-c
210 +Requires: protobuf
211 +%endif
212 +# end - prometheus remote write dependencies
213 +
214 # #####################################################################
215 # End of dependency management configuration
216 # #####################################################################