dockerfile jenkinsfile
This commit is contained in:
parent
b57954c1a2
commit
c1d9cdb0d1
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM ubuntu:latest
|
||||
# Install required dependencies
|
||||
RUN apt update
|
||||
RUN apt-get update
|
||||
RUN apt install -y figlet
|
||||
RUN export PATH=”$PATH:/usr/local/bin/python”
|
||||
RUN apt install python3-pip -y
|
||||
RUN apt install unzip -y
|
||||
RUN pip3 install kaggle
|
||||
RUN pip3 install pandas
|
||||
RUN pip3 install scikit-learn
|
||||
RUN pip3 install matplotlib
|
||||
RUN mkdir ~/.kaggle/
|
||||
RUN echo '{"username":"riraasaa","key":"1b1376b538ecd7da9e79b94d218ae3ec"}' > ~/.kaggle/kaggle.json
|
||||
# Create app directory in image
|
||||
WORKDIR /app
|
||||
# Copy init dataset script to /app directory in image
|
||||
COPY ./data_processing.py ./
|
||||
# Download kaggle dataset
|
||||
RUN kaggle datasets download -d uciml/red-wine-quality-cortez-et-al-2009
|
||||
RUN unzip -o red-wine-quality-cortez-et-al-2009.zip
|
||||
# Script executed after docker run
|
||||
CMD python3 ./data_processing.py
|
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@ -1,5 +1,7 @@
|
||||
pipeline {
|
||||
agent any
|
||||
agent {
|
||||
docker { image 'ium' }
|
||||
}
|
||||
parameters{
|
||||
password(
|
||||
defaultValue: '',
|
||||
@ -22,6 +24,12 @@ pipeline {
|
||||
KAGGLE_KEY="$params.KAGGLE_KEY"
|
||||
CUTOFF="$params.CUTOFF"
|
||||
}
|
||||
agent {
|
||||
dockerfile {
|
||||
additionalBuildArgs "-t ium"
|
||||
}
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("Check out from version control") {
|
||||
steps {
|
||||
|
@ -1,5 +1,7 @@
|
||||
pipeline {
|
||||
agent any
|
||||
agent {
|
||||
docker { image 'ium' }
|
||||
}
|
||||
parameters{
|
||||
buildSelector(
|
||||
defaultSelector: lastSuccessful(),
|
||||
|
24
data_processing.py
Normal file
24
data_processing.py
Normal file
@ -0,0 +1,24 @@
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import MinMaxScaler
|
||||
wine = pd.read_csv('winequality-red.csv')
|
||||
|
||||
|
||||
X_train,X_rem,y_train,y_rem = train_test_split(wine.iloc[:,:-1],wine.iloc[:,-1], test_size=0.2, random_state=1,stratify=wine["quality"])
|
||||
X_valid, X_test, y_valid, y_test = train_test_split(X_rem,y_rem, test_size=0.5)
|
||||
|
||||
print("Wielkosc danych: train,test,valid:")
|
||||
print(X_train.shape)
|
||||
print(X_valid.shape)
|
||||
print(X_test.shape)
|
||||
print("wine describe:")
|
||||
print(wine.describe())
|
||||
|
||||
norm = MinMaxScaler()
|
||||
norm_fit = norm.fit(X_train)
|
||||
norm_X_train = norm_fit.transform(X_train)
|
||||
norm_X_test = norm_fit.transform(X_test)
|
||||
norm_X_valid = norm_fit.transform(X_valid)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user