From 1c106d7d6715a3b723127de6e0048196edf09c0a Mon Sep 17 00:00:00 2001 From: Adam Wojdyla Date: Sat, 2 Apr 2022 14:12:58 +0200 Subject: [PATCH] python fix --- Dockerfile | 24 ++++++++++++++++++------ Dockerfile-ubuntu | 24 ++++++++++++++++++++++++ Jenkinsfile-docker | 3 --- script.py | 4 ++++ 4 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 Dockerfile-ubuntu diff --git a/Dockerfile b/Dockerfile index 53fb067..81c2058 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,33 @@ FROM ubuntu:latest +# COPY ./kaggle.json /root/.kaggle/kaggle.json + WORKDIR /app -RUN apt-get update && apt-get install -y figlet python3 python3-pip unzip -RUN pip3 install kaggle -RUN pip3 install pandas +RUN apt-get update && apt-get install -y +RUN apt-get install -y python3 +RUN apt-get install -y unzip +RUN apt-get install -y python3-pip + +RUN python3 -m pip --version +RUN python3 -m pip install kaggle +RUN python3 -m pip install pandas + +RUN python3 -m pip freeze # ENV PATH="/root/.local/bin:${PATH}" COPY . . -COPY ./figlet-loop.sh ./ -COPY ./download.sh ./ -COPY ./script.py ./ + +# COPY ./figlet-loop.sh ./ +# COPY ./download.sh ./ +# COPY ./script.py ./ # COPY ./kaggle.json /root/.kaggle/kaggle.json ARG KAGGLE_USERNAME=testKAGGLE_USERNAME ARG KAGGLE_KEY=test1KAGGLE_KEY + +RUN pip freeze RUN chmod u+x ./script.py # RUN ./download.sh 117928 diff --git a/Dockerfile-ubuntu b/Dockerfile-ubuntu new file mode 100644 index 0000000..b231d2f --- /dev/null +++ b/Dockerfile-ubuntu @@ -0,0 +1,24 @@ +FROM ubuntu:latest + +WORKDIR /app + +RUN apt-get update && apt-get install -y figlet python3 python3-pip unzip +RUN pip3 install kaggle +RUN pip3 install pandas + +# ENV PATH="/root/.local/bin:${PATH}" + +COPY . . +COPY ./figlet-loop.sh ./ +COPY ./download.sh ./ +COPY ./script.py ./ +# COPY ./kaggle.json /root/.kaggle/kaggle.json + +ARG KAGGLE_USERNAME=testKAGGLE_USERNAME +ARG KAGGLE_KEY=test1KAGGLE_KEY + +RUN pip freeze +RUN chmod u+x ./script.py + +# RUN ./download.sh 117928 +# RUN python3 ./script.py \ No newline at end of file diff --git a/Jenkinsfile-docker b/Jenkinsfile-docker index b6b3dc6..db1e47d 100644 --- a/Jenkinsfile-docker +++ b/Jenkinsfile-docker @@ -26,9 +26,6 @@ pipeline { stages { stage('Prepare dataset') { steps { - sh 'python3 -m pip install kaggle --no-cache-dir ' - sh 'python3 -m pip install numpy --no-cache-dir ' - sh 'python3 -m pip install pandas --no-cache-dir ' sh 'python3 ./script.py' } } diff --git a/script.py b/script.py index c784d2e..f9fd03c 100644 --- a/script.py +++ b/script.py @@ -70,6 +70,10 @@ def normalize_dataset(dataset): # install_dependencies() + + +print(os.system('python3 -m pip freeze')) + download_dataset() unzip_package() cars = pd.read_csv('./Car_Prices_Poland_Kaggle.csv')