Rozwiązania zadań z lab4 (Docker)
This commit is contained in:
parent
e1bceebb15
commit
4860753e13
26
lab4/Dockerfile
Normal file
26
lab4/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y python3-pip
|
||||
RUN apt-get install -y unzip
|
||||
|
||||
RUN pip3 install kaggle
|
||||
RUN pip3 install pandas
|
||||
RUN pip3 install sklearn
|
||||
RUN pip3 install numpy
|
||||
|
||||
ARG CUTOFF
|
||||
ARG KAGGLE_USERNAME
|
||||
ARG KAGGLE_KEY
|
||||
ENV CUTOFF=${CUTOFF}
|
||||
ENV KAGGLE_USERNAME=${KAGGLE_USERNAME}
|
||||
ENV KAGGLE_KEY=${KAGGLE_KEY}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY lab2/download.sh .
|
||||
COPY lab2/main.py .
|
||||
|
||||
RUN chmod +x ./download.sh
|
||||
RUN ./download.sh
|
||||
RUN python3 ./main.py
|
32
lab4/Jenkinsfile
vendored
Normal file
32
lab4/Jenkinsfile
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} --build-arg CUTOFF=${params.CUTOFF} -t docker_image"
|
||||
}
|
||||
}
|
||||
parameters {
|
||||
string(
|
||||
defaultValue: 'szymonparafinski',
|
||||
description: 'Kaggle username',
|
||||
name: 'KAGGLE_USERNAME',
|
||||
trim: false
|
||||
)
|
||||
password(
|
||||
defaultValue: '',
|
||||
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
|
||||
name: 'KAGGLE_KEY'
|
||||
)
|
||||
string(
|
||||
defaultValue: '100',
|
||||
description: 'Cutoff lines',
|
||||
name: 'CUTOFF'
|
||||
)
|
||||
}
|
||||
stages {
|
||||
stage('Script'){
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'data_test.csv, data_train.csv, data_dev.csv', followSymlinks: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
24
lab4/Jenkinsfile_stats
Normal file
24
lab4/Jenkinsfile_stats
Normal file
@ -0,0 +1,24 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'docker_image'
|
||||
}
|
||||
}
|
||||
parameters{
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
name: 'BUILD_SELECTOR',
|
||||
description: 'Which build to use for copying artifacts'
|
||||
)
|
||||
}
|
||||
stages {
|
||||
stage("Script") {
|
||||
steps {
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's444018-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
||||
sh 'chmod +x ./lab2/stats.sh'
|
||||
sh "./lab2/stats.sh"
|
||||
archiveArtifacts 'stats.txt'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user