diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c8fd622 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:latest + +RUN apt update -y && apt install -y make +RUN apt install -y git +RUN apt install -y gcc +RUN apt install -y python3 +RUN gcc --version +RUN apt install -y build-essential +RUN git clone https://github.com/usnistgov/SCTK.git +WORKDIR SCTK +RUN make config && make all && make check && make install && make doc +ENV PATH=$PATH:/SCTK/bin +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..2af2d93 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,25 @@ +pipeline { + agent { + dockerfile true + } + + stages { + stage('Copy all results'){ + steps { + copyArtifacts filter: 'wer.txt, srr.txt', fingerprintArtifacts: true, projectName: 's452097-metrics', selector: lastSuccessful() + } + } + stage('Create plots'){ + step { + sh('chmod +x ./plotGenerator.sh') + sh label: 'count', script: './plotGenerator.sh' + } + } + stage('Archive plots'){ + steps { + archiveArtifacts 'wer.png' + archiveArtifacts 'srr.png' + } + } + } +} diff --git a/plotCreator.py b/plotCreator.py new file mode 100644 index 0000000..191dc91 --- /dev/null +++ b/plotCreator.py @@ -0,0 +1,34 @@ +import matplotlib +import matplotlib.pyplot as plt +import numpy as np + +def readFile(file): + with open(file, 'r') as inFile: + countL = 0 + for line in open(thefilepath).xreadlines( ): countL += 1 + y2 = np.genfromtxt(file) + return countL, y2 + +def createplot(sourceFile): + if sourceFile == 'wer.txt' + name = 'WER' + if sourceFile == 'srr.txt' + name = 'SRR' + + readFile(sourceFile) + # Data for plotting + x = np.arange(1, countL) + y = y2 + + fig, ax = plt.subplots() + ax.plot(x, y) + ax.set(xlabel='Build number', ylabel='Percent of '+name, + title=name+' metric for ASR') + ax.grid() + + fig.savefig(name+'.png') + plt.show() + +if __name__ == '__main__': + createplot('wer.txt') + createplot('srr.txt') diff --git a/plotGenerator.sh b/plotGenerator.sh new file mode 100644 index 0000000..1e15bce --- /dev/null +++ b/plotGenerator.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +tail -n50 wer.txt > werForPlot.txt +tail -n50 srr.txt > srrForPlot.txt + +python3 plotCreator.py