Commit 31af0114 authored by Uwe Jandt (DESY, HIFIS)'s avatar Uwe Jandt (DESY, HIFIS)
Browse files

implement ci stub

parent 92f8a78c
Pipeline #96363 passed with stage
in 1 minute and 24 seconds
plots/
\ No newline at end of file
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Bash.gitlab-ci.yml
# Basic plotting
# See https://docs.gitlab.com/ee/ci/yaml/README.html for all available options
image: debian:latest
cache:
key: apt-cache
paths:
- apt-cache/
before_script:
- echo "Before script section"
- echo "For example you might run an update here or install a build dependency"
- echo "Or perhaps you might print out some debugging details"
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
- apt-get update && apt-get -o dir::cache::archives="$APT_CACHE_DIR" -y install gnuplot gawk imagemagick poppler-utils
- echo "Before script section END."
after_script:
- echo "After script section"
- echo "For example you might do some cleanup here"
build1:
plot_general:
stage: build
script:
- echo "Do your build here"
- mkdir -v plots
- ls -laR > plots/ls.txt
- cd plot_general
- bash ./plot.sh
- mv -v plot.pdf plot.png ../plots
artifacts:
paths:
- plots
......@@ -6,7 +6,14 @@ Collection of service usage for reporting with crude data plotting and conversio
* Helmholtz AAI
* Gitlab (redo from [here](https://gitlab.hzdr.de/fwcc-management/gitlab-statistics)), for the sake of completeness.
#### How-to
#### CI generated plot
* [Browse latest build](https://gitlab.hzdr.de/jandt-desy/service-usage-plots-ci/-/jobs/artifacts/master/browse/plots?job=plot_general)
* ![pic](https://gitlab.hzdr.de/jandt-desy/service-usage-plots-ci/-/jobs/artifacts/master/raw/plots/plot.png?job=plot_general)
#### Local execution
Necessary for converting and plotting: `gnuplot`, `awk`, imagemagick `convert`.
......@@ -15,14 +22,3 @@ cd 202102_Backbone # or any other of the sub-folders
./plot.sh
```
#### Backbone Cluster: KPI plot
This is an update to the plot as provided for the [HIFIS Report 2020](https://nubes.helmholtz-berlin.de/s/Y79kf2s3xyiZnX2/download), Backbone Cluster.
![202102_Backbone](202102_Backbone/plot.png)
#### HIFIS General, KPI plot
This is an update to the plot as provided for the HIFIS Report 2020, Overall Section.
![202103_Report_Overall](202103_Report_Overall/plot.png)
#### AAI users vs. Education participants
This is an update to the plot as provided for the MV 202104.
![202104_MV](202104_MV/plot.png)
#!/bin/gnuplot
set datafile separator ","
set output 'plot.pdf'
set yrange [0:*]
set xdata time
set timefmt "%Y-%m-%d %H:%M"
set format x "%Y-%m-%d"
set xrange ["2019-07-01":"2021-07-02"]
set grid
set xtics rotate by 45
set key top left
set terminal pdf color enhanced size 7,5 dashed
if (!exists("MP_LEFT")) MP_LEFT = .1
if (!exists("MP_RIGHT")) MP_RIGHT = .95
if (!exists("MP_BOTTOM")) MP_BOTTOM = .14
if (!exists("MP_TOP")) MP_TOP = .95
if (!exists("MP_xGAP")) MP_xGAP = 0.1
if (!exists("MP_yGAP")) MP_yGAP = 0.02
set multiplot layout 2,2 columnsfirst margins screen MP_LEFT, MP_RIGHT, MP_BOTTOM, MP_TOP spacing screen MP_xGAP, MP_yGAP
set linetype 2 dashtype 2
set key bottom left
set xtics textcolor rgbcolor "white"
set ylabel "{/Arial:Bold B2a}: AAI-connected centres \n with users in AAI"
set yrange [0:20]
plot '../stats/aai/aai_centers.csv' u 1:($2>0?$2:1/0) w lp pt 7 ps 0.5 lc black notitle ,\
'' u 1:($2<=11?$2:1/0) w lp pt 6 ps 0.5 lc black lt 2 notitle
set yrange [0:*]
set timefmt "%d.%m.%Y"
set xtics textcolor rgbcolor "black" offset -4,-3
set ylabel '{/Arial:Bold B2c}: Registered end users'
plot '../stats/aai/aai_users.csv' u 1:2 w lp pt 7 ps 0.5 lc black notitle
set timefmt "%d.%m.%y"
set xtics textcolor rgbcolor "white"
set ylabel "{/Arial:Bold B2b}: AAI-connected services \n (incl. \"associated services\")"
plot '../stats/aai/aai_services.csv' u 1:2 w lp pt 7 ps 0.5 lc black notitle
set key top left
set timefmt "%d.%m.%Y"
set xtics textcolor rgbcolor "black" offset -4,-3
set ylabel '{/Arial:Bold B2d}: Registered VOs (root)'
plot '../stats/aai/aai_vo.csv' u 1:2 w lp pt 6 ps 0.5 lt 2 lc black title 'VO - total' ,\
'' u 1:3 w lp pt 7 ps 0.5 lt 1 lc black title 'VO - HIFIS'
set timefmt "%Y-%m-%d %H:%M"
unset multiplot
set key bottom left
set ylabel '{/Arial:Bold B2a}: AAI-connected centres'
set xtics textcolor rgbcolor "black" offset -4,0
set yrange [0:20]
plot '../stats/aai/aai_centers.csv' u 1:2 w lp pt 7 ps 0.5 lc black title 'IdPs with users in AAI' ,\
'../stats/aai/aai_idp_attribute_query.csv' u 1:2 w lp pt 6 ps 0.5 lc black title 'IdPs supporting attribute query'
set logscale y
set yrange [10:4000]
set timefmt "%d.%m.%Y"
set ylabel '{/Arial:Bold B2c}: Registered end users'
plot '../stats/aai/aai_users.csv' u 1:2 w lp pt 7 ps 0.5 lc black notitle
unset logscale y
set yrange [0:*]
set timefmt "%Y-%m-%d %H:%M"
set ylabel 'B1: Centres connected to Backbone'
plot '../stats/vpn/vpn_centers.csv' u 1:2 w lp pt 7 ps 0.5 lc black notitle
set datafile separator ";"
set ylabel 'Gitlab Usage'
plot '../stats/gitlab/active_users.csv' u 1:2 w l title 'Total' ,\
'' u 1:4 w l title 'last 7 days' ,\
'' u 1:7 w l title 'last 60 days'
plot '../stats/gitlab/projects_statistics.csv' u 1:2 w l title 'Total'
#!/bin/bash
pushd ../stats/aai/
# summing up columns 2 and 3, combined
in=aai_userstats.csv
out=aai_users.csv
if [ $in -nt $out ]; then
cat $in | awk 'BEGIN{FS=","}{print $1","a; a+=$2+$3}' > $out
fi
# summing up columns 2,3,4 and 5
# leaving first (date) and columns after 5 (service name[s]) unchanged.
in=HIFIS_AAI_SP.csv
out=aai_services.csv
if [ $in -nt $out ]; then
cat $in | awk 'BEGIN{FS=","}{
printf ("%s,",$1);
for (a=2; a<=5; a++)
{
sum[a]+=$a;
printf ("%g,",sum[a]);
}
for (a=6; a<=NF; a++)
printf ("%s,",$a);
printf("\n");
}' > $out
fi
popd
gnuplot ./plot.plt
pdftoppm plot.pdf plot_temp -singlefile -aa no -aaVector no -r 600 -mono -png
convert plot_temp.png -monochrome plot.png
rm plot_temp.png
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment