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