From f913e8281ae3390a42bc1f6f59ccb8c4c93298cb Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 12:37:25 +0200 Subject: [PATCH 01/15] Update README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9a61f48..4d2057c 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,9 @@ Inżynieria Uczenia Maszynowego Dataset: https://www.kaggle.com/eugenioscionti/scraping-rotten-tomatoes-to-enrich-netflix-dataset ium_zadanie1.py - python script for Zadanie 1 run.sh - bash script with dataset download from kaggle and running ium_zadanie1.py + +Jenkinsfile - Jenkinsfile for classes 3 - create-Dataset +Jenkinsfile-stats - Jenkinsfile for classes 3 - dataset-stats + +Dockerfile - Dockerfile for classes 4 + From 17fbe86a819b1f75624606ed75044fe586352f75 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 12:52:13 +0200 Subject: [PATCH 02/15] Change Jenkinsfile agent - dockerfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8dac578..1a0cb03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent { dockerfile true } stages { From 245c4a04f9d8e201f25062c189834ee050601b55 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 13:50:13 +0200 Subject: [PATCH 03/15] Update Jenkinsfile - add docker run args --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1a0cb03..c68990c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,8 @@ pipeline { - agent { dockerfile true } + agent { dockerfile + { + args 'ti' + }} stages { From ac3fa8bca2bb486016bf68ec765ad7f87b95bef6 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 14:02:07 +0200 Subject: [PATCH 04/15] Update Jenkinsfile - save artifacts --- Jenkinsfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c68990c..8cb7d8b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,5 @@ pipeline { - agent { dockerfile - { - args 'ti' - }} + agent { dockerfile true} stages { @@ -10,15 +7,15 @@ pipeline { steps { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'chmod +x jenkins_script.sh' - sh './jenkins_script.sh' + sh 'chmod +x run.sh' + sh './run.sh > netflix_stats.txt' } } } stage('Archive artifacts') { steps{ - archiveArtifacts artifacts: 'netflix_split_*.csv' + archiveArtifacts artifacts: 'netflix_stats.txt' } } } From f1f90075d74171353297b2fe52d9818fc3e60747 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 14:54:43 +0200 Subject: [PATCH 05/15] Update Jenkinsfile_stats - class 4 --- Jenkinsfile_stats | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index 0cac29d..db4a4c2 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -1,21 +1,21 @@ pipeline { - agent any + docker { image 'zollinka/ium:latest' } + stages { - stage('copyArtifacts') { - steps { - copyArtifacts fingerprintArtifacts: true, projectName: 's434684-create-dataset', selector: buildParameter('CREATE_DATASET_BUILD_SELECTOR') - } - } - stage('script stats') { - steps { - sh 'chmod +x jenkins_stats_script.sh' - sh './jenkins_stats_script.sh' - } - } - stage('archiveArtifacts') { - steps { - archiveArtifacts 'dataset-stats.txt' - } - } + stage('Sh script') { + steps { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'chmod +x run.sh' + sh './run.sh > netflix_stats.txt' + } + + } + } + stage('Archive artifacts') { + steps{ + archiveArtifacts artifacts: 'netflix_stats.txt' + } + } } } \ No newline at end of file From 0faf288c706158239ac57626c79de031acaac570 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 14:58:41 +0200 Subject: [PATCH 06/15] Update 'Jenkinsfile_stats' Fix missing agent --- Jenkinsfile_stats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index db4a4c2..c3c8b86 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -1,5 +1,5 @@ pipeline { - docker { image 'zollinka/ium:latest' } + agent {docker { image 'zollinka/ium:latest' }} stages { stage('Sh script') { From 77a03ecfca151a92c3fd4db004f9f4d72b7da4ba Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 18:31:58 +0200 Subject: [PATCH 07/15] Update Jenkinsfile_stats - test ls --- Jenkinsfile_stats | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index c3c8b86..69a8185 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -7,6 +7,8 @@ pipeline { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { sh 'chmod +x run.sh' + sh '''ls -lah + cat /etc/issue''' sh './run.sh > netflix_stats.txt' } From 415b36b53c09240835209cd9250bc1dfc9fca53b Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 18:55:26 +0200 Subject: [PATCH 08/15] Update Jenkinsfile_stats - test scripted --- Jenkinsfile_stats | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index 69a8185..837d625 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -1,23 +1,11 @@ -pipeline { - agent {docker { image 'zollinka/ium:latest' }} - - stages { - stage('Sh script') { - steps { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'chmod +x run.sh' - sh '''ls -lah - cat /etc/issue''' - sh './run.sh > netflix_stats.txt' - } - - } - } - stage('Archive artifacts') { - steps{ - archiveArtifacts artifacts: 'netflix_stats.txt' - } - } +node { + docker.image('zollinka/ium:latest').withRun('-t') { c -> + docker.image('zollinka/ium:latest').inside { + stage('Test') { + sh 'cat /etc/issue' + sh 'ls -lah' + } + } } + sh 'docker logs ${c.id}' } \ No newline at end of file From 4b760ec23edfe9f2c6cc95ddab68415d39d9eedb Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 20:53:36 +0200 Subject: [PATCH 09/15] Update run.sh - test ls --- run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run.sh b/run.sh index 3c55675..54ea9ca 100644 --- a/run.sh +++ b/run.sh @@ -1,3 +1,4 @@ #!/bin/bash kaggle kernels output 'eugenioscionti/scraping-rotten-tomatoes-to-enrich-netflix-dataset' +ls -lah python3 ium_zadanie1.py From 6afa5af94028b933652c0eccd4b35dc97ad9a678 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 20:55:02 +0200 Subject: [PATCH 10/15] Revert to before test Jenkinsfile --- Jenkinsfile_stats | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index 837d625..c3c8b86 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -1,11 +1,21 @@ -node { - docker.image('zollinka/ium:latest').withRun('-t') { c -> - docker.image('zollinka/ium:latest').inside { - stage('Test') { - sh 'cat /etc/issue' - sh 'ls -lah' - } - } +pipeline { + agent {docker { image 'zollinka/ium:latest' }} + + stages { + stage('Sh script') { + steps { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'chmod +x run.sh' + sh './run.sh > netflix_stats.txt' + } + + } + } + stage('Archive artifacts') { + steps{ + archiveArtifacts artifacts: 'netflix_stats.txt' + } + } } - sh 'docker logs ${c.id}' } \ No newline at end of file From 465ea4c1d45ae19d1729a286ac2f719f0994cfb8 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 20:56:54 +0200 Subject: [PATCH 11/15] Revert to before test - run.sh --- run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run.sh b/run.sh index 54ea9ca..3c55675 100644 --- a/run.sh +++ b/run.sh @@ -1,4 +1,3 @@ #!/bin/bash kaggle kernels output 'eugenioscionti/scraping-rotten-tomatoes-to-enrich-netflix-dataset' -ls -lah python3 ium_zadanie1.py From 46181f1170c3714942e4fcbe4a33b0d11fd635de Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 20:58:26 +0200 Subject: [PATCH 12/15] Test docker image run on create-dataset --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8cb7d8b..1e253c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { dockerfile true} + agent {docker { image 'zollinka/ium:latest' }} stages { From f0df711d324168550ac0183dc06e7db2f48a7a22 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 21:00:38 +0200 Subject: [PATCH 13/15] Revert to before test Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e253c7..4c688ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent {docker { image 'zollinka/ium:latest' }} + agent {dockerfile true} stages { From e91e06176477dc19f55a37709172ef611c9555c9 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 21:13:26 +0200 Subject: [PATCH 14/15] Test jenkins --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4c688ac..e11513c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,5 @@ pipeline { - agent {dockerfile true} - + agent any stages { stage('Sh script') { From 5fc168ab374253740e6742f7be5a03ebe3820871 Mon Sep 17 00:00:00 2001 From: Zofia Galla Date: Sun, 11 Apr 2021 21:15:58 +0200 Subject: [PATCH 15/15] Revert to before test Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e11513c..5477308 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent {dockerfile true} stages { stage('Sh script') {