From 4f90f25ceab848e2d2ecee3cfb00c889b3768adb Mon Sep 17 00:00:00 2001 From: massta Date: Sun, 5 Apr 2020 18:31:32 +0200 Subject: [PATCH] zad4 test 7 --- Dockerfile | 5 +++++ jenkinsfile2 | 29 +++++++++++++++++++++++++++++ plotsrr.py | 20 ++++++++++++++++++++ plotwer.py | 20 ++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 jenkinsfile2 create mode 100644 plotsrr.py create mode 100644 plotwer.py diff --git a/Dockerfile b/Dockerfile index 586d323..acc1a49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,11 @@ RUN gcc --version RUN apt install -y build-essential RUN apt install num-utils RUN apt install bc +RUN apt install software-properties-common +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt install python3.7 +RUN apt install python3-pip +RUN pip3 install matplotlib RUN git clone https://github.com/usnistgov/SCTK.git WORKDIR SCTK RUN make config && make all && make check && make install && make doc diff --git a/jenkinsfile2 b/jenkinsfile2 new file mode 100644 index 0000000..970f522 --- /dev/null +++ b/jenkinsfile2 @@ -0,0 +1,29 @@ +pipeline { + agent { dockerfile true } + stages { + stage('Cloning GIT') { + steps { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s452108/s452108-mlworkshops']]]) + } + } + stage('Copy Artifacts') { + steps { +copyArtifacts filter: 'averagesrr.txt', fingerprintArtifacts: true, projectName: 's452108-metrics', selector: lastSuccessful() +copyArtifacts filter: 'averagewer.txt', fingerprintArtifacts: true, projectName: 's452108-metrics', selector: lastSuccessful() + } + } + stage('Plot') { + steps { + sh label: '', script: 'python3 plotwer.py' + sh label: '', script: 'python3 plotsrr.py' + } + } + stage('Archive atifacts') { + steps { +archiveArtifacts 'plotwer.png' +archiveArtifacts 'plotsrr.png' + } + } + } +} + diff --git a/plotsrr.py b/plotsrr.py new file mode 100644 index 0000000..f87b575 --- /dev/null +++ b/plotsrr.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import csv + +x = [] +y = [] +i = 0 + +with open('averagesrr.txt','r') as csvfile: + plots = csv.reader(csvfile, delimiter=' ') + for row in plots: + x.append(round(row[0], 2)) + y.append(i) + i=i+1 + +plt.plot(x,y, label='SRR') +plt.xlabel('SRR') +plt.ylabel('Numer') +plt.title('Wykres średni SRR') +plt.legend() +plt.savefig('plotsrr.png') diff --git a/plotwer.py b/plotwer.py new file mode 100644 index 0000000..2597f13 --- /dev/null +++ b/plotwer.py @@ -0,0 +1,20 @@ +import matplotlib.pyplot as plt +import csv + +x = [] +y = [] +i = 0 + +with open('averagewer.txt','r') as csvfile: + plots = csv.reader(csvfile, delimiter=' ') + for row in plots: + x.append(round(row[0], 2)) + y.append(i) + i=i+1 + +plt.plot(x,y, label='WER') +plt.xlabel('WER') +plt.ylabel('Numer') +plt.title('Wykres średni WER') +plt.legend() +plt.savefig('plotwer.png')