Skip to content
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

Add Docker image #80

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 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 }}
37 changes: 37 additions & 0 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Docker Build

on:
schedule:
- cron: "*/60 */24 * * 0"
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: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
version: ${{steps.date.outputs.date}}
push: true
tags: bennywestsyde/gatorminer:${{steps.date.outputs.date}}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
11 changes: 6 additions & 5 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS]
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install Pipenv
run: |
pip install pipenv --upgrade
- name: Setup Pipenv
uses: dschep/install-pipenv-action@v1
- name: Install dependencies
run: |
pipenv install --dev --skip-lock
# install dependencies according to the lock file
pipenv install --dev --ignore-pipfile --python ${{ steps.setup-python.outputs.python-version }}
pipenv run python -m spacy download en_core_web_sm
- name: Run test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .mdlrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rules "~MD013"
rules "~MD013, ~MD033"
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ before_install:
# install pyenv with travis-pyenv
- wget https://github.com/praekeltfoundation/travis-pyenv/releases/latest/download/setup-pyenv.sh
- source setup-pyenv.sh
# install mdl to check markdown
- gem install chef-utils -v 16.6.14
# install mdl to check markdown beep
- gem install mdl

notifications:
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ code contribution.
### Development Environment

In order to contribute code or documentation to the project, the project
maintainers suggest installing the release of Python versions above 3.6. You can
maintainers suggest installing the release of Python versions above 3.7. You can
learn more about installing and managing python versions with `pyenv` from
[here](https://realpython.com/intro-to-pyenv/). In addition to installing `Git` to
access the project's GitHub repository, you should also install `Pipenv` for its
Expand Down Expand Up @@ -108,9 +108,9 @@ pipenv run streamlit run streamlit_web.py
#### Develop GatorMiner on Windows

GatorMiner depends on gensim, and gensim requires Microsoft Visual C++ 14.0+. You can check the version you have from
`Control Panel -> Programs and Features`. To download or update this, go to the
[Visual Studio 2019 Downloads](https://visualstudio.microsoft.com/downloads/), scroll down and
expand the `Tools for Visual Studio 2019` and click the download link for `Build tools for Visual Studio 2019`.
`Control Panel -> Programs and Features`. To download or update this, go to the
[Visual Studio 2019 Downloads](https://visualstudio.microsoft.com/downloads/), scroll down and
expand the `Tools for Visual Studio 2019` and click the download link for `Build tools for Visual Studio 2019`.

Once the installer is downloaded, launch it and select the `C++ build tools` option under `Desktop and Mobile`.
After that select install at the bottom and wait.
Expand All @@ -120,7 +120,7 @@ installing, the installer will ask to restart the computer to finish the install
After your computer has finished installing the C++ build tools, you may need to reinstall the dependencies. To do this,
just run the `pipenv install --dev` command as previously instructed.

If you still receive the error, delete the `Pipfile.lock` file in the root of the GatorMiner directory and reinstall
If you still receive the error, delete the `Pipfile.lock` file in the root of the GatorMiner directory and reinstall
using the previous command.

#### Test GatorMiner with Sample Data
Expand Down
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.8

EXPOSE 8501

SHELL ["/bin/bash", "--login", "-c"]

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.
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.
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.
Show resolved Hide resolved

CMD ["pipenv", "run", "streamlit", "run", "streamlit_web.py"]
antlet marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 4 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ pytest = "*"
pytest-cov = "*"

[packages]
numpy = "~=1.20.2"
antlet marked this conversation as resolved.
Show resolved Hide resolved
matplotlib = "*"
gensim = '*'
gensim = "~=3.8.3"
spacy = "~=2.3"
sklearn = "*"
pytest = "*"
requests = "*"
commonmark = "*"
codecov = "*"
streamlit = "*"
streamlit = "~=0.78.0"
altair = "*"
textblob = "*"
scipy = "*"
pylint = "*"
importlib-metadata = "*"

[pipenv]
allow_prereleases = true
Loading