├── .gitignore ├── .travis.yml ├── LICENSE ├── README.rst ├── Vagrantfile ├── docker ├── Dockerfile ├── database.sql └── init-db.sh ├── docs ├── changes.rst ├── code │ ├── Configuring JDK.md │ ├── Data Manager.md │ ├── Example Service.md │ ├── False data.md │ ├── Headers.md │ ├── RPC Services.md │ ├── Reader.md │ ├── Storage.md │ ├── Varnish API.md │ ├── Varnish Logger.md │ ├── ZipKin and Varnishlog headers.md │ └── ZipKin.md ├── docker.rst ├── examples.rst ├── index.rst ├── tutorial.rst ├── ui.rst └── vcl.rst ├── images ├── service-annotation-view.png ├── service-lookup.png ├── services-drilldown-view.png ├── services-expanded.png ├── system-diagram.pdf ├── system-diagram.png └── system-diagram.svg ├── logreader ├── __init__.py ├── app.py ├── default.cfg ├── log │ ├── __init__.py │ ├── db.py │ ├── log_snapshot.py │ └── parser.py ├── redhat │ ├── el6.spec │ ├── el7.spec │ └── zipnish-logreader.service ├── test │ ├── README.md │ ├── __init__.py │ ├── basic_test.py │ ├── log_test.py │ ├── server.py │ ├── server.yaml │ ├── test_default.vcl │ └── varnishlog.out └── varnishapi.py ├── provisioning ├── ansible.cfg ├── backend.yml ├── build.yml ├── build │ └── ubuntu-vivid64.yml ├── db.yml ├── exampleapp.yml ├── group_vars │ └── all.yml ├── hosts ├── main.yml ├── roles │ ├── apt-transport-https │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── bower │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── exampleapp │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── exampleapp.service.j2 │ │ │ └── process-order │ │ └── vars │ │ │ └── main.yml │ ├── httpie │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── libmysqlclient-dev │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── libpython-dev │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── log-reader │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ └── log-reader.service.j2 │ │ └── vars │ │ │ └── main.yml │ ├── mysql-client │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── mysql-server │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── files │ │ │ └── schema.sql │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ └── mysqld.cnf.j2 │ │ └── vars │ │ │ └── main.yml │ ├── nginx │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── nmap │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── nodejs │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── npm │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── python-mysqldb │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── python-pip │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── python-virtualenv │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── python │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── siege-varnish │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ └── siege-varnish.service.j2 │ │ └── vars │ │ │ └── main.yml │ ├── siege │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── install.yml │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── update-cache │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── vars │ │ │ └── main.yml │ ├── user-interface │ │ ├── README.md │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── meta │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── configure.yml │ │ │ ├── install.yml │ │ │ └── main.yml │ │ ├── templates │ │ │ └── user-interface.service.j2 │ │ └── vars │ │ │ └── main.yml │ └── varnish │ │ ├── README.md │ │ ├── defaults │ │ └── main.yml │ │ ├── handlers │ │ └── main.yml │ │ ├── meta │ │ └── main.yml │ │ ├── tasks │ │ ├── configure.yml │ │ ├── install.yml │ │ └── main.yml │ │ ├── templates │ │ └── default.vcl.j2 │ │ └── vars │ │ └── main.yml └── ui.yml ├── setup.py ├── src └── ui │ ├── .gitignore │ ├── Gruntfile.js │ ├── package.json │ └── scss │ ├── _bootswatch.scss │ ├── _variables.scss │ └── bootstrap.scss └── ui ├── .bowerrc ├── .gitignore ├── README.md ├── app ├── __init__.py ├── aggregate │ ├── __init__.py │ └── views.py ├── api │ ├── __init__.py │ ├── annotations.py │ ├── dependencies.py │ ├── pin.py │ ├── query.py │ ├── services.py │ ├── spans.py │ └── traces.py ├── application │ ├── __init__.py │ └── views.py ├── index │ ├── __init__.py │ └── views.py ├── public │ ├── __init__.py │ └── views.py ├── static │ ├── css │ │ ├── bootstrap.css │ │ ├── main.css │ │ ├── summary.css │ │ ├── trace.css │ │ └── traces.css │ ├── images │ │ └── favicon.png │ └── js │ │ ├── component_data │ │ └── spanNames.js │ │ ├── component_ui │ │ ├── filterAllServices.js │ │ ├── filterLabel.js │ │ ├── fullPageSpinner.js │ │ ├── infoButton.js │ │ ├── infoPanel.js │ │ ├── serviceFilterSearch.js │ │ ├── serviceName.js │ │ ├── spanName.js │ │ ├── spanPanel.js │ │ ├── timeStamp.js │ │ ├── trace.js │ │ ├── traceFilters.js │ │ └── traces.js │ │ ├── main.js │ │ └── page │ │ ├── default.js │ │ └── trace.js ├── templates │ ├── aggregates.mustache │ ├── dialogs │ │ └── information.html │ ├── error.mustache │ ├── forms │ │ └── trace-lookup.html │ ├── index.html │ ├── layout.html │ ├── messages │ │ └── no-results.html │ ├── results │ │ └── traces.html │ ├── trace.html │ └── trace │ │ ├── container.html │ │ ├── dialog.html │ │ ├── header.html │ │ ├── script.html │ │ ├── spans.html │ │ ├── time-labels.html │ │ └── trace.html ├── traces │ ├── __init__.py │ └── views.py └── utils.py ├── bower.json ├── config.py ├── flask_app.py └── redhat ├── zipnish-ui.service └── zipnish-ui.spec /.gitignore: -------------------------------------------------------------------------------- 1 | log-reader/venv 2 | zipnish/venv 3 | ui/venv 4 | node_modules 5 | *.pyc 6 | venv 7 | *.swp 8 | .gitignore 9 | .vagrant 10 | provisioning/facts-cache/ 11 | tmp/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: python 4 | 5 | python: 6 | - "2.7_with_system_site_packages" 7 | 8 | install: 9 | - sudo pip install --upgrade pip 10 | - sudo pip install requests 11 | - sudo pip install mysql-python simplemysql 12 | 13 | services: 14 | - mysql 15 | 16 | env: 17 | global: 18 | - USER=zipnish 19 | - PASS=secret 20 | 21 | before_install: 22 | - curl https://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add - 23 | - echo "deb https://repo.varnish-cache.org/ubuntu/ precise varnish-4.0" | sudo tee /etc/apt/sources.list.d/varnish-cache.list 24 | - sudo apt-get -q update 25 | - sudo apt-get -y install varnish 26 | - sudo apt-get -y install python-dev libmysqlclient-dev 27 | - sudo cp logreader/test/test_default.vcl /etc/varnish/default.vcl 28 | - sudo mkdir -p /var/log/zipnish 29 | - sudo chown -R $(whoami) /var/log/zipnish 30 | - sudo service varnish restart 31 | - echo "CREATE USER '$USER' IDENTIFIED BY '$PASS'" | mysql -u root --default-character-set=utf8 32 | - echo "REVOKE ALL PRIVILEGES ON *.* FROM '$USER'@'%'; FLUSH PRIVILEGES" | mysql -u root --default-character-set=utf8 33 | - echo "GRANT SELECT ON *.* TO '$USER'@'%'; FLUSH PRIVILEGES" | mysql -u root --default-character-set=utf8 34 | - echo "GRANT ALL PRIVILEGES ON *.* TO '$USER'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql -u root --default-character-set=utf8 35 | - mysql -u root < docker/database.sql 36 | - sudo service mysql restart 37 | 38 | before_script: 39 | - pwd 40 | - echo $USER 41 | - echo $PASS 42 | 43 | script: 44 | - cd logreader 45 | - python app.py & 46 | - cd test 47 | - python log_test.py -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Varnish Software AS 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 | SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ####### 2 | Zipnish 3 | ####### 4 | 5 | 6 | A micro-service monitoring tool based on Varnish Cache. 7 | 8 | .. image:: https://travis-ci.org/varnish/zipnish.svg?branch=master 9 | :target: https://travis-ci.org/varnish/zipnish 10 | 11 | .. image:: https://readthedocs.org/projects/zipnish/badge/?version=latest 12 | :target: http://zipnish.readthedocs.io/en/latest/ 13 | 14 | .. image:: https://codebeat.co/badges/4c2b6915-7f30-4208-8095-2afc52de394f 15 | :target: https://codebeat.co/projects/github-com-varnish-zipnish 16 | 17 | .. image:: https://img.shields.io/pypi/v/zipnish.svg 18 | :target: https://pypi.python.org/pypi/zipnish 19 | 20 | * `Documentation `_ 21 | * `Changelog `_ 22 | * `Source `_ 23 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | config.ssh.insert_key = false 3 | config.vm.box = 'ubuntu/vivid64' 4 | 5 | # user interface 6 | config.vm.define 'userinterface' do |userinterface| 7 | userinterface.vm.hostname = 'userinterface' 8 | userinterface.vm.network :private_network, ip: '192.168.75.11' 9 | end 10 | 11 | # database 12 | config.vm.define 'database' do |database| 13 | database.vm.hostname = 'database' 14 | database.vm.network :private_network, ip: '192.168.75.12' 15 | end 16 | 17 | # varnish cache, log reader 18 | config.vm.define 'backend' do |backend| 19 | backend.vm.hostname = 'backend' 20 | backend.vm.network :private_network, ip: '192.168.75.13' 21 | end 22 | 23 | # example application 24 | config.vm.define 'exampleapp' do |exampleapp| 25 | exampleapp.vm.hostname = 'exampleapp' 26 | exampleapp.vm.network :private_network, ip: '192.168.75.14' 27 | end 28 | 29 | # package building machines 30 | 31 | # ubuntu-vivid 64-bit (15.x) 32 | config.vm.define 'build-ubuntu-vivid64' do |ubuntu| 33 | ubuntu.vm.box = 'ubuntu/vivid64' 34 | ubuntu.vm.hostname = 'build-ubuntu-vivid64' 35 | ubuntu.vm.network :private_network, ip: '192.168.75.41' 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | MAINTAINER Marius Magureanu 4 | 5 | RUN export DEBIAN_FRONTEND="noninteractive" 6 | 7 | RUN apt-get update 8 | RUN apt-get upgrade -y 9 | 10 | RUN echo "mariadb-server mariadb-server/root_password password rootpw" | debconf-set-selections 11 | RUN echo "mariadb-server mariadb-server/root_password_again password rootpw" | debconf-set-selections 12 | RUN apt-get -y install mariadb-server-10.0 13 | 14 | ENV user zipnish 15 | ENV password secret 16 | ENV db_script /var/db/database.sql 17 | 18 | ADD ./init-db.sh /usr/local/bin/init-db.sh 19 | ADD ./database.sql /var/db/database.sql 20 | 21 | RUN chmod +x /usr/local/bin/init-db.sh 22 | 23 | EXPOSE 3306 24 | 25 | CMD ["/usr/local/bin/init-db.sh"] 26 | -------------------------------------------------------------------------------- /docker/database.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `microservice` DEFAULT CHARSET=utf8; 2 | 3 | USE `microservice`; 4 | 5 | -- Table structure for table 'zipnish_spans' 6 | -- 7 | 8 | DROP TABLE IF EXISTS `zipnish_spans`; 9 | CREATE TABLE IF NOT EXISTS `zipnish_spans` ( 10 | `span_id` BIGINT NOT NULL, 11 | `parent_id` BIGINT, 12 | `trace_id` BIGINT NOT NULL, 13 | `span_name` VARCHAR(255) NOT NULL, 14 | `debug` SMALLINT NOT NULL, 15 | `duration` BIGINT, 16 | `created_ts` BIGINT 17 | ); 18 | 19 | ALTER TABLE zipnish_spans ADD INDEX(`span_id`); 20 | ALTER TABLE zipnish_spans ADD INDEX(`trace_id`); 21 | ALTER TABLE zipnish_spans ADD INDEX(`span_name`); 22 | ALTER TABLE zipnish_spans ADD INDEX(`created_ts`); 23 | 24 | 25 | -- Table structure for table 'zipnish_annotations' 26 | -- 27 | DROP TABLE IF EXISTS `zipnish_annotations`; 28 | CREATE TABLE `zipnish_annotations` ( 29 | `span_id` BIGINT NOT NULL, 30 | `trace_id` BIGINT NOT NULL, 31 | `span_name` VARCHAR(255) NOT NULL, 32 | `service_name` VARCHAR(255) NOT NULL, 33 | `value` TEXT, 34 | `ipv4` INT, 35 | `port` INT, 36 | `a_timestamp` BIGINT NOT NULL, 37 | `duration` BIGINT 38 | ); 39 | 40 | 41 | ALTER TABLE zipnish_annotations ADD FOREIGN KEY(`span_id`) REFERENCES zipnish_spans(`span_id`) ON DELETE CASCADE; 42 | ALTER TABLE zipnish_annotations ADD INDEX(`trace_id`); 43 | ALTER TABLE zipnish_annotations ADD INDEX(`span_name`); 44 | ALTER TABLE zipnish_annotations ADD INDEX(`a_timestamp`); -------------------------------------------------------------------------------- /docker/init-db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bind_to_localhost() { 4 | cat > /etc/mysql/my.cnf < **update-alternatives --install /usr/bin/java java /home/[username]/java/jdk1.8.0_45/bin/java 1000** Note: name or path to jdk can vary depending on downloaded version. 8 | 6. choose default java version using > **update-alternatives --config java** 9 | 7. Similarly configure javac, > **update-alternatives --install /usr/bin/javac javac /home/[username]/java/jdk1.8.0_45/bin/javac 1000** 10 | 8. If needed configure default javac using, **update-alternatives --config javac** 11 | -------------------------------------------------------------------------------- /docs/code/Data Manager.md: -------------------------------------------------------------------------------- 1 | Data manager comes into play after data has been Read from the shared memory log by [Reader](Reader.md) 2 | 3 | Data manager recieves the following set of fields as argument to it's addLogItem function. 4 | 5 | *VxId, Request Type, Tag, Data* 6 | 7 | Log data for client / backend request is read inside `addLogItem()` function. 8 | 9 | `addLogItem()` is a dictionary (key: value structure). Values are read in based upon tag value. 10 | 11 | Upon encountering `tag == 'End'` logItem is send to [Log Storage](Storage.md) to be recorded. 12 | -------------------------------------------------------------------------------- /docs/code/Example Service.md: -------------------------------------------------------------------------------- 1 | To see how the flow of request take place. Please refer to the [bash script](../script.sh) 2 | -------------------------------------------------------------------------------- /docs/code/Headers.md: -------------------------------------------------------------------------------- 1 | | Tracking Headers | Description | 2 | |---|---| 3 | | X-Varnish | This header is automatically picked up from the Varnish Shared Memory log. | 4 | | X-Varnish-Parent | Parent of a request. Each RPC call must have a X-Varnish-Parent.
It is a copy of X-Varnish header at the parent RPC call level. | 5 | | X-Varnish-Trace | It is used to connect a Request / RPC call to a trace. Each RPC call except the root RPC call will have a X-Varnish-Trace header. | 6 | | X-Varnish-Debug | 0 or 1. For now value doesn't signify anything special. It needs to comply with ZipKin, but we'll probably look int this later. | 7 | 8 | 9 | **Request** 10 | 11 | When a RPC call makes a call to another RPC call down the chain. These headers are passed along *X-Varnish-Trace* and *X-Varnish-Parent*. 12 | 13 | **Response** 14 | 15 | When a RPC call responds. It needs to respond back with *X-Varnish-Trace* and *X-Varnish-Parent* headers, which it received from it's parent call. 16 | -------------------------------------------------------------------------------- /docs/code/RPC Services.md: -------------------------------------------------------------------------------- 1 | All RPC services should be access by a proxy Varnish. 2 | 3 | ***Broad Overview*** 4 | 5 | * Client makes a request to Varnish. 6 | 7 | * Varnish sends request to a RPC service. 8 | 9 | * Varnish gets a response and forwards it to the client. 10 | 11 | 12 | ***Installing Node.js*** 13 | 14 | Installing instructions for node.js can be found on 15 | [https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) 16 | 17 | In short, running below on debian as root will setup Node.js 18 | 19 | ``apt-get install -y nodejs`` 20 | ``curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -`` 21 | 22 | 23 | ***Configuring Services*** 24 | 25 | Changing directory to ``rpc-service`` and running ``npm install`` should setup everything. 26 | 27 | Try the following commands on your command line / bash. 28 | 29 | ``` 30 | > cd rpc-service 31 | > npm install 32 | ``` 33 | 34 | ``npm install`` will install the modules required to run the service. 35 | 36 | ***Creating Services*** 37 | 38 | A generic web-service code is available inside ``rpc-service`` on root. 39 | 40 | Initiate a parent service using Node.js command, 41 | 42 | ``node app.js --port 9000 --address 127.0.0.1 --service 'Parent'`` 43 | 44 | ***Command line parameters*** 45 | 46 | | Name | Value | Status | Example | 47 | | ------------- |-------------| -----|-----|----| 48 | | port | integer > 0 | required | --port 9000 | 49 | | address | ip-address / domain name to a web-service | required | --address 127.0.0.1 | 50 | | service | A string to specify service name to run. | required | --service 'Fetch News' | 51 | | services | A string services to run. ``[service-url]:[Service Name][=>[serial or parallel]:[one or more service url's separated by comma ,]] | required | --service 'Fetch News' | 52 | 53 | 54 | Additionally the [Dummy API](https://github.com/espebra/dummy-api) can also be used. It uses a little different headers subtracting out `Varnish-` from headers. 55 | -------------------------------------------------------------------------------- /docs/code/Reader.md: -------------------------------------------------------------------------------- 1 | Reader is responsible for reading Varnish Shared Memory Log. 2 | 3 | It reads the following fields. 4 | 5 | | Name | Description | 6 | |---|---|---| 7 | | VxID | Unique Varnish Request ID. It is not unique between varnish restarts. | 8 | | Request Type | Request can be (client / backend) | 9 | | Tag | e.g. Begin, End, Link, Timestamp, ReqHeader, RespHeader, BereqHeader, BerespHeader | 10 | | Data | Contains information related to Tag above. | 11 | 12 | 13 | After reading above fields, Reader passes above fields to [Data Manager](Data Manager.md) 14 | -------------------------------------------------------------------------------- /docs/code/Storage.md: -------------------------------------------------------------------------------- 1 | Log Storage processes log items as they are recieved. 2 | 3 | It stores log items by processing and categorizing them internally using (Span and Annotation) arrays. 4 | 5 | Span and Annotation arrays work like a buffer. We can specify the minimal number of items that must be present inside a Span / Annotation array before it's flushed to Storage. 6 | 7 | Current limitations are, 8 | 9 | 10 | |Label|Amount| 11 | |---|---| 12 | | Minimum number of spans before flushing | 2 | 13 | | Minimum number of annotations before flushing | 4 | 14 | -------------------------------------------------------------------------------- /docs/code/Varnish API.md: -------------------------------------------------------------------------------- 1 | ####Current support#### 2 | 3 | Currently we only support Varnish 4.0. 4 | 5 | We use c-types Python Binding from the following link 6 | [https://github.com/xcir/python-varnishapi](https://github.com/xcir/python-varnishapi) 7 | 8 | *LICENSE for above library probably needs to be included somewhere if we choose to distribute:* [https://github.com/xcir/python-varnishapi/blob/master/LICENSE](https://github.com/xcir/python-varnishapi/blob/master/LICENSE) 9 | -------------------------------------------------------------------------------- /docs/code/Varnish Logger.md: -------------------------------------------------------------------------------- 1 | ## Varnish Log Script ## 2 | 3 | For now the script merely checks and prints varnish log headers (key: value pairs). 4 | 5 | Running the varnish logger script. 6 | 7 | > > cd log-reader 8 | 9 | > > python app.py 10 | 11 | 12 | Essentially the following varnishlog should give us required information needed for ZipKin log. 13 | 14 | ``varnishlog -i ReqURL,BereqURL,ReqHeader,BereqHeader,RespHeader,BerespHeader,Timestamp`` 15 | -------------------------------------------------------------------------------- /docs/code/ZipKin and Varnishlog headers.md: -------------------------------------------------------------------------------- 1 | By default varnishlog is grouped by Vxid. 2 | 3 | X-Varnish same as RequestID. Therefore Vxid is unique and can be used as an identifier for trace_id or span_id. 4 | 5 | 6 | 7 | | ZipKin Field | varnishlog Header | 8 | |---|---| 9 | | span_id | Vxid (varnish request id) | 10 | | ipv4 | Host field in (Bereq and Request) | 11 | | port | Host field in (Bereq and Request) | 12 | 13 | 14 | ***Timestamps*** 15 | 16 | **Request** 17 | 18 | | ZipKin Annotation | varnishlog Header | 19 | |---|---| 20 | | cs - client start | Start (client start) | 21 | | cr - client recieve | Resp (client recieve) | 22 | 23 | **Backend Request** 24 | 25 | | ZipKin Annotation | varnishlog Header | 26 | |---|---| 27 | | sr - server recieve | Bereq (backend request) | 28 | | ss - server send | Beresp (backend response) | 29 | 30 | 31 | Can't find parent_id or any kind of reference (X-Forwarded / X-Reference) to connect one request with an parent request. 32 | 33 | Therefore we keep ``parent_id = NULL`` for now. 34 | 35 | We will reuse Vxid inside ``trace_id`` as well. Which will make ``trace_id`` same as ``span_id``. Trace and Span identifiers can be the same as per [ZipKin documentation](http://twitter.github.io/zipkin/Instrumenting.html). 36 | 37 | >**Trace Id** 38 | > 39 | >The overall ID of the trace. Every span in a trace will share this ID. 40 | > 41 | >**Span Id** 42 | > 43 | >The ID for a particular span. This may or may not be the same as the trace id. 44 | -------------------------------------------------------------------------------- /docs/code/ZipKin.md: -------------------------------------------------------------------------------- 1 | ## ZipKin ## 2 | 3 | Running zipkin. 4 | 5 | 1. git clone git@github.com:twitter/zipkin.git 6 | 2. cd zipkin 7 | 3. run zipkin example using > **./bin/sbt "zipkin-example/run -zipkin.storage.anormdb.install=true -zipkin.storage.anormdb.db=sqlite://Users/[USERNAME]/Desktop/zipkin/logger.db -genSampleTraces=true"** 8 | * if you remove **-zipkin.storage.anormdb.db** option, zipkin uses mysql in-memory store. 9 | * if zipkin persistent store is used as in 3. above. Database for it will be found on /Users/[USERNAME]/Desktop/zipkin/logger.db 10 | * if you remove **-genSampleTraces=true** option, zipkin does not generate sample data. 11 | * for mysql - **./bin/sbt "zipkin-example/run -zipkin.storage.anormdb.install=true -zipkin.storage.anormdb.db=mysql://127.0.0.1:3306/zipkin?user=zipkin&password=kinect -genSampleTraces=true"** 12 | * for using mysql change line #273 anormDriverDependencies("sqlite") to anormDriverDependencies("mysql"), this will download mysql-java-connector 13 | 4. Once zipkin is installed and running, you can view the UI on: [http://localhost:8080](http://localhost:8080) 14 | 5. It is loaded with example data, and sqlite in memory database store. 15 | 16 | ## UI ## 17 | 18 | Zipkin UI will be utilized for tracing request paths. UI can be accessed on: [http://localhost:8080](http://localhost:8080) 19 | 20 | #### Request Tracking #### 21 | 22 | - Trace 23 | 24 | Represents a request path, contains one or more spans. 25 | 26 | - Span represents an RPC. It has, 27 | 28 | - **spanId** representing itself. 29 | - **parentId** representing parent spanId. Absense means it's the rootSpan. A point from where trace starts. 30 | - **traceId** linking it to the trace. 31 | - one or more **annotations** 32 | 33 | - Annotation 34 | - Marks an occurance in time. 35 | - cs = time when client made the request. 36 | - sr = time when server recieved the request. 37 | - ss = time when server sent the response. 38 | - cr = time when client recieved the response. 39 | 40 | cs -> sr -> ss -> cr 41 | 42 | - cr marks the end of an RPC call. 43 | 44 | - **Binary Annotations** are time independent and provides extra information about an RPC. 45 | 46 | Each of the id's are randomly generated and are 64-bits long. **traceId** is only generated once and can be the same as the initial **spanId**. 47 | 48 | On the same RPC **spanId** is re-used during cs / sr / ss / cr (see above). 49 | 50 | Making RPC call downstream will require a newly generated **spanId**. Each downstream call made will have a **spanId** from the RPC caller, it's called **parentId** 51 | 52 | Each downstream RPC call will inherit **spanId** RPC call initiater. 53 | 54 | Additional headers e.g. **Sampled** value either 0 or 1 is passed. **Sampled** allows RPC call to determine if it should record trace information (1) or not (0). Pre-assuming the flag values, 1 and 0 as yes and no. 55 | -------------------------------------------------------------------------------- /docs/docker.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | Docker 3 | ====== 4 | 5 | Unless you have a MySql instance at hand, this_ Ubuntu based image will spawn a Mariadb instance. This instance will be the one used by both the logreader and the ui. Check the IP of your docker setup and update the zipnish.cfg accordingly. 6 | 7 | The image relies on two extra files: ``database.sql`` and ``init-db.sh``. Both these files are available in the ``/docker`` folder within the zipnish source code. The two extra files are responsible for the creation and initialisation of an user and db tables that Zipnish will use further down the line. Browse to this folder and run the following commands: 8 | 9 | .. _this: https://hub.docker.com/r/mariusm/ubuntu-mariadb/ 10 | 11 | .. code-block:: sh 12 | 13 | $ docker pull mariusm/ubuntu-mariadb 14 | $ docker run -d -p 3306:3306 mariusm/ubuntu-mariadb 15 | 16 | 17 | A database and db user with the following credentials will be available, if you're going to use this db instance, make sure that zipnish.cfg reflects these settings: 18 | 19 | **user** = zipnish 20 | 21 | **pass** = secret 22 | 23 | **db_name** = microservice 24 | 25 | 26 | To quickly check that the container is up and running, you can connect to it directly with a Mysql client. 27 | Retrieve the IP of your docker setup and connect to the mariadb instance as follows: 28 | 29 | .. code-block:: sh 30 | 31 | $ mysql -u zipnish -h "your docker ip" --paswword=secret 32 | 33 | On a MacOs machine you can simply run the following command: 34 | 35 | .. code-block:: sh 36 | 37 | $ mysql -u zipnish -h $(boot2docker ip) --password=secret 38 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Zipnish 3 | ======= 4 | 5 | Microservice monitoring tool based on Varnish-Cache_. Currently it only supports Varnish 4. 6 | Zipnish piggybacks the VSL_ and stores a bunch of data in a similar way as Zipkin_ does. 7 | 8 | There is a log-reader component responsible for fetching data from VSL_ and having it stored into a MySql database, 9 | furthermore there is an available UI that will display in a hierachical manner all requests going 10 | through varnish to your services. Both of these components share the same MySql instance. 11 | 12 | .. _VSL: https://www.varnish-cache.org/docs/4.0/reference/vsl.html 13 | .. _Zipkin: http://zipkin.io/ 14 | .. _Varnish-Cache: https://varnish-cache.org/ 15 | 16 | Prerequisites 17 | ============= 18 | 19 | Following packages are required for running Zipnish: 20 | 21 | * simplemysql 22 | * flask 23 | * sqlalchemy 24 | * flask_sqlalchemy 25 | * mysql-python 26 | 27 | Installation 28 | ============ 29 | 30 | Install with pip:: 31 | 32 | $ sudo pip install zipnish 33 | 34 | Configuration 35 | ============= 36 | 37 | A configuration file found at ``/etc/zipnish/zipnish.cfg`` is required with a structure as described below: 38 | 39 | .. code-block:: sh 40 | 41 | [Database] 42 | # Db settings for the MySql connection. 43 | 44 | # MySql host 45 | host = 192.168.59.103 46 | 47 | # Database name 48 | db_name = microservice 49 | 50 | # User name 51 | user = zipnish 52 | 53 | # Password 54 | pass = secret 55 | 56 | # Connection keep-alive 57 | keep_alive = true 58 | 59 | [Cache] 60 | # Defines which cache to fetch logs from. 61 | # Name of the cache (same value sent via the -n argument) 62 | # name = demo 63 | 64 | [Log] 65 | # Path to the daemon logfile. 66 | log_file = /var/log/zipnish/zipnish.log 67 | 68 | # Valid log_levels are: DEBUG, INFO, WARNING, ERROR 69 | log_level = DEBUG 70 | 71 | For convenience purposes, there is a docker image available which handles setting up Mariadb database along with a test user. 72 | 73 | Run Zipnish 74 | =========== 75 | 76 | Considering that your Varnish instance is properly configured in relation to your services, after installing Zipnish 77 | there are two commands available: 78 | 79 | Run the logreader:: 80 | 81 | $ zipnish-logreader 82 | 83 | 84 | Run the ui (by default port 5000):: 85 | 86 | $ zipnish-ui 87 | 88 | Contents: 89 | 90 | 91 | .. toctree:: 92 | :maxdepth: 1 93 | 94 | ui 95 | vcl 96 | docker 97 | examples 98 | tutorial 99 | changes 100 | -------------------------------------------------------------------------------- /docs/ui.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | Zipnish UI 3 | ========== 4 | 5 | 6 | Zipnish UI is a Flask based app meant to give an overview of the timestamps handled by the logreader. 7 | 8 | **Screenshots:** 9 | 10 | 11 | Lookup 12 | 13 | .. image:: ../images/service-lookup.png 14 | 15 | Search Results 16 | 17 | .. image:: ../images/services-drilldown-view.png 18 | 19 | Annotations 20 | 21 | .. image:: ../images/service-annotation-view.png 22 | -------------------------------------------------------------------------------- /docs/vcl.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | VCL how to's 3 | ============ 4 | 5 | In order for Zipnish to grab its required headers there are a few changes that are required in your VCL_. There are two 6 | main scenarios to be handled here: 7 | 8 | .. _VCL: http://www.varnish-cache.org/docs/4.0/reference/vcl.html 9 | 10 | 1. Caching disabled: 11 | 12 | .. code-block:: sh 13 | 14 | vcl 4.0; 15 | 16 | backend DemoMicroservice { 17 | .host = "127.0.0.1"; 18 | .port = "9999"; 19 | } 20 | 21 | # disable caching - see further down for another example with caching enabled 22 | sub vcl_recv { 23 | if (req.url ~ "^/DemoService") { 24 | set req.backend_hint = DemoMicroservice; 25 | return (pass); 26 | } 27 | } 28 | 29 | 2. Caching enabled: 30 | 31 | .. code-block:: sh 32 | 33 | vcl 4.0; 34 | 35 | backend DemoMicroservice { 36 | .host = "127.0.0.1"; 37 | .port = "9999"; 38 | } 39 | 40 | # disable caching - see further down for another example with caching enabled 41 | sub vcl_recv { 42 | if (req.url ~ "^/DemoService") { 43 | set req.backend_hint = DemoMicroservice; 44 | } 45 | } 46 | 47 | sub vcl_deliver { 48 | # add the response headers if this is a cache hit 49 | if (obj.hits > 0) { 50 | if (req.http.x-varnish-trace) { 51 | set resp.http.x-varnish-trace = req.http.x-varnish-trace; 52 | } else { 53 | set resp.http.x-varnish-trace = req.http.x-varnish; 54 | } 55 | set resp.http.x-varnish-parent = req.http.x-varnish; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /images/service-annotation-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/service-annotation-view.png -------------------------------------------------------------------------------- /images/service-lookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/service-lookup.png -------------------------------------------------------------------------------- /images/services-drilldown-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/services-drilldown-view.png -------------------------------------------------------------------------------- /images/services-expanded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/services-expanded.png -------------------------------------------------------------------------------- /images/system-diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/system-diagram.pdf -------------------------------------------------------------------------------- /images/system-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/images/system-diagram.png -------------------------------------------------------------------------------- /logreader/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/logreader/__init__.py -------------------------------------------------------------------------------- /logreader/default.cfg: -------------------------------------------------------------------------------- 1 | ## 2 | ## Zipnish daemon configuration. 3 | ## 4 | 5 | [Database] 6 | # Db settings for the MySql connection. 7 | 8 | # MySql host 9 | # host = 192.168.59.103 10 | host = 127.0.0.1 11 | 12 | # Database name 13 | db_name = microservice 14 | 15 | # User name 16 | user = zipnish 17 | 18 | # Password 19 | pass = secret 20 | 21 | # Connection keep-alive 22 | keep_alive = true 23 | 24 | # Truncate tables 25 | truncate_tables = false 26 | 27 | 28 | [Cache] 29 | # Defines which cache to fetch logs from. 30 | 31 | # Name of the cache (same value sent via the -n argument) 32 | # name = demo 33 | 34 | 35 | [Sync] 36 | # Sleep time when while asking for varnish log. (in seconds). 37 | splay = 0.5 38 | 39 | 40 | [Log] 41 | # Path to the daemon logfile. 42 | log_file = /var/log/zipnish/zipnish.log 43 | 44 | # Valid log_levels are: DEBUG, INFO, WARNING, ERROR 45 | log_level = DEBUG 46 | -------------------------------------------------------------------------------- /logreader/log/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/logreader/log/__init__.py -------------------------------------------------------------------------------- /logreader/log/log_snapshot.py: -------------------------------------------------------------------------------- 1 | URL_TAGS = ['ReqURL', 'BereqURL'] 2 | HEADER_TAGS = ['ReqHeader', 'RespHeader', 'BereqHeader', 'BerespHeader'] 3 | 4 | 5 | class Snapshot(object): 6 | 7 | def __init__(self): 8 | self.log_snapshot = dict() 9 | self.callbacks = [] 10 | 11 | def add_callback_func(self, func): 12 | self.callbacks.append(func) 13 | 14 | def fill_snapshot(self, vxid, request_type, tag, data): 15 | if tag == 'Begin': 16 | self.log_snapshot.clear() 17 | self.log_snapshot['begin'] = data 18 | elif tag == 'End': 19 | self.log_snapshot['request_type'] = request_type 20 | self.__on_snapshot_ready() 21 | self.log_snapshot.clear() 22 | 23 | if tag in URL_TAGS: 24 | self.log_snapshot['span_name'] = data.rstrip('\x00') 25 | elif tag == 'Link': 26 | value = data.split(" ")[1] 27 | self.log_snapshot['link'] = value 28 | elif tag == 'Timestamp': 29 | ts = data.rstrip('\x00').split(" ") 30 | assert len(ts) == 4 31 | 32 | ts_name_tag = ts[0].rstrip(":") 33 | ts_abs_tag = "timestamp-%s-%s" % ("abs", ts_name_tag) 34 | ts_duration_tag = "timestamp-%s-%s" % ("duration", ts_name_tag) 35 | self.log_snapshot[ts_abs_tag] = ts[1] 36 | self.log_snapshot[ts_duration_tag] = ts[3] 37 | elif tag in HEADER_TAGS: 38 | header_info = data.rstrip('\x00').split(": ") 39 | header_name = header_info[0].lower() 40 | header_value = header_info[1].rsplit()[0] 41 | 42 | if header_name == 'x-varnish': 43 | self.log_snapshot['span_id'] = header_value 44 | elif header_name == 'x-varnish-trace': 45 | self.log_snapshot['trace_id'] = header_value 46 | elif header_name == 'x-varnish-parent': 47 | self.log_snapshot['parent_id'] = header_value 48 | elif header_name == 'x-varnish-debug': 49 | self.log_snapshot['debug'] = header_value 50 | elif header_name == 'host': 51 | ipv4 = header_value 52 | port = 0 53 | if ":" in header_value: 54 | value = header_value.split(":") 55 | ipv4 = value[0] 56 | port = value[1] 57 | 58 | self.log_snapshot['ipv4'] = ipv4 59 | self.log_snapshot['port'] = port 60 | 61 | def __on_snapshot_ready(self): 62 | for func in self.callbacks: 63 | if func: 64 | func(self.log_snapshot.copy()) 65 | -------------------------------------------------------------------------------- /logreader/redhat/el6.spec: -------------------------------------------------------------------------------- 1 | Name: zipnish-logreader 2 | Summary: Zipnish LogReader service for fetching Varnishlog data. 3 | Release: 1%{?dist} 4 | Group: Application/Tools 5 | License: GPL 6 | Version: 1.0 7 | Vendor: Varnish Software 8 | Source0: %{expand:%%(pwd)} 9 | URL: https://www.varnish-software.com/ 10 | BuildRequires: python-virtualenv 11 | Requires(pre): /usr/sbin/useradd, /usr/bin/getent 12 | Requires(post): /sbin/chkconfig 13 | 14 | %description 15 | This package provides zipnish-logreader, a daemon that plugs 16 | into varnishlog and reads required time information 17 | for spans and annotations. 18 | 19 | %define __pip_cmd pip 20 | %define __python_cmd python2.7 21 | 22 | %prep 23 | mkdir -p %{_builddir}/var/log/zipnish/ 24 | mkdir -p %{_builddir}/etc/zipnish/ 25 | mkdir -p %{_builddir}/opt/zipnish/logreader/log/ 26 | mkdir -p %{_builddir}/usr/lib/systemd/system/ 27 | mkdir -p %{_builddir}/etc/init.d/ 28 | 29 | cp %{SOURCEURL0}/logreader/default.cfg %{_builddir}/etc/zipnish/zipnish.cfg 30 | cp %{SOURCEURL0}/logreader/app.py %{_builddir}/opt/zipnish/logreader/app.py 31 | cp %{SOURCEURL0}/logreader/varnishapi.py %{_builddir}/opt/zipnish/logreader/varnishapi.py 32 | cp -r %{SOURCEURL0}/logreader/log/*.py %{_builddir}/opt/zipnish/logreader/log/ 33 | 34 | cp %{SOURCEURL0}/logreader/redhat/zipnish-logreader.service %{_builddir}/usr/lib/systemd/system/zipnish-logreader.service 35 | 36 | # Build virtual environment 37 | virtualenv %{_builddir}/opt/zipnish/logreader/venv 38 | 39 | # Replace symlinks in the venv to decouple it from the system python, which 40 | # may differ from the system python we're using in our build environment. 41 | source %{_builddir}/opt/zipnish/logreader/venv/bin/activate 42 | export PATH="$PATH:%{_builddir}/opt/zipnish/logreader/venv/bin" 43 | 44 | 45 | %{__python_cmd} %{_builddir}/opt/zipnish/logreader/venv/bin/pip install simplemysql==1.0 46 | %{__python_cmd} %{_builddir}/opt/zipnish/logreader/venv/bin/pip list 47 | 48 | virtualenv --relocatable %{_builddir}/opt/zipnish/logreader/venv 49 | 50 | # Fix broken --relocateable option which does not fix the VIRTUAL_ENV setting of the activate script 51 | sed -i 's|%{_builddir}/opt/zipnish/logreader/venv|/opt/zipnish/logreader/venv|g' %{_builddir}/opt/zipnish/logreader/venv/bin/activate 52 | 53 | %install 54 | rm -rf %{buildroot} 55 | cp -r %{_builddir} %{buildroot} 56 | exit 0 57 | 58 | 59 | %files 60 | %defattr(-,root,root,-) 61 | %config(noreplace) /etc/zipnish/zipnish.cfg 62 | %attr(0755,zipnish,zipnish) /var/log/zipnish/ 63 | %attr(0755,root,root) /opt/zipnish/logreader/ 64 | %attr(0755,root,root) /usr/lib/systemd/system/zipnish-logreader.service 65 | 66 | %pre 67 | # Create user and group 68 | /usr/bin/getent group zipnish > /dev/null || /usr/sbin/groupadd -r zipnish 69 | /usr/bin/getent passwd zipnish > /dev/null || /usr/sbin/useradd -r -g zipnish -d /opt/zipnish/logreader -s /sbin/nologin zipnish 70 | 71 | %clean 72 | rm -rf %{_builddir} 73 | -------------------------------------------------------------------------------- /logreader/redhat/zipnish-logreader.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Zipnish logreader service (varnish 4.0) 3 | 4 | [Service] 5 | Type=forking 6 | ExecStart=/bin/bash -c 'source /opt/zipnish/logreader/venv/bin/activate; /opt/zipnish/logreader/app.py &' 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | -------------------------------------------------------------------------------- /logreader/test/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/logreader/test/README.md -------------------------------------------------------------------------------- /logreader/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/logreader/test/__init__.py -------------------------------------------------------------------------------- /logreader/test/log_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from multiprocessing import Process 3 | from unittest import TestCase 4 | 5 | import requests 6 | import sys 7 | 8 | from server import ( 9 | ServerHandler, 10 | ThreadedHTTPServer, 11 | get_total_sleep_time, 12 | load_yaml_config, 13 | trace_urls, 14 | ) 15 | from simplemysql import SimpleMysql 16 | 17 | 18 | # Port to be used by the test server. 19 | PORT = 9999 20 | 21 | # Host used be the test server. 22 | # Do note that for the test to work, it is required 23 | # that the test server is set as a backend 24 | # in your vcl configuration 25 | HOST = 'localhost' 26 | 27 | # The port where varnish is exposed. 28 | VARNISH_PORT = 6081 29 | 30 | __DB_PARAMS__ = { 31 | 'host': '127.0.0.1', 32 | 'db': 'microservice', 33 | 'user': 'zipnish', 34 | 'passwd': 'secret' 35 | } 36 | 37 | 38 | def start_server(): 39 | server = ThreadedHTTPServer((HOST, PORT), ServerHandler) 40 | server.serve_forever() 41 | 42 | 43 | def run_sql(query, *args): 44 | db = SimpleMysql(**__DB_PARAMS__) 45 | db.query(query, args) 46 | db.commit() 47 | db.conn.close() 48 | 49 | 50 | def get_timestamp(timestamp_order): 51 | ts = 0 52 | db = SimpleMysql(**__DB_PARAMS__) 53 | cursor = db.query("select created_ts from zipnish_spans " 54 | "order by created_ts %s limit 1" % timestamp_order) 55 | 56 | if cursor.rowcount: 57 | ts = cursor.fetchone()[0] 58 | else: 59 | print "No timestamp found, default to 0." 60 | cursor.close() 61 | db.conn.close() 62 | return ts 63 | 64 | 65 | class LogReaderTestCase(TestCase): 66 | 67 | def setUp(self): 68 | run_sql("DELETE FROM zipnish_annotations") 69 | run_sql("DELETE FROM zipnish_spans") 70 | 71 | def test_serial_call_response_times(self): 72 | load_yaml_config() 73 | self.assertEqual(1, len(trace_urls)) 74 | 75 | total_sleep_time = int(get_total_sleep_time() * 1000) 76 | server_process = Process(target=start_server) 77 | server_process.start() 78 | 79 | req_url = "http://%s:%s%s" % (HOST, VARNISH_PORT, trace_urls[0]) 80 | requests.get(req_url) 81 | 82 | server_process.join(timeout=1) 83 | server_process.terminate() 84 | 85 | max = get_timestamp("DESC") 86 | min = get_timestamp("ASC") 87 | 88 | delta = (max - min) / 1000 89 | self.assertAlmostEqual(delta, total_sleep_time, delta=100) 90 | 91 | 92 | if __name__ == '__main__': 93 | unittest.main() 94 | -------------------------------------------------------------------------------- /logreader/test/server.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | traces: 3 | - trace: 4 | - url: /api/articles 5 | - span: /api/auth 6 | - span: /api/titles 7 | - span: /api/images 8 | - span: /api/correct 9 | - span: /api/compose -------------------------------------------------------------------------------- /logreader/test/test_default.vcl: -------------------------------------------------------------------------------- 1 | # 2 | # This is an example VCL file for Varnish. 3 | # 4 | # It does not do anything by default, delegating control to the 5 | # builtin VCL. The builtin VCL is called when there is no explicit 6 | # return statement. 7 | # 8 | # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ 9 | # and http://varnish-cache.org/trac/wiki/VCLExamples for more examples. 10 | 11 | # Marker to tell the VCL compiler that this VCL has been adapted to the 12 | # new 4.0 format. 13 | vcl 4.0; 14 | 15 | # Default backend definition. Set this to point to your content server. 16 | backend default { 17 | .host = "127.0.0.1"; 18 | .port = "9999"; 19 | } 20 | 21 | sub vcl_recv { 22 | return(pass); 23 | } -------------------------------------------------------------------------------- /logreader/test/varnishlog.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/logreader/test/varnishlog.out -------------------------------------------------------------------------------- /provisioning/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = hosts 3 | remote_user = vagrant 4 | host_key_checking = false 5 | private_key_file = ~/.vagrant.d/insecure_private_key 6 | 7 | gathering = smart 8 | fact_caching = jsonfile 9 | fact_caching_connection = facts-cache 10 | fact_caching_timeout = 86400 -------------------------------------------------------------------------------- /provisioning/backend.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Backend 3 | hosts: backend 4 | sudo: yes 5 | roles: 6 | - update-cache 7 | - libpython-dev 8 | - libmysqlclient-dev 9 | - python 10 | - python-virtualenv 11 | - python-mysqldb 12 | - { 13 | role: python-pip, 14 | virtualenv: '/vagrant/logreader/venv', 15 | requirements: '/vagrant/logreader/requirements.txt' 16 | } 17 | - apt-transport-https 18 | - varnish 19 | - siege 20 | - siege-varnish 21 | - log-reader -------------------------------------------------------------------------------- /provisioning/build.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: build/ubuntu-vivid64.yml -------------------------------------------------------------------------------- /provisioning/build/ubuntu-vivid64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Build for ubuntu-vivid 15.x 64-bit 3 | hosts: build-ubuntu-vivid64 4 | sudo: yes 5 | tasks: 6 | - name: update apt-cache 7 | apt: 8 | update_cache: yes 9 | cache_valid_time: 3600 10 | 11 | - name: install requirements for building debian package 12 | apt: 13 | name: "{{ item }}" 14 | with_items: 15 | - gnupg 16 | - packaging-dev 17 | - pbuilder 18 | - debootstrap 19 | - ubuntu-dev-tools 20 | - bzr-builddeb 21 | - apt-file 22 | - build-essential 23 | - devscripts 24 | - debhelper 25 | - dh-make 26 | - bzr-builddeb 27 | 28 | - name: make zipkin-ui tar.gz 29 | shell: 'tar czvf zipnish-ui.tar.gz /vagrant/ui/' 30 | args: 31 | creates: ~/zipnish-ui.tar.gz 32 | chdir: ~/ 33 | 34 | - name: run dh-make 35 | shell: 'bzr dh-make zipnish-ui 0.1 zipnish-ui.tar.gz' 36 | args: 37 | chdir: ~/ 38 | 39 | - name: remove support for emacs and example files 40 | shell: 'rm -f *ex *EX' 41 | args: 42 | chdir: ~/zipnish-ui/debian 43 | 44 | - name: build the debian package 45 | shell: 'bzr builddeb -- -us -uc' 46 | args: 47 | chdir: ~/zipnish-ui/debian 48 | -------------------------------------------------------------------------------- /provisioning/db.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Database 3 | hosts: db 4 | sudo: yes 5 | roles: 6 | - update-cache 7 | - nmap 8 | - python-mysqldb 9 | - mysql-server 10 | -------------------------------------------------------------------------------- /provisioning/exampleapp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Example Application 3 | hosts: exampleapp 4 | sudo: yes 5 | roles: 6 | - update-cache 7 | - httpie 8 | - nodejs 9 | - { 10 | role: npm, 11 | path: /vagrant/rpc-service/ 12 | } 13 | - exampleapp -------------------------------------------------------------------------------- /provisioning/group_vars/all.yml: -------------------------------------------------------------------------------- 1 | --- 2 | servers: 3 | ui: 4 | ip: 192.168.75.11 5 | port: 9000 6 | 7 | db: 8 | ip: 192.168.75.12 9 | port: 3306 10 | host: '%' 11 | database: microservice 12 | username: microservice 13 | password: WqPv5fBSLgnskM7 14 | 15 | backend: 16 | ip: 192.168.75.13 17 | port: 6081 18 | 19 | exampleapp: 20 | ip: 192.168.75.14 21 | port: 9000 22 | -------------------------------------------------------------------------------- /provisioning/hosts: -------------------------------------------------------------------------------- 1 | [ui] 2 | 192.168.75.11 3 | 4 | [db] 5 | 192.168.75.12 6 | 7 | [backend] 8 | 192.168.75.13 9 | 10 | [exampleapp] 11 | 192.168.75.14 12 | 13 | [build-ubuntu-vivid64] 14 | 192.168.75.41 -------------------------------------------------------------------------------- /provisioning/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - include: db.yml 4 | - include: backend.yml 5 | - include: exampleapp.yml 6 | - include: ui.yml 7 | -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for apt-transport-https 3 | -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for apt-transport-https 3 | -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install apt-transport-https 3 | apt: 4 | name: apt-transport-https 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for apt-transport-https 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/apt-transport-https/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for apt-transport-https 3 | -------------------------------------------------------------------------------- /provisioning/roles/bower/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/bower/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for bower 3 | -------------------------------------------------------------------------------- /provisioning/roles/bower/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for bower 3 | -------------------------------------------------------------------------------- /provisioning/roles/bower/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/bower/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: get directory listing for app/static/libs/ 3 | file: 4 | path: "{{ path }}/app/static/libs" 5 | state: directory 6 | 7 | - name: get directory listing for app/static/libs/ 8 | command: "ls {{ path }}/app/static/libs" 9 | register: bower_libs 10 | 11 | - name: install bower dependencies 12 | sudo: no 13 | when: bower_libs.stdout == "" 14 | bower: 15 | path: "{{ path }}" 16 | state: present -------------------------------------------------------------------------------- /provisioning/roles/bower/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install bower 3 | npm: 4 | name: bower 5 | global: yes 6 | state: present 7 | -------------------------------------------------------------------------------- /provisioning/roles/bower/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for bower 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/bower/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for bower 3 | -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for exampleapp 3 | -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for exampleapp 3 | - name: restart exampleapp 4 | service: 5 | name: exampleapp 6 | state: restarted -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install exampleapp into systemd 3 | template: 4 | force: yes 5 | mode: 0751 6 | src: exampleapp.service.j2 7 | dest: /etc/systemd/system/exampleapp.service 8 | notify: 9 | - restart exampleapp -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for exampleapp 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/templates/exampleapp.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Example application 3 | 4 | [Service] 5 | WorkingDirectory=/vagrant/rpc-service/ 6 | ExecStart= /usr/local/bin/node app.js \ 7 | --port {{ servers.exampleapp.port }} --address {{ servers.exampleapp.ip }} \ 8 | --proxy-port {{ servers.backend.port }} --proxy-address {{ servers.backend.ip }} {% include 'process-order' %} -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/templates/process-order: -------------------------------------------------------------------------------- 1 | --services '/process-order:Process Order=>serial:/fetch-customer,/fetch-products,/get-payment-information' \ 2 | --services '/fetch-customer:Fetch Customer' \ 3 | --services '/fetch-products:Fetch Products=>serial:/fetch-product' \ 4 | --services '/fetch-product:Fetch Product' \ 5 | --services '/get-payment-information:Get Payment Information=>serial:/validate-credit-card,/verify-credit-card' \ 6 | --services '/validate-credit-card:Validate Credit Card' \ 7 | --services '/verify-credit-card:Verify Credit Card=>serial:/approve-payment' \ 8 | --services '/approve-payment:Approve Payment=>parallel:/update-inventory,/update-order-status,/send-order-email,/update-order-shipping-status' \ 9 | --services '/update-inventory:Update Inventory' \ 10 | --services '/update-order-status:Update Order Status' \ 11 | --services '/send-order-email:Send Order Email' \ 12 | --services '/update-order-shipping-status:Update Order Shipping Status' -------------------------------------------------------------------------------- /provisioning/roles/exampleapp/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for exampleapp 3 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for httpie 3 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for httpie 3 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpie 3 | apt: 4 | name: httpie 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/httpie/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for httpie 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/httpie/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for httpie 3 | -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for libmysqlclient-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for libmysqlclient-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install libmysqlclient-dev 3 | apt: 4 | name: libmysqlclient-dev 5 | state: present -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for libmysqlclient-dev 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/libmysqlclient-dev/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for libmysqlclient-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for libpython-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for libpython-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install libpython-dev 3 | apt: 4 | name: libpython-dev 5 | state: present -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for libpython-dev 3 | - include: install.yml 4 | -------------------------------------------------------------------------------- /provisioning/roles/libpython-dev/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for libpython-dev 3 | -------------------------------------------------------------------------------- /provisioning/roles/log-reader/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/log-reader/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for log-reader 3 | -------------------------------------------------------------------------------- /provisioning/roles/log-reader/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for log-reader 3 | - name: restart log-reader 4 | service: 5 | name: log-reader 6 | state: restarted -------------------------------------------------------------------------------- /provisioning/roles/log-reader/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/log-reader/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install log-reader service into systemd 3 | template: 4 | force: yes 5 | mode: 0751 6 | src: log-reader.service.j2 7 | dest: /etc/systemd/system/log-reader.service 8 | notify: 9 | - restart log-reader -------------------------------------------------------------------------------- /provisioning/roles/log-reader/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for log-reader 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/log-reader/templates/log-reader.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Log reader service (varnish 4.0) 3 | 4 | [Service] 5 | WorkingDirectory=/vagrant/log-reader/ 6 | ExecStart= /vagrant/log-reader/venv/bin/python /vagrant/log-reader/app.py -------------------------------------------------------------------------------- /provisioning/roles/log-reader/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for log-reader 3 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for mysql-client 3 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for mysql-client 3 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql-client 3 | apt: 4 | name: mysql-client 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for mysql-client 3 | - include: install.yml 4 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-client/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for mysql-client 3 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for mysql-server 3 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/files/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS zipnish_spans ( 2 | span_id BIGINT NOT NULL, 3 | parent_id BIGINT, 4 | trace_id BIGINT NOT NULL, 5 | span_name VARCHAR(255) NOT NULL, 6 | debug SMALLINT NOT NULL, 7 | duration BIGINT, 8 | created_ts BIGINT 9 | ); 10 | 11 | ALTER TABLE zipnish_spans ADD INDEX(span_id); 12 | ALTER TABLE zipnish_spans ADD INDEX(trace_id); 13 | ALTER TABLE zipnish_spans ADD INDEX(span_name(64)); 14 | ALTER TABLE zipnish_spans ADD INDEX(created_ts); 15 | 16 | CREATE TABLE IF NOT EXISTS zipnish_annotations ( 17 | span_id BIGINT NOT NULL, 18 | trace_id BIGINT NOT NULL, 19 | span_name VARCHAR(255) NOT NULL, 20 | service_name VARCHAR(255) NOT NULL, 21 | value TEXT, 22 | ipv4 INT, 23 | port INT, 24 | a_timestamp BIGINT NOT NULL, 25 | duration BIGINT 26 | ); 27 | 28 | ALTER TABLE zipnish_annotations ADD FOREIGN KEY(span_id) REFERENCES zipnish_spans(span_id) ON DELETE CASCADE; 29 | ALTER TABLE zipnish_annotations ADD INDEX(trace_id); 30 | ALTER TABLE zipnish_annotations ADD INDEX(span_name(64)); 31 | ALTER TABLE zipnish_annotations ADD INDEX(value(64)); 32 | ALTER TABLE zipnish_annotations ADD INDEX(a_timestamp); 33 | 34 | CREATE TABLE IF NOT EXISTS zipnish_binary_annotations ( 35 | span_id BIGINT NOT NULL, 36 | trace_id BIGINT NOT NULL, 37 | span_name VARCHAR(255) NOT NULL, 38 | service_name VARCHAR(255) NOT NULL, 39 | annotation_key VARCHAR(255) NOT NULL, 40 | annotation_value MEDIUMBLOB, /* 16MB */ 41 | annotation_type_value INT NOT NULL, 42 | ipv4 INT, 43 | port INT, 44 | annotation_ts BIGINT 45 | ); 46 | 47 | ALTER TABLE zipnish_binary_annotations ADD FOREIGN KEY(span_id) REFERENCES zipnish_spans(span_id) ON DELETE CASCADE; 48 | ALTER TABLE zipnish_binary_annotations ADD INDEX(trace_id); 49 | ALTER TABLE zipnish_binary_annotations ADD INDEX(span_name(64)); 50 | ALTER TABLE zipnish_binary_annotations ADD INDEX(annotation_key(64)); 51 | ALTER TABLE zipnish_binary_annotations ADD INDEX(annotation_value(64)); 52 | ALTER TABLE zipnish_binary_annotations ADD INDEX(annotation_key(64),annotation_value(64)); 53 | ALTER TABLE zipnish_binary_annotations ADD INDEX(annotation_ts); 54 | 55 | CREATE TABLE IF NOT EXISTS zipnish_dependencies ( 56 | dlid BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 57 | start_ts BIGINT NOT NULL, 58 | end_ts BIGINT NOT NULL 59 | ); 60 | 61 | CREATE TABLE IF NOT EXISTS zipnish_dependency_links ( 62 | dlid BIGINT NOT NULL, 63 | parent VARCHAR(255) NOT NULL, 64 | child VARCHAR(255) NOT NULL, 65 | m0 BIGINT NOT NULL, 66 | m1 DOUBLE PRECISION NOT NULL, 67 | m2 DOUBLE PRECISION NOT NULL, 68 | m3 DOUBLE PRECISION NOT NULL, 69 | m4 DOUBLE PRECISION NOT NULL 70 | ); -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for mysql-server 3 | - name: restart mysql-server 4 | service: 5 | name: mysql 6 | state: restarted 7 | 8 | # import schema.sql on database creation 9 | - name: import schema.sql 10 | mysql_db: 11 | state: import 12 | name: "{{ servers.db.database }}" 13 | target: ~/schema.sql -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: copy schema.sql into ~/schema.sql 3 | copy: 4 | src: schema.sql 5 | dest: ~/schema.sql 6 | mode: 0600 7 | 8 | - name: create database 9 | mysql_db: 10 | name: "{{ servers.db.database }}" 11 | state: present 12 | notify: 13 | - import schema.sql 14 | 15 | - name: create user for database 16 | mysql_user: 17 | host: "{{ servers.db.host }}" 18 | name: "{{ servers.db.username }}" 19 | password: "{{ servers.db.password }}" 20 | priv: "{{ servers.db.database }}.*:ALL" 21 | state: present 22 | 23 | - name: ensure mysql daemon is started 24 | service: 25 | name: mysql 26 | state: started 27 | 28 | - name: configure mysql daemon (mysqld.cnf) 29 | template: 30 | src: mysqld.cnf.j2 31 | dest: /etc/mysql/mysql.conf.d/mysqld.cnf 32 | notify: 33 | - restart mysql-server -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql-server 3 | apt: 4 | name: mysql-server 5 | state: present -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for mysql-server 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/mysql-server/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for mysql-server 3 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for nginx 3 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for nginx 3 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install nginx 3 | apt: 4 | name: nginx 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/nginx/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for nginx 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/nginx/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for nginx 3 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for nmap 3 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for nmap 3 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install nmap 3 | apt: 4 | name: nmap 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for nmap 3 | - include: install.yml 4 | -------------------------------------------------------------------------------- /provisioning/roles/nmap/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for nmap 3 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for nodejs 3 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for nodejs 3 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: link nodejs to node 3 | file: 4 | state: link 5 | src: /usr/bin/nodejs 6 | dest: /usr/local/bin/node -------------------------------------------------------------------------------- /provisioning/roles/nodejs/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install nodejs 3 | apt: 4 | name: nodejs 5 | state: present 6 | update_cache: yes 7 | -------------------------------------------------------------------------------- /provisioning/roles/nodejs/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for nodejs 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/nodejs/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for nodejs 3 | -------------------------------------------------------------------------------- /provisioning/roles/npm/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/npm/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for npm 3 | -------------------------------------------------------------------------------- /provisioning/roles/npm/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for npm 3 | -------------------------------------------------------------------------------- /provisioning/roles/npm/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/npm/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install npm dependencies 3 | when: path is defined 4 | npm: 5 | path: "{{ path }}" -------------------------------------------------------------------------------- /provisioning/roles/npm/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install npm 3 | apt: 4 | name: npm 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/npm/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for npm 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/npm/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for npm 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for python-mysqldb 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for python-mysqldb 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-mysqldb 3 | apt: 4 | name: python-mysqldb 5 | state: present -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for python-mysqldb 3 | - include: install.yml 4 | -------------------------------------------------------------------------------- /provisioning/roles/python-mysqldb/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for python-mysqldb 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for python-pip 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for python-pip 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install requirements.txt 3 | pip: 4 | virtualenv: "{{ virtualenv }}" 5 | requirements: "{{ requirements }}" 6 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-pip 3 | apt: 4 | name: python-pip 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/python-pip/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for python-pip 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/python-pip/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for python-pip 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for python-virtualenv 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for python-virtualenv 3 | -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-virtualenv 3 | apt: 4 | name: python-virtualenv 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for python-virtualenv 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/python-virtualenv/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for python-virtualenv 3 | -------------------------------------------------------------------------------- /provisioning/roles/python/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/python/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for python 3 | -------------------------------------------------------------------------------- /provisioning/roles/python/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for python 3 | -------------------------------------------------------------------------------- /provisioning/roles/python/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/python/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python 3 | apt: 4 | name: python2.7 5 | state: present -------------------------------------------------------------------------------- /provisioning/roles/python/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for python 3 | - include: install.yml 4 | -------------------------------------------------------------------------------- /provisioning/roles/python/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for python 3 | -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for siege-varnish 3 | -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for siege-varnish 3 | - name: restart siege-varnish 4 | service: 5 | name: siege-varnish 6 | state: restarted -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for siege-varnish 3 | - name: install siege-varnish service into systemd 4 | template: 5 | force: yes 6 | mode: 0751 7 | src: siege-varnish.service.j2 8 | dest: /etc/systemd/system/siege-varnish.service 9 | notify: 10 | - restart siege-varnish 11 | -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for siege-varnish 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/templates/siege-varnish.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run siege on varnish {{ servers.backend.ip }}:{{ servers.backend.port }}/process-order 3 | 4 | [Service] 5 | ExecStart=/usr/bin/siege -t 1H -c 1 -d 1 {{ servers.backend.ip }}:{{ servers.backend.port }}/process-order -------------------------------------------------------------------------------- /provisioning/roles/siege-varnish/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for siege-varnish 3 | -------------------------------------------------------------------------------- /provisioning/roles/siege/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/siege/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for siege 3 | -------------------------------------------------------------------------------- /provisioning/roles/siege/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for siege 3 | -------------------------------------------------------------------------------- /provisioning/roles/siege/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/siege/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install siege 3 | apt: 4 | name: siege 5 | state: present 6 | -------------------------------------------------------------------------------- /provisioning/roles/siege/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for siege 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/siege/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for siege 3 | -------------------------------------------------------------------------------- /provisioning/roles/update-cache/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/update-cache/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for update-cache 3 | -------------------------------------------------------------------------------- /provisioning/roles/update-cache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for update-cache 3 | -------------------------------------------------------------------------------- /provisioning/roles/update-cache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for update-cache 3 | - name: update cache 4 | apt: 5 | update_cache: yes 6 | cache_valid_time: 3600 -------------------------------------------------------------------------------- /provisioning/roles/update-cache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for update-cache 3 | -------------------------------------------------------------------------------- /provisioning/roles/user-interface/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/user-interface/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for user-interface 3 | -------------------------------------------------------------------------------- /provisioning/roles/user-interface/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for user-interface 3 | - name: restart user-interface 4 | service: 5 | name: user-interface 6 | state: restarted -------------------------------------------------------------------------------- /provisioning/roles/user-interface/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /provisioning/roles/user-interface/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install user-interface service into systemd 3 | template: 4 | mode: 0751 5 | src: user-interface.service.j2 6 | dest: /etc/systemd/system/user-interface.service 7 | notify: 8 | - restart user-interface -------------------------------------------------------------------------------- /provisioning/roles/user-interface/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for user-interface 3 | - include: install.yml -------------------------------------------------------------------------------- /provisioning/roles/user-interface/templates/user-interface.service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=User interface service daemon (run python flask app) 3 | 4 | [Service] 5 | WorkingDirectory=/vagrant/ui/ 6 | Environment=APP_CONFIG=development DB_NAME={{ servers.db.database }} DB_USER={{ servers.db.username }} DB_PASS={{ servers.db.password }} DB_HOST={{ servers.db.ip }} DB_PORT={{ servers.db.port }} 7 | ExecStart= /vagrant/ui/venv/bin/python /vagrant/ui/manage.py runserver --port {{ servers.ui.port }} --host {{ servers.ui.ip }} --reload -------------------------------------------------------------------------------- /provisioning/roles/user-interface/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for user-interface 3 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for varnish 3 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for varnish 3 | - name: restart varnish 4 | service: 5 | name: varnish 6 | state: restarted 7 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: your name 4 | description: 5 | company: your company (optional) 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | # Some suggested licenses: 10 | # - BSD (default) 11 | # - MIT 12 | # - GPLv2 13 | # - GPLv3 14 | # - Apache 15 | # - CC-BY 16 | license: license (GPLv2, CC-BY, etc) 17 | min_ansible_version: 1.2 18 | # 19 | # Below are all platforms currently available. Just uncomment 20 | # the ones that apply to your role. If you don't see your 21 | # platform on this list, let us know and we'll get it added! 22 | # 23 | #platforms: 24 | #- name: EL 25 | # versions: 26 | # - all 27 | # - 5 28 | # - 6 29 | # - 7 30 | #- name: GenericUNIX 31 | # versions: 32 | # - all 33 | # - any 34 | #- name: Fedora 35 | # versions: 36 | # - all 37 | # - 16 38 | # - 17 39 | # - 18 40 | # - 19 41 | # - 20 42 | # - 21 43 | # - 22 44 | #- name: Windows 45 | # versions: 46 | # - all 47 | # - 2012R2 48 | #- name: SmartOS 49 | # versions: 50 | # - all 51 | # - any 52 | #- name: opensuse 53 | # versions: 54 | # - all 55 | # - 12.1 56 | # - 12.2 57 | # - 12.3 58 | # - 13.1 59 | # - 13.2 60 | #- name: Amazon 61 | # versions: 62 | # - all 63 | # - 2013.03 64 | # - 2013.09 65 | #- name: GenericBSD 66 | # versions: 67 | # - all 68 | # - any 69 | #- name: FreeBSD 70 | # versions: 71 | # - all 72 | # - 8.0 73 | # - 8.1 74 | # - 8.2 75 | # - 8.3 76 | # - 8.4 77 | # - 9.0 78 | # - 9.1 79 | # - 9.1 80 | # - 9.2 81 | #- name: Ubuntu 82 | # versions: 83 | # - all 84 | # - lucid 85 | # - maverick 86 | # - natty 87 | # - oneiric 88 | # - precise 89 | # - quantal 90 | # - raring 91 | # - saucy 92 | # - trusty 93 | # - utopic 94 | # - vivid 95 | #- name: SLES 96 | # versions: 97 | # - all 98 | # - 10SP3 99 | # - 10SP4 100 | # - 11 101 | # - 11SP1 102 | # - 11SP2 103 | # - 11SP3 104 | #- name: GenericLinux 105 | # versions: 106 | # - all 107 | # - any 108 | #- name: Debian 109 | # versions: 110 | # - all 111 | # - etch 112 | # - jessie 113 | # - lenny 114 | # - squeeze 115 | # - wheezy 116 | # 117 | # Below are all categories currently available. Just as with 118 | # the platforms above, uncomment those that apply to your role. 119 | # 120 | #categories: 121 | #- cloud 122 | #- cloud:ec2 123 | #- cloud:gce 124 | #- cloud:rax 125 | #- clustering 126 | #- database 127 | #- database:nosql 128 | #- database:sql 129 | #- development 130 | #- monitoring 131 | #- networking 132 | #- packaging 133 | #- system 134 | #- web 135 | dependencies: [] 136 | # List your role dependencies here, one per line. 137 | # Be sure to remove the '[]' above if you add dependencies 138 | # to this list. 139 | 140 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: configure varnish 3 | template: 4 | force: yes 5 | src: default.vcl.j2 6 | dest: /etc/varnish/default.vcl 7 | notify: 8 | - restart varnish -------------------------------------------------------------------------------- /provisioning/roles/varnish/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: add varnish cache apt-key 3 | apt_key: 4 | url: https://repo.varnish-cache.org/GPG-key.txt 5 | state: present 6 | 7 | - name: add varnish-cache repository 8 | apt_repository: 9 | repo: 'deb https://repo.varnish-cache.org/ubuntu/ trusty varnish-4.0' 10 | state: present 11 | 12 | - name: install varnish-cache 13 | apt: 14 | name: varnish 15 | update_cache: yes 16 | -------------------------------------------------------------------------------- /provisioning/roles/varnish/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for varnish 3 | - include: install.yml 4 | - include: configure.yml -------------------------------------------------------------------------------- /provisioning/roles/varnish/templates/default.vcl.j2: -------------------------------------------------------------------------------- 1 | vcl 4.0; 2 | 3 | backend default { 4 | .host = "{{ servers.exampleapp.ip }}"; 5 | .port = "{{ servers.exampleapp.port }}"; 6 | } 7 | 8 | sub vcl_recv { 9 | return (pass); 10 | } 11 | 12 | sub vcl_backend_response { 13 | } 14 | 15 | sub vcl_deliver { 16 | } -------------------------------------------------------------------------------- /provisioning/roles/varnish/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for varnish 3 | -------------------------------------------------------------------------------- /provisioning/ui.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: User Interface 3 | hosts: ui 4 | sudo: yes 5 | roles: 6 | - update-cache 7 | - mysql-client 8 | - libmysqlclient-dev 9 | - libpython-dev 10 | - python 11 | - python-virtualenv 12 | - python-mysqldb 13 | - { 14 | role: python-pip, 15 | virtualenv: '/vagrant/ui/venv', 16 | requirements: '/vagrant/ui/requirements.txt' 17 | } 18 | - nodejs 19 | - npm 20 | - { 21 | role: bower, 22 | path: /vagrant/ui/ 23 | } 24 | - user-interface 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from setuptools import setup, find_packages 4 | 5 | if sys.version_info < (2, 7): 6 | sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') 7 | 8 | 9 | def read(filename): 10 | with open(filename) as f: 11 | return f.read() 12 | 13 | 14 | install_requires = [ 15 | 'simplemysql', 'flask', 'sqlalchemy', 'flask_sqlalchemy', 16 | ] 17 | 18 | setup( 19 | include_package_data=True, 20 | name='zipnish', 21 | version='0.1.5', 22 | description='zipnish', 23 | long_description=read('README.rst'), 24 | maintainer="Marius Magureanu", 25 | maintainer_email="marius@varnish-software.com", 26 | classifiers=[ 27 | 'Development Status :: 4 - Beta', 28 | 'Intended Audience :: Developers', 29 | 'License :: OSI Approved :: Apache Software License', 30 | 'Programming Language :: Python :: 2.7', 31 | ], 32 | author='Adeel Shahid, Per Buer, Marius Magureanu', 33 | author_email='marius@varnish-software.com', 34 | url='https://github.com/varnish/zipnish.git', 35 | license='Apache License 2.0', 36 | platforms='Linux', 37 | packages=find_packages(exclude=['logreader.test']), 38 | zip_safe=False, 39 | install_requires=install_requires, 40 | entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 41 | 'zipnish-ui = ui.flask_app:main'], 42 | }, 43 | scripts=[] 44 | ) 45 | -------------------------------------------------------------------------------- /src/ui/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .sass-cache/ 3 | app/static/css/bootstrap.css 4 | -------------------------------------------------------------------------------- /src/ui/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.initConfig({ 4 | pkg: grunt.file.readJSON('package.json'), 5 | 6 | clean: { 7 | bootstrap: ['ui/app/static/css/bootstrap.css'] 8 | }, 9 | 10 | sass: { 11 | dev: { 12 | options: { 13 | compass: true, 14 | sourcemap: 'none', 15 | style: 'expanded' 16 | }, 17 | files: { 18 | '../../ui/app/static/css/bootstrap.css': 'scss/bootstrap.scss' 19 | } 20 | }, 21 | 22 | dist: { 23 | options: { 24 | compass: true, 25 | sourcemap: 'none', 26 | style: 'compressed' 27 | }, 28 | files: { 29 | '../../ui/app/static/css/bootstrap.css': 'scss/bootstrap.scss' 30 | } 31 | } 32 | }, 33 | 34 | watch: { 35 | configFiles: { 36 | files: ['Gruntfile.js'], 37 | options: { 38 | reload: true, 39 | spawn: false, 40 | livereload: true 41 | } 42 | }, 43 | 44 | css: { 45 | files: ['scss/*.scss'], 46 | tasks: ['clean:bootstrap', 'sass:dev'], 47 | options: { 48 | spawn: false, 49 | livereload: true 50 | } 51 | }, 52 | 53 | templates: { 54 | files: ['../../ui/app/templates/*.html'], 55 | options: { 56 | spawn: false, 57 | livereload: true 58 | } 59 | } 60 | } 61 | }); 62 | 63 | // Distribution 64 | grunt.registerTask('dist', ['sass:dist']); 65 | 66 | // Development 67 | grunt.registerTask('dev', ['clean:bootstrap', 'sass:dev']); 68 | 69 | // Load NPM Tasks 70 | grunt.loadNpmTasks('grunt-contrib-clean'); 71 | grunt.loadNpmTasks('grunt-contrib-sass'); 72 | grunt.loadNpmTasks('grunt-contrib-watch'); 73 | grunt.loadNpmTasks('grunt-contrib-livereload'); 74 | 75 | // Default Task 76 | grunt.registerTask('default', ['livereload-start', 'regarde', 'livereload']); 77 | }; 78 | -------------------------------------------------------------------------------- /src/ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vmsm-ui", 3 | "version": "1.0.0", 4 | "description": "Varnish Micro Service Monitor - User Interface", 5 | "main": "Gruntfile.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "vmsm" 11 | ], 12 | "author": "Muhammad Adeel", 13 | "license": "Varnish Software License", 14 | "devDependencies": { 15 | "grunt": "^0.4.5", 16 | "grunt-contrib-clean": "^0.6.0", 17 | "grunt-contrib-sass": "^0.9.2", 18 | "grunt-contrib-watch": "^0.6.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/ui/scss/bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "compass/css3/box-shadow"; 2 | @import "compass/css3/appearance"; 3 | @import "compass/css3/border-radius"; 4 | 5 | @import "variables"; 6 | @import "bootswatch"; 7 | 8 | .navbar { 9 | border-bottom: 1px solid $gray-lighter; 10 | 11 | .navbar-brand { 12 | 13 | font-size: 21px; 14 | line-height: 22px; 15 | color: $gray-dark; 16 | 17 | &:hover { 18 | color: $gray-dark; 19 | } 20 | 21 | img { 22 | height: $navbar-height * 0.95; 23 | margin-top: -$navbar-padding-vertical; 24 | } 25 | } 26 | } 27 | 28 | .well { 29 | border-radius: 0; 30 | @include box-shadow(none); 31 | 32 | .chosen-container-single { 33 | .chosen-single { 34 | line-height: 30px; 35 | border-radius: 0; 36 | 37 | div { 38 | b { 39 | background-position: 0 5px; 40 | } 41 | } 42 | } 43 | } 44 | 45 | .chosen-container-active.chosen-with-drop { 46 | .chosen-single { 47 | div { 48 | b { 49 | background-position: -18px 5px; 50 | } 51 | } 52 | } 53 | } 54 | 55 | select { 56 | @include appearance(none); 57 | @include border-radius(0); 58 | } 59 | 60 | input[type=text] { 61 | @include border-radius(0); 62 | 63 | &.date-input { 64 | text-align: center; 65 | width: 7.5em; 66 | } 67 | 68 | &.time-input { 69 | text-align: center; 70 | width: 5em; 71 | } 72 | 73 | &#limit { 74 | text-align: center; 75 | width: 4em; 76 | } 77 | } 78 | 79 | button { 80 | padding: 5px 12px; 81 | @include border-radius(0); 82 | } 83 | } 84 | 85 | .alert { 86 | font-size: 14px; 87 | padding: 10px 15px; 88 | border-radius: 0; 89 | } 90 | 91 | #infoPanel { 92 | table { 93 | font-size: 14px; 94 | } 95 | } -------------------------------------------------------------------------------- /ui/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "app/static/libs" 3 | } -------------------------------------------------------------------------------- /ui/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | node_modules 3 | app/static/libs/ 4 | #app/static/css/bootstrap.css 5 | 6 | -------------------------------------------------------------------------------- /ui/app/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask_sqlalchemy import SQLAlchemy 3 | 4 | db = SQLAlchemy() 5 | 6 | 7 | def create_app(db_dialect): 8 | 9 | app = Flask(__name__) 10 | app.config['SQLALCHEMY_DATABASE_URI'] = db_dialect 11 | 12 | db.init_app(app) 13 | 14 | # /app 15 | from .application import application as application_blueprint 16 | app.register_blueprint(application_blueprint, url_prefix='/app') 17 | 18 | # /public 19 | from .public import public as public_blueprint 20 | app.register_blueprint(public_blueprint, url_prefix='/public') 21 | 22 | # / 23 | from .index import index as index_blueprint 24 | app.register_blueprint(index_blueprint, url_prefix='/') 25 | 26 | # /traces 27 | from .traces import traces as traces_blueprint 28 | app.register_blueprint(traces_blueprint, url_prefix='/traces') 29 | 30 | # /aggregate 31 | from .aggregate import aggregate as aggregate_blueprint 32 | app.register_blueprint(aggregate_blueprint, url_prefix='/aggregate') 33 | 34 | # /api 35 | from .api import api as api_blueprint 36 | app.register_blueprint(api_blueprint, url_prefix='/api') 37 | 38 | return app 39 | -------------------------------------------------------------------------------- /ui/app/aggregate/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | aggregate = Blueprint('aggregate', __name__) 4 | 5 | from . import views 6 | -------------------------------------------------------------------------------- /ui/app/aggregate/views.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import aggregate 3 | 4 | @aggregate.route('/', methods=['GET']) 5 | def app(): 6 | return '/aggregate' 7 | -------------------------------------------------------------------------------- /ui/app/api/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | api = Blueprint('api', __name__) 4 | 5 | # 6 | # end-points to create 7 | 8 | # query 9 | from . import query 10 | 11 | # services 12 | from . import services 13 | 14 | # spans 15 | from . import spans 16 | 17 | # annotations 18 | from . import annotations 19 | 20 | # dependencies 21 | from . import dependencies 22 | 23 | # traces 24 | from . import traces 25 | 26 | # pin 27 | from . import pin 28 | -------------------------------------------------------------------------------- /ui/app/api/annotations.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/top_annotations') 5 | def top_annotations(): 6 | return '/top_annotations' 7 | 8 | @api.route('/top_kv_annotations') 9 | def top_kv_annotations(): 10 | return '/top_kv_annotations' 11 | -------------------------------------------------------------------------------- /ui/app/api/dependencies.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/dependencies', methods=['GET']) 5 | def dependencies(): 6 | return '/dependencies' 7 | 8 | @api.route('/dependencies//', methods=['GET']) 9 | def dependenciesTimeBound(start_time=None, end_time=None): 10 | return '/dependencies/%s/%s' % (start_time, end_time) 11 | -------------------------------------------------------------------------------- /ui/app/api/pin.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/is_pinned/', methods=['GET']) 5 | def is_pinned(pin_id): 6 | return '/api/is_pinned/%s' % pin_id 7 | 8 | @api.route('/pin//', methods=['GET']) 9 | def pin(pin_id, state): 10 | return '/api/pin/%s/%s' % (pin_id, state) 11 | -------------------------------------------------------------------------------- /ui/app/api/query.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/query') 5 | def query(): 6 | return '/query' 7 | -------------------------------------------------------------------------------- /ui/app/api/services.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/services') 5 | def services(): 6 | return '/services' 7 | -------------------------------------------------------------------------------- /ui/app/api/spans.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from flask import render_template, request, redirect, make_response 4 | 5 | from . import api 6 | from .. import db 7 | 8 | @api.route('/spans', methods=['GET']) 9 | def spans(): 10 | # read GET values 11 | serviceName = request.args.get('serviceName') 12 | 13 | # get database engine connection 14 | connection = db.engine.connect() 15 | 16 | # query for results 17 | spans = [] 18 | spansQuery = "SELECT DISTINCT span_name \ 19 | FROM zipnish_annotations \ 20 | WHERE service_name='%s'" % serviceName 21 | 22 | result = connection.execute(spansQuery) 23 | 24 | for row in result: 25 | spans.append( row['span_name'] ) 26 | 27 | return json.dumps(spans) 28 | -------------------------------------------------------------------------------- /ui/app/api/traces.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import api 3 | 4 | @api.route('/get/') 5 | @api.route('/trace/') 6 | def trace(trace_id): 7 | return '/trace/%s' % trace_id 8 | -------------------------------------------------------------------------------- /ui/app/application/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | application = Blueprint('application', __name__) 4 | 5 | from . import views 6 | -------------------------------------------------------------------------------- /ui/app/application/views.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import application 3 | 4 | @application.route('/', methods=['GET']) 5 | def app(): 6 | return '/app' 7 | -------------------------------------------------------------------------------- /ui/app/index/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | index = Blueprint('index', __name__) 4 | 5 | from . import views 6 | -------------------------------------------------------------------------------- /ui/app/public/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | public = Blueprint('public', __name__) 4 | 5 | from . import views 6 | -------------------------------------------------------------------------------- /ui/app/public/views.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, redirect 2 | from . import public 3 | 4 | @public.route('/', methods=['GET']) 5 | def public(): 6 | return '/public' 7 | -------------------------------------------------------------------------------- /ui/app/static/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .container { 6 | width: 90%; 7 | margin: 0 5%; 8 | } 9 | 10 | .content { 11 | padding-top: 20px; 12 | } 13 | 14 | #annotationQuery { 15 | margin: 5px 0; 16 | } 17 | 18 | .chosen-container .chosen-single { 19 | height: 30px; 20 | } 21 | 22 | .service-filter-label { 23 | cursor: pointer; 24 | } 25 | 26 | #fullPageSpinner { 27 | display: none; 28 | position: absolute; 29 | width: 100%; 30 | height: 100%; 31 | top: 0px; 32 | padding-top: 10%; 33 | background: rgba(256, 256, 256, 0.5); 34 | } 35 | 36 | #fullPageSpinner .progress { 37 | margin-left: 25%; 38 | width: 50%; 39 | } 40 | -------------------------------------------------------------------------------- /ui/app/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varnish/zipnish/85870b20d9885be7c546d4a1d55cd6a8295a1485/ui/app/static/images/favicon.png -------------------------------------------------------------------------------- /ui/app/static/js/component_data/spanNames.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(spanNames); 11 | 12 | function spanNames() { 13 | this.updateSpanNames = function(ev, serviceName) { 14 | $.ajax("/api/spans?serviceName="+serviceName, { 15 | type: "GET", 16 | dataType: "json", 17 | context: this, 18 | success: function(spans) { 19 | this.trigger('dataSpanNames', {spans: spans}); 20 | } 21 | }); 22 | }; 23 | 24 | this.after('initialize', function() { 25 | this.on('uiChangeServiceName', this.updateSpanNames); 26 | }); 27 | } 28 | 29 | } 30 | ); 31 | 32 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/filterAllServices.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(filterAllServices); 11 | 12 | function filterAllServices() { 13 | this.$expandAll = $(); 14 | this.$collapseAll = $(); 15 | this.totalServices = 0; 16 | this.filtered = {}; 17 | this.currentFilterCount = 0; 18 | 19 | this.toggleFilter = function(e) { 20 | this.trigger(document, $(e.target).val()); 21 | }; 22 | 23 | this.filterAdded = function(e, data) { 24 | if (this.filtered[data.value]) return; 25 | 26 | this.filtered[data.value] = true; 27 | this.currentFilterCount += 1; 28 | 29 | if (this.currentFilterCount === this.totalServices) 30 | this.$expandAll.addClass('active'); 31 | else 32 | this.$collapseAll.removeClass('active'); 33 | }; 34 | 35 | this.filterRemoved = function(e, data) { 36 | if (!this.filtered[data.value]) return; 37 | 38 | this.filtered[data.value] = false; 39 | this.currentFilterCount -= 1; 40 | 41 | if (this.currentFilterCount === 0) 42 | this.$collapseAll.addClass('active'); 43 | else 44 | this.$expandAll.removeClass('active'); 45 | }; 46 | 47 | this.after('initialize', function(node, data) { 48 | this.totalServices = data.totalServices; 49 | this.$expandAll = this.$node.find('[value="uiExpandAllSpans"]'); 50 | this.$collapseAll = this.$node.find('[value="uiCollapseAllSpans"]'); 51 | 52 | this.on('.btn', 'click', this.toggleFilter); 53 | this.on(document, 'uiAddServiceNameFilter', this.filterAdded); 54 | this.on(document, 'uiRemoveServiceNameFilter', this.filterRemoved); 55 | }); 56 | } 57 | } 58 | ); 59 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/filterLabel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(filterLabel); 11 | 12 | function filterLabel() { 13 | this.serviceName = ""; 14 | 15 | this.toggleFilter = function() { 16 | var evt = this.$node.is('.service-tag-filtered') ? 17 | 'uiRemoveServiceNameFilter' : 18 | 'uiAddServiceNameFilter'; 19 | this.trigger(evt, {value: this.serviceName}); 20 | }; 21 | 22 | this.filterAdded = function(e, data) { 23 | if (data.value === this.serviceName) 24 | this.$node.addClass('service-tag-filtered'); 25 | }; 26 | 27 | this.filterRemoved = function(e, data) { 28 | if (data.value === this.serviceName) 29 | this.$node.removeClass('service-tag-filtered'); 30 | }; 31 | 32 | this.after('initialize', function() { 33 | this.serviceName = this.$node.data('serviceName'); 34 | this.on('click', this.toggleFilter); 35 | this.on(document, 'uiAddServiceNameFilter', this.filterAdded); 36 | this.on(document, 'uiRemoveServiceNameFilter', this.filterRemoved); 37 | }); 38 | } 39 | } 40 | ); 41 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/fullPageSpinner.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(fullPageSpinner); 11 | 12 | function fullPageSpinner() { 13 | this.requests = 0; 14 | 15 | this.showSpinner = function() { 16 | this.requests += 1; 17 | this.$node.show(); 18 | }; 19 | 20 | this.hideSpinner = function() { 21 | this.requests -= 1; 22 | if (this.requests == 0) 23 | this.$node.hide(); 24 | }; 25 | 26 | this.after('initialize', function() { 27 | this.on(document, 'uiShowFullPageSpinner', this.showSpinner); 28 | this.on(document, 'uiHideFullPageSpinner', this.hideSpinner); 29 | }); 30 | } 31 | } 32 | ); 33 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/infoButton.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(infoButton); 11 | 12 | function infoButton() { 13 | this.requestInfoPanel = function() { 14 | this.trigger('uiRequestInfoPanel'); 15 | }; 16 | 17 | this.after('initialize', function() { 18 | this.on('click', this.requestInfoPanel); 19 | }); 20 | } 21 | 22 | } 23 | ); 24 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/infoPanel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(infoPanel); 11 | 12 | function infoPanel() { 13 | this.show = function() { 14 | this.$node.modal('show'); 15 | }; 16 | 17 | this.after('initialize', function() { 18 | this.$node.modal('hide'); 19 | this.on(document, 'uiRequestInfoPanel', this.show); 20 | }); 21 | } 22 | 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/serviceFilterSearch.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(serviceNameFilter); 11 | 12 | function serviceNameFilter() { 13 | this.onChange = function(e, params) { 14 | if (params.selected === "") return; 15 | 16 | this.trigger(document, 'uiAddServiceNameFilter', {value: params.selected}); 17 | this.$node.val(''); 18 | this.$node.trigger('chosen:updated'); 19 | }; 20 | 21 | this.after('initialize', function() { 22 | this.$node.chosen({search_contains: true}); 23 | this.on('change', this.onChange); 24 | }); 25 | } 26 | 27 | } 28 | ); 29 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/serviceName.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(serviceName); 11 | 12 | function serviceName() { 13 | this.onChange = function() { 14 | $.cookie('last-serviceName', this.$node.val()); 15 | this.triggerChange(this.$node.val()); 16 | }; 17 | 18 | this.triggerChange = function(name) { 19 | this.$node.trigger('uiChangeServiceName', name); 20 | }; 21 | 22 | this.after('initialize', function() { 23 | var lastServiceName = $.cookie('last-serviceName'); 24 | if (this.$node.val() === "" && $.cookie('last-serviceName') !== "") { 25 | this.$node.find('[value="' + lastServiceName + '"]').attr('selected', 'selected'); 26 | this.triggerChange(lastServiceName); 27 | } 28 | 29 | this.$node.chosen({search_contains: true}); 30 | this.on('change', this.onChange); 31 | }); 32 | } 33 | 34 | } 35 | ); 36 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/spanName.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(spanName); 11 | 12 | function spanName() { 13 | this.updateSpans = function(ev, data) { 14 | var html = 15 | "" + 16 | $.map(data.spans, function(span) { 17 | return ""; 18 | }).join(""); 19 | this.$node.html(html); 20 | this.trigger('chosen:updated'); 21 | }; 22 | 23 | this.after('initialize', function() { 24 | this.$node.chosen(); 25 | this.on(document, 'dataSpanNames', this.updateSpans); 26 | }); 27 | } 28 | 29 | } 30 | ); 31 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/spanPanel.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(spanPanel); 11 | 12 | function spanPanel() { 13 | this.$annotationTemplate = null; 14 | this.$binaryAnnotationTemplate = null; 15 | 16 | this.show = function(e, span) { 17 | var self = this; 18 | 19 | this.$node.find('.modal-title').text( 20 | span.serviceName + '.' + span.spanName + ': ' + span.durationStr); 21 | 22 | this.$node.find('.service-names').text(span.serviceNames); 23 | 24 | var $annoBody = this.$node.find('#annotations tbody').text(''); 25 | $.each(span.annotations, function(i, anno) { 26 | var $row = self.$annotationTemplate.clone(); 27 | $row.find('td').each(function() { 28 | var $this = $(this); 29 | $this.text(anno[$this.data('key')]); 30 | }); 31 | $annoBody.append($row); 32 | }); 33 | 34 | var $binAnnoBody = this.$node.find('#binaryAnnotations tbody').text(''); 35 | $.each(span.binaryAnnotations, function(i, anno) { 36 | var $row = self.$binaryAnnotationTemplate.clone(); 37 | $row.find('td').each(function() { 38 | var $this = $(this); 39 | $this.text(anno[$this.data('key')]); 40 | }); 41 | $binAnnoBody.append($row); 42 | }); 43 | 44 | this.$node.modal('show'); 45 | }; 46 | 47 | this.after('initialize', function() { 48 | this.$node.modal('hide'); 49 | this.$annotationTemplate = this.$node.find('#annotations tbody tr').remove(); 50 | this.$binaryAnnotationTemplate = this.$node.find('#binaryAnnotations tbody tr').remove(); 51 | this.on(document, 'uiRequestSpanPanel', this.show); 52 | }); 53 | } 54 | 55 | } 56 | ); 57 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/timeStamp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(timeStamp); 11 | 12 | function timeStamp() { 13 | this.init = function () { 14 | this.$timestamp = this.$node.find("[name=timestamp]"); 15 | this.$date = this.$node.find(".date-input"); 16 | this.$time = this.$node.find(".time-input"); 17 | var ts = this.$timestamp.val(); 18 | this.setDateTime((ts) ? moment(ts / 1000) : moment()); 19 | } 20 | 21 | this.setDateTime = function(time) { 22 | this.$date.val(time.format("DD-MM-YYYY")); 23 | this.$time.val(time.format("HH:mm")); 24 | } 25 | 26 | this.setTimestamp = function(time) { 27 | this.$timestamp.val(time.valueOf() * 1000); 28 | } 29 | 30 | this.dateChanged = function (e) { 31 | this.setTimestamp(moment(e.date)); 32 | } 33 | 34 | this.timeChanged = function () { 35 | var time = moment(this.$date.val(), "DD-MM-YYYY"); 36 | time.add(moment.duration(this.$time.val())); 37 | this.setTimestamp(moment.utc(time)); 38 | } 39 | 40 | this.after('initialize', function () { 41 | this.init(); 42 | this.on(this.$time, "change", this.timeChanged); 43 | this.$date 44 | .datepicker({format: 'dd-mm-yyyy'}) 45 | .on("changeDate", this.dateChanged.bind(this)); 46 | }); 47 | } 48 | } 49 | ); 50 | -------------------------------------------------------------------------------- /ui/app/static/js/component_ui/traceFilters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'flight/lib/component' 6 | ], 7 | 8 | function (defineComponent) { 9 | 10 | return defineComponent(traceFilters); 11 | 12 | function traceFilters() { 13 | this.idFromService = function(service) { 14 | return "service-filter-" + service.replace(/[^a-z0-9\-_]/gi, "-"); 15 | }; 16 | 17 | this.addToFilter = function(ev, data) { 18 | if (this.$node.find("[data-service-name='" + data.value +"']").length) return; 19 | 20 | // TODO: should this be mustache instead? 21 | var $remove = 22 | $('') 23 | .attr('class', 'badge service-filter-remove') 24 | .text('x') 25 | .on('click', function() { $(this).trigger('uiRemoveServiceNameFilter', data) }); 26 | 27 | var $html = 28 | $('') 29 | .attr('class', 'label service-filter-label service-tag-filtered') 30 | .attr('id', this.idFromService(data.value)) 31 | .attr('data-serviceName', data.value) 32 | .text(data.value) 33 | .append($remove); 34 | 35 | this.$node.find('.service-tags').append($html); 36 | }; 37 | 38 | this.removeFromFilter = function(ev, data) { 39 | this.$node.find('#' + this.idFromService(data.value)).remove(); 40 | }; 41 | 42 | this.updateTraces = function(ev, data) { 43 | this.$node.find('.filter-current').text(data.traces.size()); 44 | }; 45 | 46 | this.updateSortOrder = function(ev, data) { 47 | this.trigger(document, 'uiUpdateTraceSortOrder', {order: $(ev.target).val()}); 48 | }; 49 | 50 | this.after('initialize', function() { 51 | this.on(document, 'uiAddServiceNameFilter', this.addToFilter); 52 | this.on(document, 'uiRemoveServiceNameFilter', this.removeFromFilter); 53 | this.on(document, 'uiUpdateTraces', this.updateTraces); 54 | this.on('.sort-order', 'change', this.updateSortOrder); 55 | }); 56 | } 57 | 58 | } 59 | ); 60 | -------------------------------------------------------------------------------- /ui/app/static/js/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Array.prototype.remove = function(from, to) { 4 | var rest = this.slice((to || from) + 1 || this.length); 5 | this.length = from < 0 ? this.length + from : from; 6 | return this.push.apply(this, rest); 7 | }; 8 | 9 | $.extend({ 10 | getUrlVars: function(){ 11 | var vars = [], hash; 12 | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 13 | for(var i = 0; i < hashes.length; i++) 14 | { 15 | hash = hashes[i].split('='); 16 | vars.push(hash[0]); 17 | vars[hash[0]] = hash[1]; 18 | } 19 | return vars; 20 | }, 21 | getUrlVar: function(name){ 22 | return $.getUrlVars()[name]; 23 | } 24 | }); 25 | 26 | requirejs.config({ 27 | baseUrl: '/static/libs', 28 | paths: { 29 | 'component_data': '../js/component_data', 30 | 'component_ui': '../js/component_ui', 31 | 'page': '../js/page' 32 | } 33 | }); 34 | 35 | require( 36 | [ 37 | 'flight/lib/compose', 38 | 'flight/lib/registry', 39 | 'flight/lib/advice', 40 | 'flight/lib/logger', 41 | 'flight/lib/debug' 42 | ], 43 | 44 | function(compose, registry, advice, withLogging, debug) { 45 | debug.enable(true); 46 | compose.mixin(registry, [advice.withAdvice]); 47 | 48 | require( 49 | [ 50 | 'page/default', 51 | 'page/trace', 52 | ], 53 | function( 54 | initializeDefault, 55 | initializeTrace 56 | ) { 57 | initializeDefault(); 58 | initializeTrace(); 59 | } 60 | ); 61 | } 62 | ); 63 | -------------------------------------------------------------------------------- /ui/app/static/js/page/default.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'component_data/spanNames', 6 | 'component_ui/serviceName', 7 | 'component_ui/spanName', 8 | 'component_ui/infoPanel', 9 | 'component_ui/infoButton', 10 | 'component_ui/traceFilters', 11 | 'component_ui/traces', 12 | 'component_ui/timeStamp' 13 | ], 14 | 15 | function ( 16 | SpanNamesData, 17 | ServiceNameUI, 18 | SpanNameUI, 19 | InfoPanelUI, 20 | InfoButtonUI, 21 | TraceFiltersUI, 22 | TracesUI, 23 | TimeStampUI 24 | ) { 25 | 26 | return initialize; 27 | 28 | function initialize() { 29 | SpanNamesData.attachTo(document); 30 | ServiceNameUI.attachTo('#serviceName'); 31 | SpanNameUI.attachTo('#spanName'); 32 | InfoPanelUI.attachTo('#infoPanel'); 33 | InfoButtonUI.attachTo('button.info-request'); 34 | TraceFiltersUI.attachTo('#trace-filters'); 35 | TracesUI.attachTo('#traces'); 36 | TimeStampUI.attachTo('#time-stamp'); 37 | 38 | $('.timeago').timeago(); 39 | } 40 | } 41 | ); 42 | -------------------------------------------------------------------------------- /ui/app/static/js/page/trace.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | define( 4 | [ 5 | 'component_ui/filterAllServices', 6 | 'component_ui/fullPageSpinner', 7 | 'component_ui/serviceFilterSearch', 8 | 'component_ui/spanPanel', 9 | 'component_ui/trace' 10 | ], 11 | 12 | function ( 13 | FilterAllServicesUI, 14 | FullPageSpinnerUI, 15 | ServiceFilterSearchUI, 16 | SpanPanelUI, 17 | TraceUI 18 | ) { 19 | 20 | return initialize; 21 | 22 | function initialize() { 23 | 24 | console.log('trace initialization'); 25 | 26 | FilterAllServicesUI.attachTo('#filterAllServices', {totalServices: $('.trace-details.services span').length}); 27 | FullPageSpinnerUI.attachTo('#fullPageSpinner'); 28 | ServiceFilterSearchUI.attachTo('#serviceFilterSearch'); 29 | SpanPanelUI.attachTo('#spanPanel'); 30 | TraceUI.attachTo('#trace-container'); 31 | 32 | $('.annotation:not(.core)').tooltip({placement: 'left'}); 33 | } 34 | } 35 | ); 36 | -------------------------------------------------------------------------------- /ui/app/templates/aggregates.mustache: -------------------------------------------------------------------------------- 1 |
2 | 3 | 8 | -------------------------------------------------------------------------------- /ui/app/templates/dialogs/information.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ui/app/templates/error.mustache: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
{{errorMsg}}
5 |
6 |
7 | 8 | 13 | -------------------------------------------------------------------------------- /ui/app/templates/forms/trace-lookup.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 19 |
20 | 21 |
22 | 35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |   50 | 51 | 52 |
53 | -------------------------------------------------------------------------------- /ui/app/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block content %} 4 | 5 |
6 | {% include 'forms/trace-lookup.html' %} 7 |
8 | 9 |
10 | {% include 'messages/no-results.html' %} 11 | {% include 'results/traces.html' %} 12 |
13 | 14 | {% include 'dialogs/information.html' %} 15 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /ui/app/templates/messages/no-results.html: -------------------------------------------------------------------------------- 1 | {% if results == None %} 2 |
3 |

Please select the criteria for your trace lookup.

4 |
5 | {% elif results and results|length == 0 %} 6 |
7 |

No traces found for choosen criteria.

8 |
9 | {% endif %} 10 | -------------------------------------------------------------------------------- /ui/app/templates/results/traces.html: -------------------------------------------------------------------------------- 1 | {% if results and results|length > 0 %} 2 | 42 | {% endif %} 43 | -------------------------------------------------------------------------------- /ui/app/templates/trace.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block content %} 4 | 5 | {% include 'trace/header.html' %} 6 | 7 | {% include 'trace/container.html' %} 8 | 9 | {% include 'trace/dialog.html' %} 10 | 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /ui/app/templates/trace/container.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {% include 'trace/time-labels.html' %} 4 | 5 |
6 | 7 | {% include 'trace/script.html' %} 8 | -------------------------------------------------------------------------------- /ui/app/templates/trace/dialog.html: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /ui/app/templates/trace/header.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 |
11 | 12 |
13 |
14 | Duration: {{ '%.3f' | format(totalDuration) }} ms 15 | Spans: {{ totalSpans }} 16 | Services: {{ totalServices }} 17 | Depth: {{ totalDepth }} 18 |
19 |
20 | 21 |
22 | -------------------------------------------------------------------------------- /ui/app/templates/trace/spans.html: -------------------------------------------------------------------------------- 1 | {% for spanId, spanInfo in spans.iteritems() %} 2 |
15 | 16 |
17 |
18 | + 19 | {{ spanInfo['serviceName'] }} 20 |
21 |
22 | 23 |
24 | 25 | {% for item in timeMarkers %} 26 |
.
27 | {% endfor %} 28 | 29 |
30 | 31 | 32 |
33 | {% endfor %} 34 | -------------------------------------------------------------------------------- /ui/app/templates/trace/time-labels.html: -------------------------------------------------------------------------------- 1 |
2 |
Services
3 |
4 | {% for item in timeMarkers %} 5 |
{{ '%.3f' | format(item['time']) }} ms
6 | {% endfor %} 7 |
8 |
9 | -------------------------------------------------------------------------------- /ui/app/traces/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | traces = Blueprint('traces', __name__) 4 | 5 | from . import views 6 | -------------------------------------------------------------------------------- /ui/app/utils.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | def GenerateTraceURLId(idLong): 4 | return hex(idLong) 5 | 6 | def ParseTraceURLId(hexString): 7 | return long(hexString, 16) 8 | 9 | def findChildSpans(parent_id, dictionary): 10 | span_ids = [] 11 | 12 | for key in dictionary: 13 | if key != parent_id and dictionary[key] == parent_id: 14 | span_ids.append(key) 15 | 16 | return span_ids 17 | 18 | 19 | def findSpanDepth(current_depth, selected_span_id, parent_ids, dictionary): 20 | if selected_span_id in parent_ids: 21 | # find all the spans to which current_span is a parent and find the depth of each of them 22 | # selected the highest possible span depth 23 | #return findSpanDepth(current_depth + 1, selected_span_id, parent_ids, dictionary) 24 | childSpans = findChildSpans(selected_span_id, dictionary) 25 | 26 | if len(childSpans) == 0: 27 | return current_depth 28 | 29 | maxDepth = current_depth 30 | for child_span_id in childSpans: 31 | maxDepth = max(maxDepth, findSpanDepth(current_depth + 1, child_span_id, parent_ids, dictionary)) 32 | 33 | return maxDepth 34 | 35 | return current_depth 36 | 37 | def findTraceDepth(dictionary): 38 | parent_ids = [] 39 | span_ids = [] 40 | 41 | root_span_id = None 42 | 43 | for key in dictionary: 44 | if dictionary[key] is None: 45 | root_span_id = key 46 | 47 | if dictionary[key] is not None and dictionary[key] not in parent_ids: 48 | parent_ids.append(dictionary[key]) 49 | 50 | # return 0 depth if we cannot find the root span 51 | if root_span_id is None: 52 | return 0 53 | 54 | return findSpanDepth(1, root_span_id, parent_ids, dictionary) 55 | 56 | def generateTraceTimeMarkers(duration): 57 | timeSeq = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0] 58 | timeMarkers = [] 59 | 60 | for index in range(len(timeSeq)): 61 | timeMarkers.append({ 62 | 'index': index, 63 | 'time': timeSeq[index] * duration 64 | }) 65 | 66 | return timeMarkers 67 | 68 | -------------------------------------------------------------------------------- /ui/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vmsm", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "flight": "~1.1.0", 6 | "requirejs": "~2.1.5", 7 | "bootstrap": "~3.1.1", 8 | "bootstrap-datepicker": "~1.3.0", 9 | "jquery-timeago": "~1.3.1", 10 | "chosen": "https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip", 11 | "jquery-cookie": "~1.4.0", 12 | "momentjs": "~2.5.1", 13 | "underscore": "~1.8.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ui/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | class Config(object): 5 | DEBUG = False 6 | TESTING = False 7 | 8 | DB_HOST = os.environ.get('DB_HOST') 9 | DB_PORT = os.environ.get('DB_PORT') 10 | DB_USER = os.environ.get('DB_USER') 11 | DB_PASS = os.environ.get('DB_PASS') 12 | DB_NAME = os.environ.get('DB_NAME') 13 | 14 | SQLALCHEMY_DATABASE_URI = "mysql+mysqldb://{}:{}@{}:{}/{}".\ 15 | format(DB_USER, DB_PASS, DB_HOST, DB_PORT, DB_NAME) 16 | 17 | @staticmethod 18 | def init_app(app): 19 | pass 20 | 21 | 22 | class ProductionConfig(Config): 23 | pass 24 | 25 | 26 | class DevelopmentConfig(Config): 27 | DEBUG = True 28 | 29 | DB_HOST = os.environ.get('DB_HOST') 30 | DB_PORT = os.environ.get('DB_PORT') 31 | DB_USER = os.environ.get('DB_USER') 32 | DB_PASS = os.environ.get('DB_PASS') 33 | DB_NAME = os.environ.get('DB_NAME') 34 | 35 | SQLALCHEMY_DATABASE_URI = "mysql+mysqldb://{}:{}@{}:{}/{}".\ 36 | format(DB_USER, DB_PASS, DB_HOST, DB_PORT, DB_NAME) 37 | 38 | 39 | class TestingConfig(Config): 40 | TESTING = True 41 | 42 | config = { 43 | 'development': DevelopmentConfig, 44 | 'testing': TestingConfig, 45 | 'production': ProductionConfig, 46 | 47 | 'default': DevelopmentConfig 48 | } 49 | -------------------------------------------------------------------------------- /ui/flask_app.py: -------------------------------------------------------------------------------- 1 | import ConfigParser 2 | 3 | from app import create_app 4 | 5 | 6 | def main(): 7 | etc_config_path = '/etc/zipnish/zipnish.cfg' 8 | config = ConfigParser.ConfigParser() 9 | config.read(etc_config_path) 10 | 11 | host = config.get('Database', 'host') 12 | db = config.get('Database', 'db_name') 13 | user = config.get('Database', 'user') 14 | passwd = config.get('Database', 'pass') 15 | db_port = 3306 16 | 17 | db_dialect = "mysql+mysqldb://{}:{}@{}:{}/{}". \ 18 | format(user, passwd, host, db_port, db) 19 | 20 | app = create_app(db_dialect) 21 | app.run() 22 | 23 | if __name__ == '__main__': 24 | main() 25 | -------------------------------------------------------------------------------- /ui/redhat/zipnish-ui.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Zipnish user interface. 3 | 4 | [Service] 5 | WorkingDirectory=/opt/zipnish/ui 6 | ExecStart=/usr/bin/python /opt/zipnish/ui/app.py 7 | -------------------------------------------------------------------------------- /ui/redhat/zipnish-ui.spec: -------------------------------------------------------------------------------- 1 | Name: zipnish-ui 2 | Summary: Zipnish UI service for visualizing Microservices performance. 3 | Release: 1%{?dist} 4 | Group: Application/Tools 5 | License: GPL 6 | Version: 1.0 7 | Vendor: Varnish Software 8 | Source0: %{expand:%%(pwd)} 9 | URL: https://www.varnish-software.com/ 10 | 11 | 12 | %description 13 | This package provides an user interface for the Zipnish microservice tracker. 14 | 15 | 16 | %prep 17 | mkdir -p %{_builddir}/etc/zipnish/ 18 | mkdir -p %{_builddir}/opt/zipnish/ui/app/ 19 | mkdir -p %{_builddir}/usr/lib/systemd/system/ 20 | mkdir -p %{_builddir}/etc/init.d/ 21 | 22 | cp %{SOURCEURL0}/app.py %{_builddir}/opt/zipnish/ui/app.py 23 | cp %{SOURCEURL0}/config.py %{_builddir}/opt/zipnish/ui/config.py 24 | cp %{SOURCEURL0}/manage.py %{_builddir}/opt/zipnish/ui/manage.py 25 | cp %{SOURCEURL0}/ui.cfg %{_builddir}/etc/zipnish/ui.cfg 26 | cp -r %{SOURCEURL0}/app %{_builddir}/opt/zipnish/ui 27 | 28 | cp %{SOURCEURL0}/redhat/zipnish-ui.service %{_builddir}/usr/lib/systemd/system/zipnish-ui.service 29 | cp %{SOURCEURL0}/redhat/zipnish-ui.service %{_builddir}/etc/init.d/zipnish-ui.service 30 | 31 | 32 | %install 33 | rm -rf %{buildroot} 34 | cp -r %{_builddir} %{buildroot} 35 | exit 0 36 | 37 | 38 | %files 39 | %defattr(-,root,root,-) 40 | %config(noreplace) /etc/zipnish/ui.cfg 41 | %attr(0755,zipnish-ui,zipnish-ui) /opt/zipnish/ui/app 42 | %attr(0755,zipnish-ui,zipnish-ui) /opt/zipnish/ui/app.py 43 | %attr(0755,zipnish-ui,zipnish-ui) /opt/zipnish/ui/config.py 44 | %attr(0755,zipnish-ui,zipnish-ui) /opt/zipnish/ui/manage.py 45 | %attr(0755,root,root) /usr/lib/systemd/system/zipnish-ui.service 46 | %attr(0755,root,root) /etc/init.d/zipnish-ui.service 47 | 48 | %pre 49 | # Create user and group 50 | /usr/bin/getent group zipnish-ui > /dev/null || /usr/sbin/groupadd -r zipnish-ui 51 | /usr/bin/getent passwd zipnish-ui > /dev/null || /usr/sbin/useradd -r -g zipnish-ui -d /opt/zipnish/ui -s /sbin/nologin zipnish-ui 52 | 53 | %clean 54 | rm -rf %{_builddir} --------------------------------------------------------------------------------