add multipieline project
Some checks failed
s440058-training/pipeline/head There was a failure building this commit

This commit is contained in:
piotr6789 2021-05-24 11:56:06 +02:00
parent 254da57d4b
commit bdc4ccdf9b
2 changed files with 58 additions and 0 deletions

6
lab06/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install -y python3-pip && pip3 install setuptools && pip3 install numpy && pip3 install pandas && pip3 install wget && pip3 install scikit-learn && pip3 install matplotlib && rm -rf /var/lib/apt/lists/*
RUN pip3 install torch torchvision torchaudio
RUN pip3 install sacred && pip3 install GitPython && pip3 install pymongo
WORKDIR /app
COPY ./../pytorch-example.py ./

52
lab06/jenkinsfile-train Normal file
View File

@ -0,0 +1,52 @@
pipeline {
agent {
dockerfile true
}
parameters{
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'WHICH_BUILD'
)
string(
defaultValue: '16',
description: 'batch size',
name: 'BATCH_SIZE'
)
string(
defaultValue: '15',
description: 'epochs',
name: 'EPOCHS'
)
}
stages {
stage('checkout') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's440058-create-dataset', selector: buildParameter('WHICH_BUILD')
}
}
stage('Docker'){
steps{
sh 'python3 "./pytorch-example.py" ${BATCH_SIZE} ${EPOCHS} > pred.txt'
}
}
stage('archiveArtifacts') {
steps{
archiveArtifacts 'ium_s440058/**'
archiveArtifacts 'pred.txt'
archiveArtifacts 'diabetes.pkl'
}
}
}
post {
success {
mail body: 'SUCCESS TRAINING', subject: 's440058', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
failure {
mail body: 'FAILURE TRAINING', subject: 's440058', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
}