Jenkinsfile-training changed, automatic mail sending
Some checks failed
s434742-training/pipeline/head There was a failure building this commit

This commit is contained in:
patrycjalazna 2021-05-07 17:43:06 +02:00
parent 2d49376c32
commit b5daa4256d
2 changed files with 17 additions and 8 deletions

View File

@ -9,14 +9,14 @@ pipeline {
defaultSelector: lastSuccessful(), defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts', description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR' name: 'BUILD_SELECTOR'
) )
string( string(
defaultValue: '16', defaultValue: '16',
description: 'batch size', description: 'batch size',
name: 'BATCH_SIZE' name: 'BATCH_SIZE'
) )
string( string(
defaultValue: '15', defaultValue: '10',
description: 'epochs', description: 'epochs',
name: 'EPOCHS' name: 'EPOCHS'
) )
@ -27,18 +27,26 @@ pipeline {
copyArtifacts fingerprintArtifacts: true, projectName: 's434742-create-dataset', selector: buildParameter('BUILD_SELECTOR') copyArtifacts fingerprintArtifacts: true, projectName: 's434742-create-dataset', selector: buildParameter('BUILD_SELECTOR')
} }
} }
stage('Sh script') { stage('training') {
steps { steps {
sh 'chmod +x run_training-script.sh' sh 'chmod +x avocado-preprocessing.py'
sh './run_training-script.sh ${EPOCHS} ${BATCH_SIZE}' sh 'python3 avocado-preprocessing.py ${EPOCHS} ${BATCH_SIZE}'
} }
} }
stage('Archive artifacts') { stage('archiveArtifacts') {
steps{ steps{
archiveArtifacts artifacts: 'model_movies' archiveArtifacts 'avocado-model.h5'
} }
} }
stage('sendMail') {
steps{
emailext body: currentBuild.result ?: 'SUCCESS',
subject: 's434742',
to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms'
}
}
} }
} }

View File

@ -99,6 +99,7 @@ epochs = int(sys.argv[1])
batch_size = int(sys.argv[2]) batch_size = int(sys.argv[2])
model.fit(X_train, y_train, epochs=epochs, batch_size=batch_size, validation_data=(X_test, y_test)) model.fit(X_train, y_train, epochs=epochs, batch_size=batch_size, validation_data=(X_test, y_test))
model.save('avocado-model.h5')
# predict # predict
predictions = model.predict(X_test) predictions = model.predict(X_test)