From 0d8e21ea5596e5fba1704ddb308eeba5a81145e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Parafin=CC=81ski?= Date: Thu, 31 Mar 2022 21:28:00 +0200 Subject: [PATCH] files and dirs cleanup --- Docker/Jenkinsfile | 21 -------- Docker/download.sh | 11 ---- Docker/Dockerfile => Dockerfile | 3 +- Jenkinsfile | 54 +++---------------- Docker/imdb_top_1000.csv => imdb_top_1000.csv | 0 download.sh => lab2/download.sh | 0 script.ipynb => lab2/script.ipynb | 0 stats.sh => lab2/stats.sh | 0 lab3/Jenkinsfile | 50 +++++++++++++++++ Jenkinsfile2 => lab3/Jenkinsfile2 | 0 Docker/script.py => script.py | 0 11 files changed, 59 insertions(+), 80 deletions(-) delete mode 100644 Docker/Jenkinsfile delete mode 100644 Docker/download.sh rename Docker/Dockerfile => Dockerfile (68%) rename Docker/imdb_top_1000.csv => imdb_top_1000.csv (100%) rename download.sh => lab2/download.sh (100%) rename script.ipynb => lab2/script.ipynb (100%) rename stats.sh => lab2/stats.sh (100%) create mode 100644 lab3/Jenkinsfile rename Jenkinsfile2 => lab3/Jenkinsfile2 (100%) rename Docker/script.py => script.py (100%) diff --git a/Docker/Jenkinsfile b/Docker/Jenkinsfile deleted file mode 100644 index 8177694..0000000 --- a/Docker/Jenkinsfile +++ /dev/null @@ -1,21 +0,0 @@ -pipeline { - agent any - - stages { - - stage ("run agent") { - steps { - sh 'cd ./Docker - ls -la' - sh 'docker build -f ./Docker/Dockerfile -t ium_docker .' - } - } - - stage('Split set into dev/train/test') { - steps { - sh 'docker run -ti ium_docker python3 ./Docker/script.py' - } - } - - } -} \ No newline at end of file diff --git a/Docker/download.sh b/Docker/download.sh deleted file mode 100644 index d5b43b6..0000000 --- a/Docker/download.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -mkdir ./.kaggle -cd .kaggle -touch kaggle.json -echo "{\"username\":\"szymonparafinski\",\"key\":\"a95757bcf7f0def396b5294d971bf6dd\"}" >> kaggle.json - -mkdir dataset -cd dataset -kaggle datasets download -d harshitshankhdhar/imdb-dataset-of-top-1000-movies-and-tv-shows -unzip -o imdb-dataset-of-top-1000-movies-and-tv-shows.zip -$SHELL diff --git a/Docker/Dockerfile b/Dockerfile similarity index 68% rename from Docker/Dockerfile rename to Dockerfile index 0294bb5..486a40a 100644 --- a/Docker/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ -# Nasz obraz będzie dzidziczył z obrazu Ubuntu w wersji latest FROM ubuntu:latest -# Instalujemy niezbędne zależności. Zwróć uwagę na flagę "-y" (assume yes) RUN apt-get update --fix-missing RUN apt-get -y install python3-pip RUN apt-get -y install nano @@ -16,3 +14,4 @@ COPY ./download.sh ./ COPY ./imdb_top_1000.csv ./ CMD python3 ./script.py +CMD echo 'Exiting docker' diff --git a/Jenkinsfile b/Jenkinsfile index d668cd0..aafef84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,50 +1,12 @@ pipeline { agent any - parameters { - string( - defaultValue: 'szymonparafinski', - description: 'Kaggle username', - name: 'KAGGLE_USERNAME', - trim: false - ) - password( - defaultValue: 'a95757bcf7f0def396b5294d971bf6dd', - description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', - name: 'KAGGLE_KEY' - ) - string( - defaultValue: '500', - description: 'Cutoff lines', - name: 'CUTOFF' - ) - } - environment { - KAGGLE_USERNAME="$params.KAGGLE_USERNAME" - KAGGLE_KEY="$params.KAGGLE_KEY" - CUTOFF="$params.CUTOFF" - } + stages { - stage('Check out from version control'){ - steps { - checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's444018', url: 'https://git.wmi.amu.edu.pl/s444018/ium_444018.git']]]) - } - } - stage('Script'){ - steps { - script { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' - sh 'kaggle datasets list' - } - } - sh 'echo Downloading dataset' - sh 'chmod +x download.sh' - sh './download.sh' - archiveArtifacts artifacts: 'imdb_top_1000_dev.csv, imdb_top_1000_test.csv, imdb_top_1000_train.csv', followSymlinks: false - } - } - - } -} \ No newline at end of file + stage ("Build Docker image") { + steps { + sh 'docker build -f ./Docker/Dockerfile -t ium_docker .' + } + } + } +} diff --git a/Docker/imdb_top_1000.csv b/imdb_top_1000.csv similarity index 100% rename from Docker/imdb_top_1000.csv rename to imdb_top_1000.csv diff --git a/download.sh b/lab2/download.sh similarity index 100% rename from download.sh rename to lab2/download.sh diff --git a/script.ipynb b/lab2/script.ipynb similarity index 100% rename from script.ipynb rename to lab2/script.ipynb diff --git a/stats.sh b/lab2/stats.sh similarity index 100% rename from stats.sh rename to lab2/stats.sh diff --git a/lab3/Jenkinsfile b/lab3/Jenkinsfile new file mode 100644 index 0000000..d668cd0 --- /dev/null +++ b/lab3/Jenkinsfile @@ -0,0 +1,50 @@ +pipeline { + agent any + parameters { + string( + defaultValue: 'szymonparafinski', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ) + password( + defaultValue: 'a95757bcf7f0def396b5294d971bf6dd', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + string( + defaultValue: '500', + description: 'Cutoff lines', + name: 'CUTOFF' + ) + } + environment { + KAGGLE_USERNAME="$params.KAGGLE_USERNAME" + KAGGLE_KEY="$params.KAGGLE_KEY" + CUTOFF="$params.CUTOFF" + } + stages { + stage('Check out from version control'){ + steps { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's444018', url: 'https://git.wmi.amu.edu.pl/s444018/ium_444018.git']]]) + } + } + + stage('Script'){ + steps { + script { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + } + sh 'echo Downloading dataset' + sh 'chmod +x download.sh' + sh './download.sh' + archiveArtifacts artifacts: 'imdb_top_1000_dev.csv, imdb_top_1000_test.csv, imdb_top_1000_train.csv', followSymlinks: false + } + } + + } +} \ No newline at end of file diff --git a/Jenkinsfile2 b/lab3/Jenkinsfile2 similarity index 100% rename from Jenkinsfile2 rename to lab3/Jenkinsfile2 diff --git a/Docker/script.py b/script.py similarity index 100% rename from Docker/script.py rename to script.py