From 5a858f023b51fabe8728fbd025a0aa3bf32dafef Mon Sep 17 00:00:00 2001 From: Maciej Sobkowiak Date: Mon, 17 May 2021 00:26:29 +0200 Subject: [PATCH] Observers --- Dockerfile | 2 ++ sacred_training.py | 3 +++ train.Jenkinsfile | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c39d667..5a83a54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ RUN pip3 install matplotlib RUN pip3 install numpy RUN pip3 install tensorflow RUN pip3 install sklearn +RUN pip3 install sacred +RUN pip3 install pymongo WORKDIR /app diff --git a/sacred_training.py b/sacred_training.py index d00eab9..f9b513c 100644 --- a/sacred_training.py +++ b/sacred_training.py @@ -7,9 +7,12 @@ from tensorflow.keras.layers.experimental import preprocessing from sacred import Experiment from sacred.observers import FileStorageObserver from sklearn.metrics import mean_squared_error +from sacred.observers import MongoObserver ex = Experiment("434784_sacred_scopes", interactive=True) ex.observers.append(FileStorageObserver('sacred_runs')) +# ex.observers.append(MongoObserver( +# url='mongodb://mongo_user:mongo_password_IUM_2021@localhost:27017', db_name='sacred')) @ex.config diff --git a/train.Jenkinsfile b/train.Jenkinsfile index f11a8eb..7ab5637 100644 --- a/train.Jenkinsfile +++ b/train.Jenkinsfile @@ -36,8 +36,9 @@ pipeline { def image = docker.build('dock') image.inside{ sh 'chmod +x training.py' + sh 'chmod +x sacred_training.py' sh 'python3 training.py ${EPOCHS} ${BATCH_SIZE}' - + sh 'python3 sacred_training.py' } } } @@ -45,6 +46,7 @@ pipeline { stage('archive-model') { steps{ archiveArtifacts 'suicide_model.h5' + archiveArtifacts 'sacred_runs/**' } } stage('send-mail') {