-
Notifications
You must be signed in to change notification settings - Fork 8
Add Docker image #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Docker image #80
Changes from 16 commits
152d1aa
3f3a412
c6d12c1
c947e1a
5734687
0c0723c
f50beab
e98e18a
9a8bfeb
c41fb00
8cf6ab6
bb723ac
3fc1413
2665794
0cc8bc5
b17c006
4987d59
5f79d58
2bf6c8b
8afb127
75e2100
5c4ad24
e627698
b1fbce8
2091931
1dfddc0
20eb753
7a15767
ac3c45a
ee5bd89
21bf78b
01ed646
2aa4b23
c0e4422
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Docker Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| docker: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Get current date | ||
| id: date | ||
| run: echo "::set-output name=date::$(date +'%m-%d-%Y')" | ||
|
|
||
| - name: Login to DockerHub | ||
| if: github.ref == 'refs/heads/master' | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Convert Github Organization to Lowercase | ||
| run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV | ||
|
|
||
| - name: Build and push | ||
| id: docker_build | ||
| uses: docker/build-push-action@v2 | ||
| with: | ||
| push: true | ||
| tags: ${{ env.IMAGE_REPOSITORY }}:${{steps.date.outputs.date}} | ||
|
|
||
| - name: Image digest | ||
| run: echo ${{ steps.docker_build.outputs.digest }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Python 3.8 | ||
| FROM python:3.9 | ||
|
|
||
| EXPOSE 8501 | ||
|
|
||
| # SHELL ["/bin/bash", "--login", "-c"] | ||
antlet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| LABEL version="0.1.0" | ||
antlet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| LABEL description="An automated text-mining tool written in Python to measure \ | ||
| the technical responsibility of students in computer science courses, being \ | ||
| used to analyze students' markdown reflection documents and five questions \ | ||
| survey based on Natural Language Processing in the Department of Computer \ | ||
| Science at Allegheny College." | ||
|
|
||
| LABEL maintainer="Group 5" | ||
antlet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # ENV LANG C.UTF-8 | ||
| # ENV LANGUAGE C.UTF-8 | ||
| # # ENV LC_ALL C.UTF-8 | ||
| # RUN groupadd -r student && \ | ||
| # useradd -m -r -g student -d /home/student -s /usr/sbin/nologin -c "student User" student && \ | ||
| # mkdir -p /home/student/workdir && \ | ||
| # chown -R student:student /home/student | ||
| # COPY . /home/student/GATORMINER/ | ||
ahance27 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| COPY . /gatorminer | ||
|
|
||
| WORKDIR /gatorminer | ||
|
|
||
| RUN set -e && echo "Installing Pipenv..." \ | ||
| && pip install pipenv \ | ||
| && echo "Installing dependencies..." \ | ||
| && pipenv install --dev --skip-lock \ | ||
| && echo "Installing SpaCy models..." \ | ||
| && pipenv run python -m spacy download en_core_web_sm \ | ||
| && pipenv run python -m spacy download en_core_web_md | ||
|
|
||
| # USER root | ||
|
|
||
| # RUN apt-get -y -qq update | ||
| # RUN apt-get install -y make build-essential python3-distutils python3-dev libssl-dev zlib1g-dev \ | ||
| # libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | ||
| # libncursesw5-dev xz-utils libffi-dev liblzma-dev python-openssl git curl file | ||
| # ENV HOME /home/student | ||
| # WORKDIR /home/student/GATORMINER | ||
| # VOLUME ["/home/student/GATORMINER"] | ||
|
|
||
| # VOLUME = /src/ | ||
| # RUN curl https://pyenv.run | bash | ||
| # ENV PATH="$HOME/.pyenv/bin:${PATH}" | ||
| # RUN export PATH="$HOME/.pyenv/bin:${PATH}" | ||
| # RUN echo 'alias python="python3.9"' >> ~/.profile | ||
| # RUN echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc | ||
| # RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc | ||
| # RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc | ||
| # RUN /bin/bash -c "source ~/.bashrc" | ||
| # RUN /bin/bash -c "source ~/.profile" | ||
| # RUN pyenv install 3.9.2 | ||
| # RUN pyenv global 3.9.2 | ||
| # RUN pyenv local 3.9.2 | ||
| # RUN /bin/bash --login | ||
| # RUN curl https://bootstrap.pypa.io/get-pip.py -o ~/get-pip.py | ||
| # RUN pyenv exec python ~/get-pip.py | ||
| # RUN pyenv exec python -m pip install pipenv | ||
| # RUN pyenv exec pipenv run python -m pip install Cython wheel setuptools watchdog | ||
| # RUN pyenv exec pipenv install --skip-lock --dev | ||
| # RUN pyenv exec pipenv run spacy download en_core_web_sm | ||
| # USER student | ||
| # ENV USER student | ||
| # CMD pyenv exec pipenv run streamlit run streamlit_web.py | ||
antlet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| CMD ["pipenv", "run", "streamlit", "run", "streamlit_web.py"] | ||
antlet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |
| [](https://codecov.io/gh/Allegheny-Ethical-CS/GatorMiner) | ||
| [](https://spacy.io) | ||
| [](https://www.streamlit.io/) | ||
| [](https://github.com/BennyWestsyde/GatorMiner/actions/workflows/dockerbuild.yml) | ||
|  | ||
|
Comment on lines
+7
to
+8
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These links to @BennyWestsyde personal fork of the project, please make sure to change them to the correct links to the original project in |
||
|
|
||
| An automated text-mining tool written in Python to measure the technical | ||
| responsibility of students in computer science courses, being used to analyze | ||
|
|
@@ -50,6 +52,20 @@ pipenv run python -m spacy download en_core_web_sm | |
| pipenv run python -m spacy download en_core_web_md | ||
| ``` | ||
|
|
||
| Alternatively, run a Docker container with all necessary dependencies and Spacy models installed. | ||
|
|
||
| Run the Docker container for Mac: | ||
|
|
||
| ```bash | ||
| sh docker_run_mac.sh | ||
| ``` | ||
|
|
||
| Run the Docker container for Windows: | ||
|
|
||
| ``` | ||
| docker_run_win.bat | ||
| ``` | ||
|
|
||
|
Comment on lines
+55
to
+68
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be nice to include the steps to run the tool in Docker under its own subheader. This way users can quickly identify that there is an available docker image that they could use. Additionally, I think that you should include more information here about what type of command-line arguments the scripts are using. This is useful for users interested in specifics. Also, the file names used in these commands are not actually present. There is a discrepancy in the file names and their paths, the commands do not specify that the files are in the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. About the operating system, I feel the Mac command should just work as well on a Linux machine? This should be further tested out and the instruction in the documentation will need to be updated. |
||
| ## Web Interface | ||
|
|
||
| GatorMiner is mainly developed on its web interface with [Streamlit](https://www.streamlit.io) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| README File For Running Docker Container | ||
antlet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The Docker Container contains all of the necessary dependencies and Spacey models already installed | ||
| therefore Gator Miner can be run without downloading everything locally on your machine. | ||
|
|
||
| Run the code below to utilize the Docker Container | ||
|
|
||
| ### Mac: | ||
|
|
||
| ##### Building: | ||
| Run ```sh docker_build_mac.sh``` for mac | ||
| ##### Running: | ||
enpuyou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ##### Development command | ||
antlet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```sh | ||
| docker run -it -v "$(pwd):/gatorminer" -d -p 8080:8501 gatorminer | ||
| ``` | ||
|
|
||
| ### Windows: | ||
|
|
||
| ##### Building: | ||
| Run ``` sh docker_run_win.sh ``` for windows | ||
| ##### Running: | ||
enpuyou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @echo [+] (Win_OS) Building Docker Container. | ||
| docker build -t gatorminer . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| printf "\n[+] (Mac) Building Docker Container" | ||
| docker build -t gatorminer . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @echo [+] (Win_OS) Running Docker Container. | ||
| docker container run --name devi -d -p 8501:8501 bennywestsyde/gatorminer && echo "\n\tYou can now view your Streamlit app in your browser.\n\n\tNetwork URL: http://localhost:8501 \n\tExternal URL: http://141.195.4.17:8501" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this is using @BennyWestsyde docker image, please make sure to change this once the docker image is published to the Allegheny CS Department docker hub organization |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
| # printf "\n[+] (Mac) Running Docker Container" | ||
| # docker container run --name devi -d -p 8501:8501 bennywestsyde/gatorminer && echo "\n\tYou can now view your Streamlit app in your browser.\n\n\tNetwork URL: http://localhost:8501 \n\tExternal URL: http://141.195.4.17:8501" | ||
enpuyou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| docker run -it -d -p 8080:8501 gatorminer | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.