changes to dockerfile and added jenkinsfile_3

This commit is contained in:
Jakub Henyk 2023-05-07 18:05:33 +02:00
parent c66bcd324e
commit bbfc6d91d9
2 changed files with 37 additions and 6 deletions

View File

@ -14,16 +14,19 @@ RUN python3 -m pip install numpy
RUN python3 -m pip install torch
RUN python3 -m pip install torchvision
COPY ./zadanie1.py ./
#COPY ./zadanie1.py ./
COPY ./Customers.csv ./
COPY ./train.py ./
COPY ./test.py ./
COPY ./cifar_net.pth ./
#COPY ./test.py ./
#COPY ./cifar_net.pth ./
RUN chmod +r ./Customers.csv
RUN chmod +x ./zadanie1.py
#RUN chmod +x ./zadanie1.py
RUN chmod +x ./train.py
RUN chmod +x ./test.py
#RUN chmod +x ./test.py
ARG epochs = 5
RUN echo $epochs
CMD python3 ./train.py
CMD python3 ./test.py
#CMD python3 ./test.py

28
Jenkinsfile_3 Normal file
View File

@ -0,0 +1,28 @@
pipeline {
agent any
//Definijuemy parametry, ktore bedzie mozna podac podczas wywolywania zadania
parameters {
string (
name: 'epochs_count',
defaultValue: '10',
description: 'How many epochs do you want to train?',
)
}
stages {
}
stage('Run Script') {
steps {
script {
sh 'docker build . -t jhenyk/ium:latest --build-arg epochs=epochs_count'
sh 'docker run jhenyk/ium:latest'
}
}
}
stage('Archive Output') {
steps {
archiveArtifacts 'cifar_net.pth'
}
}
}
}