Skip to content
Snippets Groups Projects
Commit 919715c1 authored by Simon Crowle's avatar Simon Crowle
Browse files

Merge branch 'minioService' into 'integration'

Minio service and pytest

See merge request FLAME/flame-clmc!31
parents 0bd926fb f02d45d2
No related branches found
Tags 1.1.0
No related merge requests found
......@@ -121,4 +121,21 @@ hosts:
cpus: 1
memory: 2048
disk: "10GB"
ip_address: "172.40.231.200"
\ No newline at end of file
ip_address: "172.40.231.200"
- name: minio
service_name: "minio"
cpus: 1
memory: 2048
disk: "10GB"
forward_ports:
- guest: 9000
host: 9000
ip_address: "172.40.231.155"
location: "DC1"
sfc_id: "MS_Template_1"
sfc_id_instance: "MS_I1"
sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_minio"
influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics"
\ No newline at end of file
......@@ -34,6 +34,7 @@ from influxdb import InfluxDBClient
('mongo'),
('ffmpeg'),
('host'),
('minio')
])
def test_service_name(telegraf_agent_config, service_name):
assert any(s['name'] == service_name for s in telegraf_agent_config['hosts']), "{0} not in list of hosts".format(service_name)
......@@ -63,7 +64,11 @@ def test_ping(telegraf_agent_config):
('net', 'SELECT mean("bytes_sent") AS "mean" FROM "CLMCMetrics"."autogen"."net"', 0),
('disk', 'SELECT mean("free") AS "mean" FROM "CLMCMetrics"."autogen"."disk"', 0),
('diskio', 'SELECT mean("write_bytes") AS "mean" FROM "CLMCMetrics"."autogen"."diskio"', 0),
('mem', 'SELECT mean("free") AS "mean" FROM "CLMCMetrics"."autogen"."mem"', 0)
('mem', 'SELECT mean("free") AS "mean" FROM "CLMCMetrics"."autogen"."mem"', 0),
# Report MINIO's HTTP request response time (as a rolling difference of the sum total)
('minio_http_requests_duration_seconds', 'SELECT difference(max("sum")) AS "mean" FROM "CLMCMetrics"."autogen"."minio_http_requests_duration_seconds" WHERE time > now() - 1h GROUP BY time(10s)',0),
# Report the average change in difference of MINIO's HTTP response time (the inner query determines a rolling difference between sampling periods [respTimeDiff])
('minio_http_requests_duration_seconds', 'SELECT mean("respTimeDiff") AS "mean" FROM (SELECT difference(max("sum")) AS "respTimeDiff" FROM "CLMCMetrics"."autogen"."minio_http_requests_duration_seconds" WHERE time > now() - 1h GROUP BY time(10s))',0)
])
def test_all_inputs(influxdb, measurement, query, expected_result):
"""
......
#!/bin/bash
#/////////////////////////////////////////////////////////////////////////
#//
#// (c) University of Southampton IT Innovation Centre, 2018
#//
#// Copyright in this software belongs to University of Southampton
#// IT Innovation Centre of Gamma House, Enterprise Road,
#// Chilworth Science Park, Southampton, SO16 7NS, UK.
#//
#// This software may not be used, sold, licensed, transferred, copied
#// or reproduced in whole or in part in any manner or form or in or
#// on any media by any person other than in accordance with the terms
#// of the Licence Agreement supplied with the software, or otherwise
#// without the prior written consent of the copyright owners.
#//
#// This software is distributed WITHOUT ANY WARRANTY, without even the
#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#// PURPOSE, except where stated in the Licence Agreement supplied with
#// the software.
#//
#// Created By : Simon Crowle
#// Created Date : 18/04/2018
#// Created for Project : FLAME
#//
#/////////////////////////////////////////////////////////////////////////
# Prerequisites
sudo apt-get update
sudo apt-get install -y wget git
# Environment variables for this process
GOROOT=/usr/local/go
PATH=$PATH:$GOROOT/bin
CGO_ENABLED=0
ENV MINIO_UPDATE=off
# And also for separate MINIO process
echo "export GOROOT=/usr/local/go" >> ~/.profile
echo "export PATH=$PATH:$GOROOT/bin" >> ~/.profile
echo "export CGO_ENABLED=0" >> ~/.profile
echo "export ENV MINIO_UPDATE=off" >> ~/.profile
# Install GO
# -----------------------------------------------------------------------
cd /tmp
wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
# Install MINIO
# -----------------------------------------------------------------------
sudo mkdir -p /usr/local/go/src/github.com/minio
cd /usr/local/go/src/github.com/minio
git clone https://github.com/minio/minio
cd minio
go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)"
# check minio configuration available
MINIO_CONF_SOURCE=$REPO_ROOT"/clmctest/services/minio/minio.conf"
if [ ! -f "$MINIO_CONF_SOURCE" ]; then
echo "Error: MINIO conf file does not exist on in the repo. "$MINIO_CONF_SOURCE
exit 1
fi
# configure minio & check
sudo mkdir -p /etc/minio
MINIO_CONF_TARGET="/etc/minio/config.json"
sudo cp -rf $MINIO_CONF_SOURCE $MINIO_CONF_TARGET
if [ ! -f "$MINIO_CONF_TARGET" ]; then
echo "Error: MINIO conf copy failed to target machine. "$MINIO_CONF_TARGET
exit 1
fi
mkdir -p /vagrant/minio_data
# Start MINIO
# -----------------------------------------------------------------------
nohup minio server --config-dir /etc/minio /vagrant/minio_data &>/dev/null &
echo Started MINIO
{
"version": "23",
"credential": {
"accessKey": "F2H4IJ5SITH4C85LAVZL",
"secretKey": "RiI7f6b9KMKwo+rSuOkzUa13+2dFA7oMyaTqgF/q"
},
"region": "",
"browser": "on",
"domain": "",
"storageclass": {
"standard": "",
"rrs": ""
},
"cache": {
"drives": [],
"expiry": 90,
"exclude": []
},
"notify": {
}
}
\ No newline at end of file
## © University of Southampton IT Innovation Centre, 2018
##
## Copyright in this software belongs to University of Southampton
## IT Innovation Centre of Gamma House, Enterprise Road,
## Chilworth Science Park, Southampton, SO16 7NS, UK.
##
## This software may not be used, sold, licensed, transferred, copied
## or reproduced in whole or in part in any manner or form or in or
## on any media by any person other than in accordance with the terms
## of the Licence Agreement supplied with the software, or otherwise
## without the prior written consent of the copyright owners.
##
## This software is distributed WITHOUT ANY WARRANTY, without even the
## implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE, except where stated in the Licence Agreement supplied with
## the software.
##
## Created By : Simon Crowle
## Created Date : 18-04-2018
## Created for Project : FLAME
[[inputs.prometheus]]
urls = ["http://localhost:9000/minio/prometheus/metrics"]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment