This commit is contained in:
Jakub Zaręba 2023-05-10 23:39:09 +02:00
parent dd8f7ba701
commit 6c00b125aa

View File

@ -1,14 +1,25 @@
FROM ubuntu FROM ubuntu:20.04
RUN apt-get update && apt-get install -y python3 python3-pip unzip make build-essential libssl-dev zlib1g-dev \ RUN apt-get update && apt-get install -y curl git libssl-dev make build-essential libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \ xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
&& curl https://pyenv.run | bash \
&& echo 'export PATH="/root/.pyenv/bin:$PATH"' >> ~/.bashrc \ RUN curl https://pyenv.run | bash
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc \ ENV HOME /root
&& /bin/bash -c "source ~/.bashrc" \ ENV PYENV_ROOT $HOME/.pyenv
&& python3 -m pip install pandas numpy tensorflow imbalanced-learn sklearn sacred pymongo mlflow ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
ENV PYTHON_VERSION 3.11.3
RUN pyenv install $PYTHON_VERSION
RUN pyenv global $PYTHON_VERSION
RUN python --version
RUN apt-get install -y python3-pip unzip
RUN python3 -m pip install pandas numpy tensorflow imbalanced-learn sklearn sacred pymongo mlflow
RUN apt-get install -y git
COPY train.py /app/train.py COPY train.py /app/train.py
COPY predictions.py /app/predictions.py COPY predictions.py /app/predictions.py
@ -18,6 +29,8 @@ WORKDIR /app
RUN export SACRED_IGNORE_GIT=TRUE RUN export SACRED_IGNORE_GIT=TRUE
RUN /bin/bash -c "source ~/.bashrc && pyenv install 3.11.3 && pyenv global 3.11.3 && mlflow run . -P epochs=10" SHELL ["/bin/bash", "-c"]
RUN source ~/.bashrc && mlflow run . -P epochs=10
CMD ["python3", "predictions.py"] CMD ["python3", "predictions.py"]