Skip to content

Commit

Permalink
#100 verbose dockerfile, reduce six/idna versions
Browse files Browse the repository at this point in the history
```
(api) ➜  api git:(dev) ✗ pipenv graph
Flask-Cors==3.0.8
  - Flask [required: >=0.9, installed: 1.1.1]
    - click [required: >=5.1, installed: 7.0]
    - itsdangerous [required: >=0.24, installed: 1.1.0]
    - Jinja2 [required: >=2.10.1, installed: 2.11.1]
      - MarkupSafe [required: >=0.23, installed: 1.1.1]
    - Werkzeug [required: >=0.15, installed: 1.0.0]
  - Six [required: Any, installed: 1.11.0]
fuzzywuzzy==0.18.0
google-cloud==0.34.0
google-cloud-automl==0.10.0
  - google-api-core [required: >=1.14.0,<2.0.0dev, installed: 1.16.0]
    - google-auth [required: >=0.4.0,<2.0dev, installed: 1.11.2]
      - cachetools [required: >=2.0.0,<5.0, installed: 4.0.0]
      - pyasn1-modules [required: >=0.2.1, installed: 0.2.8]
        - pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
      - rsa [required: >=3.1.4,<4.1, installed: 4.0]
        - pyasn1 [required: >=0.1.3, installed: 0.4.8]
      - setuptools [required: >=40.3.0, installed: 45.2.0]
      - six [required: >=1.9.0, installed: 1.11.0]
    - googleapis-common-protos [required: >=1.6.0,<2.0dev, installed: 1.51.0]
      - protobuf [required: >=3.6.0, installed: 3.11.3]
        - setuptools [required: Any, installed: 45.2.0]
        - six [required: >=1.9, installed: 1.11.0]
    - protobuf [required: >=3.4.0, installed: 3.11.3]
      - setuptools [required: Any, installed: 45.2.0]
      - six [required: >=1.9, installed: 1.11.0]
    - pytz [required: Any, installed: 2019.3]
    - requests [required: >=2.18.0,<3.0.0dev, installed: 2.23.0]
      - certifi [required: >=2017.4.17, installed: 2019.11.28]
      - chardet [required: >=3.0.2,<4, installed: 3.0.4]
      - idna [required: >=2.5,<3, installed: 2.6]
      - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.8]
    - setuptools [required: >=34.0.0, installed: 45.2.0]
    - six [required: >=1.10.0, installed: 1.11.0]
grpcio==1.27.2
  - six [required: >=1.5.2, installed: 1.11.0]
gunicorn==20.0.4
  - setuptools [required: >=3.0, installed: 45.2.0]
marshmallow==3.5.0
mysql-connector-python==8.0.18
  - protobuf [required: >=3.0.0, installed: 3.11.3]
    - setuptools [required: Any, installed: 45.2.0]
    - six [required: >=1.9, installed: 1.11.0]
nltk==3.4.5
  - six [required: Any, installed: 1.11.0]
pandas==1.0.1
  - numpy [required: >=1.13.3, installed: 1.18.1]
  - python-dateutil [required: >=2.6.1, installed: 2.8.1]
    - six [required: >=1.5, installed: 1.11.0]
  - pytz [required: >=2017.2, installed: 2019.3]
PyDrive==1.3.1
  - google-api-python-client [required: >=1.2, installed: 1.7.11]
    - google-auth [required: >=1.4.1, installed: 1.11.2]
      - cachetools [required: >=2.0.0,<5.0, installed: 4.0.0]
      - pyasn1-modules [required: >=0.2.1, installed: 0.2.8]
        - pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
      - rsa [required: >=3.1.4,<4.1, installed: 4.0]
        - pyasn1 [required: >=0.1.3, installed: 0.4.8]
      - setuptools [required: >=40.3.0, installed: 45.2.0]
      - six [required: >=1.9.0, installed: 1.11.0]
    - google-auth-httplib2 [required: >=0.0.3, installed: 0.0.3]
      - google-auth [required: Any, installed: 1.11.2]
        - cachetools [required: >=2.0.0,<5.0, installed: 4.0.0]
        - pyasn1-modules [required: >=0.2.1, installed: 0.2.8]
          - pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
        - rsa [required: >=3.1.4,<4.1, installed: 4.0]
          - pyasn1 [required: >=0.1.3, installed: 0.4.8]
        - setuptools [required: >=40.3.0, installed: 45.2.0]
        - six [required: >=1.9.0, installed: 1.11.0]
      - httplib2 [required: >=0.9.1, installed: 0.17.0]
    - httplib2 [required: >=0.9.2,<1dev, installed: 0.17.0]
    - six [required: >=1.6.1,<2dev, installed: 1.11.0]
    - uritemplate [required: >=3.0.0,<4dev, installed: 3.0.1]
  - oauth2client [required: >=4.0.0, installed: 4.1.3]
    - httplib2 [required: >=0.9.1, installed: 0.17.0]
    - pyasn1 [required: >=0.1.7, installed: 0.4.8]
    - pyasn1-modules [required: >=0.0.5, installed: 0.2.8]
      - pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
    - rsa [required: >=3.1.4, installed: 4.0]
      - pyasn1 [required: >=0.1.3, installed: 0.4.8]
    - six [required: >=1.6.1, installed: 1.11.0]
  - PyYAML [required: >=3.0, installed: 5.3]
python-Levenshtein==0.12.0
  - setuptools [required: Any, installed: 45.2.0]
scikit-learn==0.20.2
  - numpy [required: >=1.8.2, installed: 1.18.1]
  - scipy [required: >=0.13.3, installed: 1.4.1]
    - numpy [required: >=1.13.3, installed: 1.18.1]
spacy==2.2.3
  - blis [required: >=0.4.0,<0.5.0, installed: 0.4.1]
    - numpy [required: >=1.15.0, installed: 1.18.1]
  - catalogue [required: >=0.0.7,<1.1.0, installed: 1.0.0]
    - importlib-metadata [required: >=0.20, installed: 1.5.0]
      - zipp [required: >=0.5, installed: 3.0.0]
  - cymem [required: >=2.0.2,<2.1.0, installed: 2.0.3]
  - murmurhash [required: >=0.28.0,<1.1.0, installed: 1.0.2]
  - numpy [required: >=1.15.0, installed: 1.18.1]
  - plac [required: >=0.9.6,<1.2.0, installed: 1.1.3]
  - preshed [required: >=3.0.2,<3.1.0, installed: 3.0.2]
    - cymem [required: >=2.0.2,<2.1.0, installed: 2.0.3]
    - murmurhash [required: >=0.28.0,<1.1.0, installed: 1.0.2]
  - requests [required: >=2.13.0,<3.0.0, installed: 2.23.0]
    - certifi [required: >=2017.4.17, installed: 2019.11.28]
    - chardet [required: >=3.0.2,<4, installed: 3.0.4]
    - idna [required: >=2.5,<3, installed: 2.6]
    - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.8]
  - setuptools [required: Any, installed: 45.2.0]
  - srsly [required: >=0.1.0,<1.1.0, installed: 1.0.1]
  - thinc [required: >=7.3.0,<7.4.0, installed: 7.3.1]
    - blis [required: >=0.4.0,<0.5.0, installed: 0.4.1]
      - numpy [required: >=1.15.0, installed: 1.18.1]
    - cymem [required: >=2.0.2,<2.1.0, installed: 2.0.3]
    - murmurhash [required: >=0.28.0,<1.1.0, installed: 1.0.2]
    - numpy [required: >=1.7.0, installed: 1.18.1]
    - plac [required: >=0.9.6,<1.2.0, installed: 1.1.3]
    - preshed [required: >=1.0.1,<3.1.0, installed: 3.0.2]
      - cymem [required: >=2.0.2,<2.1.0, installed: 2.0.3]
      - murmurhash [required: >=0.28.0,<1.1.0, installed: 1.0.2]
    - srsly [required: >=0.0.6,<1.1.0, installed: 1.0.1]
    - tqdm [required: >=4.10.0,<5.0.0, installed: 4.43.0]
    - wasabi [required: >=0.0.9,<1.1.0, installed: 0.6.0]
  - wasabi [required: >=0.4.0,<1.1.0, installed: 0.6.0]
SQLAlchemy==1.3.13
(api) ➜  api git:(dev) ✗
```

```
(api) ➜  api git:(dev) ✗ heroku logs --app calpoly-csai-nimbus
2020-03-02T08:01:19.806986+00:00 heroku[web.1]: Starting process with command `gunicorn flask_api:app --config\=gunicorn_config.py`
2020-03-02T08:01:22.276799+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [5] [INFO] Starting gunicorn 20.0.4
2020-03-02T08:01:22.277463+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [5] [INFO] Listening at: http://0.0.0.0:38916 (5)
2020-03-02T08:01:22.277573+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [5] [INFO] Using worker: sync
2020-03-02T08:01:22.282709+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [8] [INFO] Booting worker with pid: 8
2020-03-02T08:01:22.367627+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [9] [INFO] Booting worker with pid: 9
2020-03-02T08:01:22.400087+00:00 app[web.1]: [2020-03-02 08:01:22 +0000] [10] [INFO] Booting worker with pid: 10
2020-03-02T08:01:22.946439+00:00 heroku[web.1]: State changed from starting to up
2020-03-02T08:08:50.405217+00:00 heroku[router]: at=info method=POST path="/ask" host=calpoly-csai-nimbus.herokuapp.com request_id=a6a0b483-feb8-4231-9ec5-15a849a190cc fwd="129.65.145.159" dyno=web.1 connect=0ms service=3150ms status=200 bytes=259 protocol=https
2020-03-02T08:08:59.178981+00:00 heroku[router]: at=info method=POST path="/ask" host=calpoly-csai-nimbus.herokuapp.com request_id=53bc6125-0257-4f25-a4b3-fc6f04386aa5 fwd="129.65.145.159" dyno=web.1 connect=0ms service=2014ms status=200 bytes=261 protocol=https
```
  • Loading branch information
mfekadu committed Mar 2, 2020
1 parent a9c087a commit 48336b0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ RUN apt-get update \
&& pip3 install --upgrade pip \
&& chmod 777 /usr/lib/python3/dist-packages/*

# verify permissions set
RUN ls -lah /usr/lib/python3/dist-packages/

# put the requirements file into the container
ADD requirements.txt /nimbus/requirements.txt

# install the requirements in the container
RUN pip install -r /nimbus/requirements.txt
RUN pip install -r /nimbus/requirements.txt \
&& chmod 777 /usr/lib/python3/dist-packages/*

# verify permissions set
RUN ls -lah /usr/lib/python3/dist-packages/

# put all the code into nimbus folder
ADD . /nimbus


# # https://devcenter.heroku.com/articles/container-registry-and-runtime#unsupported-dockerfile-commands
# # Expose is NOT supported by Heroku
# EXPOSE 8080
Expand Down Expand Up @@ -80,6 +86,9 @@ RUN ls | grep config
# need set WORKDIR for gunicorn
WORKDIR /nimbus

# verify permissions set
RUN ls -lah /usr/lib/python3/dist-packages/

# https://github.com/heroku/alpinehelloworld/blob/master/Dockerfile
# Heroku will set the PORT environment variable
# the gunicorn_config.py will check the env vars for PORT
Expand Down
4 changes: 3 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ scikit-learn = "==0.20.2"
## used to generate settings.yml
PyYAML = "==5.3"
## avoid PermissionError: [Errno 13] Permission denied
six = "==1.13.0"
## for more context see issue #100
six = "==1.11.0"
idna = "==2.6"
## because google-auth 1.11.2 wants setuptools>=40.3.0
setuptools = ">=40.3.0"

Expand Down
28 changes: 15 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ googleapis-common-protos==1.51.0
grpcio==1.27.2
gunicorn==20.0.4
httplib2==0.17.0
idna==2.9
idna==2.6
importlib-metadata==1.5.0
itsdangerous==1.1.0
Jinja2==2.11.1
Expand All @@ -44,7 +44,7 @@ requests==2.23.0
rsa==4.0
scikit-learn==0.20.2
scipy==1.4.1
six==1.13.0
six==1.11.0
spacy==2.2.3
SQLAlchemy==1.3.13
srsly==1.0.1
Expand Down

0 comments on commit 48336b0

Please sign in to comment.