From 3670fe99b961dc9c4bfc68fb17929f5b545eb7fa Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Wed, 5 Oct 2016 11:44:34 +0100 Subject: [PATCH] Renaming prometheus plugin to volume-count --- .../1-basic-http-server.py | 0 .../2-with-cleanup.py | 0 .../3-plugin-info.py | 0 .../4-static-container-metrics.py | 0 .../5-querying-prometheus.py | 0 examples/plugins/volume-count/Dockerfile | 10 ++++++++++ examples/plugins/volume-count/Makefile | 20 +++++++++++++++++++ .../volume-count.py} | 0 8 files changed, 30 insertions(+) rename examples/plugins/{prometheus => volume-count}/1-basic-http-server.py (100%) rename examples/plugins/{prometheus => volume-count}/2-with-cleanup.py (100%) rename examples/plugins/{prometheus => volume-count}/3-plugin-info.py (100%) rename examples/plugins/{prometheus => volume-count}/4-static-container-metrics.py (100%) rename examples/plugins/{prometheus => volume-count}/5-querying-prometheus.py (100%) create mode 100644 examples/plugins/volume-count/Dockerfile create mode 100644 examples/plugins/volume-count/Makefile rename examples/plugins/{prometheus/6-general.py => volume-count/volume-count.py} (100%) diff --git a/examples/plugins/prometheus/1-basic-http-server.py b/examples/plugins/volume-count/1-basic-http-server.py similarity index 100% rename from examples/plugins/prometheus/1-basic-http-server.py rename to examples/plugins/volume-count/1-basic-http-server.py diff --git a/examples/plugins/prometheus/2-with-cleanup.py b/examples/plugins/volume-count/2-with-cleanup.py similarity index 100% rename from examples/plugins/prometheus/2-with-cleanup.py rename to examples/plugins/volume-count/2-with-cleanup.py diff --git a/examples/plugins/prometheus/3-plugin-info.py b/examples/plugins/volume-count/3-plugin-info.py similarity index 100% rename from examples/plugins/prometheus/3-plugin-info.py rename to examples/plugins/volume-count/3-plugin-info.py diff --git a/examples/plugins/prometheus/4-static-container-metrics.py b/examples/plugins/volume-count/4-static-container-metrics.py similarity index 100% rename from examples/plugins/prometheus/4-static-container-metrics.py rename to examples/plugins/volume-count/4-static-container-metrics.py diff --git a/examples/plugins/prometheus/5-querying-prometheus.py b/examples/plugins/volume-count/5-querying-prometheus.py similarity index 100% rename from examples/plugins/prometheus/5-querying-prometheus.py rename to examples/plugins/volume-count/5-querying-prometheus.py diff --git a/examples/plugins/volume-count/Dockerfile b/examples/plugins/volume-count/Dockerfile new file mode 100644 index 000000000..c31cf3339 --- /dev/null +++ b/examples/plugins/volume-count/Dockerfile @@ -0,0 +1,10 @@ +# Start from weaveworks/scope, so that we have a docker client built in. +FROM python:2 +MAINTAINER Weaveworks Inc +LABEL works.weave.role=system + +RUN pip install docker-py + +# Add our plugin +ADD ./volume-count.py /usr/bin/volume-count.py +ENTRYPOINT ["/usr/bin/volume-count.py"] diff --git a/examples/plugins/volume-count/Makefile b/examples/plugins/volume-count/Makefile new file mode 100644 index 000000000..fe6d9fc28 --- /dev/null +++ b/examples/plugins/volume-count/Makefile @@ -0,0 +1,20 @@ +.PHONY: run clean + +SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E") +EXE=volume-count.py +IMAGE=weavescope-volume-count-plugin +UPTODATE=.$(EXE).uptodate + +run: $(UPTODATE) + $(SUDO) docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /var/run/scope/plugins:/var/run/scope/plugins \ + --name $(IMAGE) $(IMAGE) + +$(UPTODATE): $(EXE) Dockerfile + $(SUDO) docker build -t $(IMAGE) . + touch $@ + +clean: + - rm -rf $(UPTODATE) + - $(SUDO) docker rmi $(IMAGE) diff --git a/examples/plugins/prometheus/6-general.py b/examples/plugins/volume-count/volume-count.py similarity index 100% rename from examples/plugins/prometheus/6-general.py rename to examples/plugins/volume-count/volume-count.py