Hi all. I’m inexperienced with AWS, Docker and Streamlit. So, the not-that-competent trifecta.
What I’d like to do is run a streamlit app, based on a file called interact_top20.py on EC2. The application runs fine in Docker on EC2. My challenge has been integrating streamlit so I can change the interaction model from a web front end rather than interaction through the terminal.
I’ve gotten to the point where I can ‘docker build’ and ‘docker run’ by modifying a teammate’s Docker file. I get the ‘Welcome to Streamlit!’ screen after running it, but I’m not given either the Network or External URL. I’ve included a screenshot of the message that’s returned.
And here’s my Dockerfile. Would appreciate any pointers.
FROM ubuntu:18.04
COPY . /app
WORKDIR /app
MAINTAINER Loreto Parisi loretoparisi@gmail.com
######################################## BASE SYSTEM
# set noninteractive installation
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y apt-utils
RUN apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
tzdata \
curl
############################# Required to run streamlit? https://discuss.streamlit.io/t/how-to-use-streamlit-in-docker/1067
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
iemail = \"\"\n\
" > /root/.streamlit/credentials.toml'
# WAS ORIGINALL false CHANGING TO true
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = true\n\
" > /root/.streamlit/config.toml'
####################################3
# open port for Streamlit
EXPOSE 8501
######################################## PYTHON3
#RUN apt-get install -y \
# python3 \
# python3-pip
#
RUN apt-get install -y python3
#RUN apt install pip
RUN apt-get remove python-pip python3-pip
RUN apt install -y python3-pip
RUN pip3 install --upgrade pip
RUN pip3 uninstall transformers
# set local timezone
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
# transfer-learning-conv-ai
ENV PYTHONPATH /usr/local/lib/python3.6
COPY . ./
COPY requirements.txt /tmp/requirements.txt
#####
#RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#RUN python3 get-pip.py
#RUN apt install python3-pip
RUN pip3 install numpy
RUN pip3 install setuptools
RUN pip3 install ez_setup
RUN pip3 install pandas
RUN pip3 install nltk
RUN pip3 install statistics
RUN pip3 install tensorflow
RUN pip3 install tensorflow_hub
RUN pip3 install transformers
RUN pip3 install --upgrade transformers
#RUN pip3 install re
RUN pip3 list
RUN python3 get_resources.py
#####
#RUN pip3 install -r /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
# model zoo
RUN mkdir models && \
curl https://s3.amazonaws.com/models.huggingface.co/transfer-learning-chatbot/finetuned_chatbot_gpt.tar.gz > models/finetuned_chatbot_gpt.tar.gz && \
cd models/ && \
tar -xvzf finetuned_chatbot_gpt.tar.gz && \
rm finetuned_chatbot_gpt.tar.gz
#CMD ["bash"]
#streamlit run interact_top20.py
#RUN streamlit interact_top20.py
RUN pip install streamlit
# ENTRYPOINT ["streamlit","run"]
CMD ["streamlit", "run", "interact_top20.py", "model openai-gpt"]