From c273e4c4ee51d5b8dd4b3a5cc9760a98631296c8 Mon Sep 17 00:00:00 2001 From: Jan Nowak Date: Sat, 12 Jun 2021 17:32:50 +0200 Subject: [PATCH] Jenkins DVC file --- Dockerfile | 2 ++ Jenkinsfile_DVC | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Jenkinsfile_DVC diff --git a/Dockerfile b/Dockerfile index 27031a0..2a98ebe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN pip3 install sacred RUN pip3 install pymongo RUN pip3 install mlflow RUN pip3 install tensorflow==2.5.0rc1 +RUN pip3 install dvc +RUN pip3 install dvc[ssh] # Stwórzmy w kontenerze (jeśli nie istnieje) katalog /app i przejdźmy do niego (wszystkie kolejne polecenia RUN, CMD, ENTRYPOINT, COPY i ADD będą w nim wykonywane) WORKDIR /app diff --git a/Jenkinsfile_DVC b/Jenkinsfile_DVC new file mode 100644 index 0000000..146e92c --- /dev/null +++ b/Jenkinsfile_DVC @@ -0,0 +1,49 @@ +pipeline { + agent any + stages { + stage('checkout') { + steps { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s426206/ium_426206.git']]]) + } + } + stage('docker') { + steps { + script { + def img = docker.build('rokoch/ium:01') + img.inside { + sh 'dvc remote add -f -d ium_ssh_remote ssh://ium-sftp@tzietkiewicz.vm.wmi.amu.edu.pl/ium-sftp' + sh 'dvc remote modify --local ium_ssh_remote password IUM@2021' + sh 'dvc pull' + sh 'dvc reproduce' + } + } + } + } + + stage('end') { + steps { + //Zarchiwizuj wynik + archiveArtifacts 'model.pt' + } + } + } + + post { + success { + //Wysłanie maila + emailext body: 'Success DVC', + subject: 's426206 DVC', + to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + + } + unstable { + emailext body: 'Unstable DVC', subject: 's426206 DVC', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + failure { + emailext body: 'Failure DVC', subject: 's426206 DVC', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + changed { + emailext body: 'Changed DVC', subject: 's426206 DVC', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + } +}