Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
152d1aa
Dockerfile working
Mar 31, 2021
3f3a412
Comment
Mar 31, 2021
c6d12c1
One more comment
Mar 31, 2021
c947e1a
Debugging
Apr 4, 2021
5734687
Fixed bug, docker working again (4/4/21)
Apr 5, 2021
0c0723c
Formatting
Apr 5, 2021
f50beab
updating main.yml
Apr 5, 2021
e98e18a
Push all edits to new branch. Automatically builds
Apr 5, 2021
9a8bfeb
Add documentation for docker run commands in main README
Apr 7, 2021
c41fb00
docker.readme
BaileyMatrascia Apr 7, 2021
8cf6ab6
Merge docker fork to docker branch (#81)
enpuyou Apr 7, 2021
bb723ac
Correction to readme docker windows build
ahance27 Apr 7, 2021
3fc1413
Delete dockerbuild file
Apr 7, 2021
2665794
Change test.yml to main.yml
Apr 7, 2021
0cc8bc5
Merge branch 'master' into docker-image-updated-38(v2)
antlet Apr 7, 2021
b17c006
Fixed Dockerfile from fork
Apr 8, 2021
4987d59
Merge branch 'master' into docker-image-updated-38(v2)
noorbuchi Apr 14, 2021
5f79d58
Fix path cuased by change of scipt names
enpuyou Apr 14, 2021
2bf6c8b
Fix path in README due to file name changed
enpuyou Apr 14, 2021
8afb127
Comment out the local image run commad
enpuyou Apr 14, 2021
75e2100
Change port to 8501
enpuyou Apr 14, 2021
5c4ad24
Correction to Python Version Comment
ahance27 Apr 14, 2021
e627698
Removed unnecessary comment
ahance27 Apr 14, 2021
b1fbce8
Change maintainer names
Apr 14, 2021
2091931
Corrections and Deletions to dockerfile
ahance27 Apr 14, 2021
1dfddc0
Delete comment
Apr 14, 2021
20eb753
Changes made regarding "EXPOSE 8501" Command
ahance27 Apr 14, 2021
7a15767
Numpy deletion in pipfile
ahance27 Apr 14, 2021
ac3c45a
Added mac scripts to main folder
ahance27 Apr 14, 2021
ee5bd89
Deleted docker scripts folder, scripts now in main folder
ahance27 Apr 14, 2021
21bf78b
Delete readme_docker.md
antlet Apr 21, 2021
01ed646
Delete docker-build.yml
BennyWestsyde Apr 28, 2021
2aa4b23
Merge branch 'master' into docker-image-updated-38(v2)
antlet Apr 28, 2021
c0e4422
Merge branch 'master' into docker-image-updated-38(v2)
corlettim Apr 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/docker-build.yml
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 }}
73 changes: 73 additions & 0 deletions Dockerfile
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"]

LABEL version="0.1.0"

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"

# 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/

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

CMD ["pipenv", "run", "streamlit", "run", "streamlit_web.py"]
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pytest = "*"
pytest-cov = "*"

[packages]
numpy = "~=1.20.2"
matplotlib = "*"
gensim = "~=3.8.3"
spacy = "~=2.3"
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![codecov](https://codecov.io/gh/Allegheny-Ethical-CS/GatorMiner/branch/master/graph/badge.svg)](https://codecov.io/gh/Allegheny-Ethical-CS/GatorMiner)
[![Built with spaCy](https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg)](https://spacy.io)
[![Built with Streamlit](https://img.shields.io/badge/built%20with-Streamlit-09a3d5.svg)](https://www.streamlit.io/)
[![Docker Build](https://github.com/BennyWestsyde/GatorMiner/actions/workflows/dockerbuild.yml/badge.svg)](https://github.com/BennyWestsyde/GatorMiner/actions/workflows/dockerbuild.yml)
![Docker Image Version (latest by date)](https://img.shields.io/docker/v/bennywestsyde/gatorminer?label=Last%20Built%20and%20Pushed)
Comment on lines +7 to +8
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 Allegheny-Ethical-CS organization


An automated text-mining tool written in Python to measure the technical
responsibility of students in computer science courses, being used to analyze
Expand Down Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 scripts folder and thus they might not be found. Please make sure to test these more. Lastly, the readme only includes steps for mac and windows (sad Linux noises). It would be great if you can the steps for popular Linux distribution like Ubuntu.

Copy link
Contributor

Choose a reason for hiding this comment

The 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)
Expand Down
24 changes: 24 additions & 0 deletions readme_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
README File For Running Docker Container

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:

##### Development command

```sh
docker run -it -v "$(pwd):/gatorminer" -d -p 8080:8501 gatorminer
```

### Windows:

##### Building:
Run ``` sh docker_run_win.sh ``` for windows
##### Running:
2 changes: 2 additions & 0 deletions scripts/docker_build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo [+] (Win_OS) Building Docker Container.
docker build -t gatorminer .
3 changes: 3 additions & 0 deletions scripts/docker_build.sh
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 .
2 changes: 2 additions & 0 deletions scripts/docker_run.bat
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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

4 changes: 4 additions & 0 deletions scripts/docker_run.sh
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"
docker run -it -d -p 8080:8501 gatorminer
Copy link
Collaborator

@noorbuchi noorbuchi Apr 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the way that the docker image is being run is inconsistent across scripts.

In the Windows script:

docker container run --name devi -d -p 8501:8501 bennywestsyde/gatorminer

This command is first checking if the image exists locally and if not, it's trying to download and build it from docker hub. This is a great approach but it also means that the docker build command is not really necessary because the command will take care of it. Note: the local machine port here is 8501

On the other hand:

docker run -it -d -p 8080:8501 gatorminer

this command will check if the image exists locally but it will not be able to find it through docker hub if it doesn't exist locally. This is because the organization is not specified. It will still try to build it if it's not present. Also Note: the local machine port here is 8080, which is different than the previous command

Personally, I think that you should not create the scripts and instead simply list the correct docker run command with the organization and repository name in the README file. If you prefer to keep the scripts, I don't think that they should be split up into the docker_build and docker_run since docker run command generally takes care of building the image if it doesn't exist locally.

Please feel free to ask questions on this comment if you need clarifications

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is noted. I apologize for the change in the port number. I was using 8080 while 8501 is occupied with another locally running streamlit instance. It is being changed back to 8501 in the latest commits.

I agree with @noorbuchi that there is probably no need for a script file just for the run command. But I do appreciate the separation of build and run, especially that the build command could be more complex if we are dealing with deployment and version releases. Again, open to suggestions, what do you think @BennyWestsyde?

On another note, is there a specific reason @BennyWestsyde that you chose --name devi as the container name in the command?