From 058502407d0469fbb112b23226a47f15de8068dc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 02:12:49 +0000 Subject: import cadvisor-0.4.1-0.3.git6906a8ce.el7 --- diff --git a/.cadvisor.metadata b/.cadvisor.metadata new file mode 100644 index 0000000..e3af2e0 --- /dev/null +++ b/.cadvisor.metadata @@ -0,0 +1 @@ +b4aacd5ab96718591ac056af4989d2933c883593 SOURCES/cadvisor-6906a8ce.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..286bf77 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/cadvisor-6906a8ce.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/cadvisor b/SOURCES/cadvisor new file mode 100644 index 0000000..8a2c793 --- /dev/null +++ b/SOURCES/cadvisor @@ -0,0 +1,46 @@ +# config options for cAdvisor +# +# + +# Docker endpoint to connect to +# Default: unix:///var/run/docker.sock +CADVISOR_DOCKER_ENDPOINT="unix:///var/run/docker.sock" + +# Port to listen on +# Default: 8080 +# kubernetes expects it on port 4194 +CADVISOR_PORT="4194" + +# Samples +# Number of samples to keep +# Default: 1024 +CADVISOR_SAMPLES="1024" + +# Storage driver +# Default: none/blank +# +# Available Options: +# - [none] +# - bigquery +# - influxdb +CADVISOR_STORAGE_DRIVER="" + +# Storage driver host +# Default: localhost:8086" +CADVISOR_STORAGE_DRIVER_HOST="localhost:8086" + +# Storage driver password +# Default: root +CADVISOR_STORAGE_DRIVER_PASSWORD="root" + +# Storage driver secure connection +# Default: false +CADVISOR_STORAGE_DRIVER_SECURE="false" + +# Storage driver user +# Default: root +CADVISOR_STORAGE_DRIVER_USER="root" + +# Log to stderr (and thus to journal) +# Default: false +CADVISOR_LOG_TO_STDERR="true" diff --git a/SOURCES/cadvisor.service b/SOURCES/cadvisor.service new file mode 100644 index 0000000..c465783 --- /dev/null +++ b/SOURCES/cadvisor.service @@ -0,0 +1,18 @@ +[Unit] +Description=cAdvisor + +[Service] +EnvironmentFile=/etc/sysconfig/cadvisor +ExecStart=/usr/bin/cadvisor \ + --docker=${CADVISOR_DOCKER_ENDPOINT} \ + --port=${CADVISOR_PORT} \ + --samples=${CADVISOR_SAMPLES} \ + --storage_driver=${CADVISOR_STORAGE_DRIVER} \ + --storage_driver_host=${CADVISOR_STORAGE_DRIVER_HOST} \ + --storage_driver_password=${CADVISOR_STORAGE_DRIVER_PASSWORD} \ + --storage_driver_secure=${CADVISOR_STORAGE_DRIVER_SECURE} \ + --storage_driver_user=${CADVISOR_STORAGE_DRIVER_USER} \ + --logtostderr=${CADVISOR_LOG_TO_STDERR} + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/cadvisor.spec b/SPECS/cadvisor.spec new file mode 100644 index 0000000..71f5459 --- /dev/null +++ b/SPECS/cadvisor.spec @@ -0,0 +1,127 @@ +%global provider github +%global provider_tld com +%global project google +%global repo cadvisor +%global commit 6906a8ce90e9f00d6a1a8b7530b83bf083622036 + +%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} +%global gopath %{_datadir}/gocode +%global shortcommit %(c=%{commit}; echo ${c:0:8}) +%global debug_package %{nil} + +Name: %{repo} +Version: 0.4.1 +Release: 0.3.git%{shortcommit}%{?dist} +Summary: Analyzes resource usage and performance characteristics of running containers +License: ASL 2.0 +URL: https://%{import_path} +Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +Source1: cadvisor +Source2: cadvisor.service +#BuildRequires: docker-io-pkg-devel +BuildRequires: systemd +BuildRequires: golang >= 1.2.1-3 +ExclusiveArch: x86_64 + +%description +%{summary} + +cAdvisor (Container Advisor) provides container users an understanding of the +resource usage and performance characteristics of their running containers. +It is a running daemon that collects, aggregates, processes, and exports +information about running containers. Specifically, for each container it keeps +resource isolation parameters, historical resource usage, histograms of +complete historical resource usage and network statistics. This data is +exported by container and machine-wide. + +cAdvisor currently supports lmctfy containers as well as Docker containers +(those that use the default libcontainer execdriver). Other container backends +can also be added. cAdvisor's container abstraction is based on lmctfy's +so containers are inherently nested hierarchically. + + +%prep +%setup -n %{name}-%{commit} -q + +%build +mkdir _build + +pushd _build + mkdir -p src/github.com/google + ln -s $(dirs +1 -l) src/github.com/google/cadvisor +popd + +### FIXME +### Upstream uses this invocation of go build but it fails with the following: +# go build --ldflags '-extldflags "-static"' github.com/google/cadvisor +# # github.com/google/cadvisor +# /usr/bin/ld: cannot find -lpthread +# /usr/bin/ld: cannot find -lc +# collect2: error: ld returned 1 exit status +# /usr/lib/golang/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100 +# +# It *seems* fine without it, but I assume upstream has a reason for doing +# this, however I've yet to get a response on why and if it's necessary. + +GOPATH=$(pwd)/Godeps/_workspace:$(pwd)/_build:%{gopath} go build github.com/google/cadvisor + +%install +# main package binary +install -d -p %{buildroot}%{_bindir} +install -p -m0755 cadvisor %{buildroot}%{_bindir} + +# install systemd/sysconfig +install -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/ +install -p -m0660 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -d -m0755 %{buildroot}%{_unitdir} +install -p -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service + +%check +for dir in client container info manager storage/memory utils/procfs; do + GOPATH=$(pwd)/Godeps/_workspace:$(pwd)/_build:%{gopath} go test github.com/google/cadvisor/$dir +done + +%post +%systemd_post cadvisor.service + +%preun +%systemd_preun cadvisor.service + +%postun +%systemd_postun + +%files +%doc AUTHORS CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS LICENSE README.md +%{_bindir}/cadvisor +%{_unitdir}/%{name}.service +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} + +%changelog +* Mon Oct 06 2014 jchaloup - 0.4.1-0.3.git6906a8ce +- Move cadvisor.service and cadvisor config file from patch into repo + +* Sun Oct 05 2014 Eric Paris - 0.4.1-0.2.git6906a8ce +- Fix cadvisor storage driver since upstream removed 'memory' + +* Wed Oct 01 2014 jchaloup - 0.4.1-0.1.git6906a8ce +- Bump to upstream 6906a8ce90e9f00d6a1a8b7530b83bf083622036 +- remove -devel subpackage +- remove golang dependencies and build with Godeps directory +- adding go test in check section + +* Fri Sep 19 2014 Lokesh Mandvekar - 0.3.0-0.3.git9d158c3 +- own parent directory of +- preserve timestamps of copied files in -devel +- use _unitdir macro for systemd install path + +* Fri Sep 12 2014 Eric Paris - 0.2.0-1 +- First package for Fedora