Task 2 Part 2
This commit is contained in:
parent
3581fdd323
commit
599b1be807
@ -3,11 +3,12 @@ pipeline {
|
||||
dockerfile true
|
||||
}
|
||||
parameters {
|
||||
string(
|
||||
defaultValue: '200',
|
||||
description: 'number of epochs',
|
||||
name: 'EPOCH'
|
||||
)
|
||||
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
description: 'Which build to use for copying artifacts',
|
||||
name: 'BUILD_SELECTOR'
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
@ -20,7 +21,7 @@ pipeline {
|
||||
stage('Copy from different Pipeline') {
|
||||
steps {
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's444517-create-dataset', selector: lastSuccessful()
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's444517-training/master', selector: lastSuccessful()
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's444517-training/${BRANCH}', selector: buildParameter('BUILD_SELECTOR')
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's444517-evaluation/master', selector: lastSuccessful(), optional: true
|
||||
}
|
||||
}
|
||||
@ -28,10 +29,17 @@ pipeline {
|
||||
stage('Get data save artifacts') {
|
||||
steps {
|
||||
sh 'python3 ./nn_train_eval.py'
|
||||
archiveArtifacts artifacts: 'my_model/saved_model.pb, metrics.txt, output.jpg'
|
||||
archiveArtifacts artifacts: 'my_model/saved_model.pb, metrics.txt, output.jpg, current_results.txt'
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
|
||||
always {
|
||||
def metrics = readFile(file: 'current_results.txt')
|
||||
emailext body: "${currentBuild.currentResult} ${metrics}", subject: 's444517_build_status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,10 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
//post {
|
||||
// always {
|
||||
// emailext body: "${currentBuild.currentResult}", subject: 's444517_build_status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
||||
// }
|
||||
//}
|
||||
post {
|
||||
always {
|
||||
emailext body: "${currentBuild.currentResult}", subject: 's444517_build_status', to: 'e19191c5.uam.onmicrosoft.com@emea.teams.ms'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,10 @@ def new_metrics():
|
||||
acc = accuracy_score(y_true, y_pred)
|
||||
recc = recall_score(y_true, y_pred, average='macro')
|
||||
|
||||
with open("current_results.txt", 'w') as f:
|
||||
f.write(f"accuracy: {acc} recall: {recc}")
|
||||
f.close()
|
||||
|
||||
with open("metrics.txt", 'a') as f:
|
||||
f.write(f"{acc},{recc}\n")
|
||||
f.close()
|
||||
|
Loading…
Reference in New Issue
Block a user