46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
pipeline {
|
|
agent {
|
|
docker {
|
|
image 'python:3.11'
|
|
args '-v /root/.cache:/root/.cache -u root'
|
|
}
|
|
}
|
|
environment {
|
|
PATH = "/path/to/your/python/bin:${env.PATH}"
|
|
SACRED_IGNORE_GIT = 'TRUE'
|
|
}
|
|
parameters {
|
|
string(name: 'EPOCHS', defaultValue: '10', description: 'Liczba Epok')
|
|
}
|
|
stages {
|
|
stage('Przygotuj') {
|
|
steps {
|
|
sh 'python -m pip install pandas tensorflow scikit-learn imbalanced-learn sacred pymongo mlflow'
|
|
}
|
|
}
|
|
stage('Pobierz dane') {
|
|
steps {
|
|
script {
|
|
copyArtifacts(projectName: 's487187-create-dataset', fingerprintArtifacts: true)
|
|
}
|
|
}
|
|
}
|
|
stage('Trenuj model') {
|
|
steps {
|
|
script {
|
|
sh 'mlflow run . -P epochs=$EPOCHS'
|
|
}
|
|
}
|
|
}
|
|
stage('Zarchiwizuj model') {
|
|
steps {
|
|
sh '''
|
|
mkdir -p model
|
|
cp -r mlruns/* model/
|
|
'''
|
|
archiveArtifacts artifacts: 'model/**', fingerprint: true
|
|
}
|
|
}
|
|
}
|
|
}
|