Travis Cl builds failing Python/Django

  django, docker, python, travis-ci

New dev here and am working on a course that has me using Docker and Travis Cl to build a restful API. My builds started off fine, but am now currently getting constant build failures (possible note of relevance, did have a small power outage and after ran docker-compose build again). I’ve looked and cannot for the life of me figure out what I’m missing at this point. Any advice appreciated. Please let me know if you need any other info. TIA


Worker information

0.17s0.00s0.01s0.00s0.01s
system_info

Build system information

0.02s0.01s0.46s0.23s0.05s0.00s0.04s0.00s0.01s0.01s0.01s0.01s0.01s0.00s0.00s0.03s0.00s0.01s0.36s0.00s0.00s0.00s0.01s0.01s0.10s0.01s0.82s0.00s0.12s6.03s0.00s2.79s0.00s2.61s
docker_mtu_and_registry_mirrors
resolvconf
services

3.02s$ sudo systemctl start docker
git.checkout

0.41s$ git clone --depth=50 --branch=main https://github.com/Ash-Renee/Recipe-App-API.git Ash-Renee/Recipe-App-API

0.01s

Setting environment variables from repository settings

$ export DOCKER_USERNAME=[secure]

$ export DOCKER_PASSWORD=[secure]

0.01s$ source ~/virtualenv/python3.6/bin/activate

$ python --version

Python 3.6.7

$ pip --version

pip 20.1.1 from /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pip (python 3.6)
before_install

0.61s$ echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin

Pip version 20.3 introduces changes to the dependency resolver that may affect your software.

We advise you to consider testing the upcoming changes, which may be introduced in a future Travis CI build image update.

See https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020 for more information.

install

6.66s$ pip install -r requirements.txt
before_script

7.59s$ pip install docker-compose

17.50s$ docker-compose run app sh -c "python manage.py test && flake8"

Creating network "recipe-app-api_default" with the default driver

Building app

Step 1/10 : FROM python:3.7-alpine

3.7-alpine: Pulling from library/python

Digest: sha256:210d832835b56fe6c8e9f5d9ced848cf5f0e12211d39af52f0583b31f1bd197e

Status: Downloaded newer image for python:3.7-alpine

 ---> 93ac4b41defe

Step 2/10 : MAINTAINER Ash Renee

 ---> Running in c1bd26dcd23b

Removing intermediate container c1bd26dcd23b

 ---> cbc64a5017f3

Step 3/10 : ENV PYTHONUNBUFFERED 1

 ---> Running in 4d9cfa36cd0b

Removing intermediate container 4d9cfa36cd0b

 ---> 928e8e400bd0

Step 4/10 : COPY ./requirements.txt /requirements.txt

 ---> 259b10f79f95

Step 5/10 : RUN pip install -r /requirements.txt

 ---> Running in f95ed035eae8

Collecting Django==3.2.5

  Downloading Django-3.2.5-py3-none-any.whl (7.9 MB)

Collecting djangorestframework<3.9.0,>=3.8.2

  Downloading djangorestframework-3.8.2-py2.py3-none-any.whl (923 kB)

Collecting flake8<3.7.0,>=3.6.0

  Downloading flake8-3.6.0-py2.py3-none-any.whl (68 kB)

Collecting pytz

  Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB)

Collecting asgiref<4,>=3.3.2

  Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)

Collecting sqlparse>=0.2.2

  Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)

Collecting pyflakes<2.1.0,>=2.0.0

  Downloading pyflakes-2.0.0-py2.py3-none-any.whl (53 kB)

Requirement already satisfied: setuptools>=30 in /usr/local/lib/python3.7/site-packages (from flake8<3.7.0,>=3.6.0->-r /requirements.txt (line 4)) (57.0.0)

Collecting mccabe<0.7.0,>=0.6.0

  Downloading mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)

Collecting pycodestyle<2.5.0,>=2.4.0

  Downloading pycodestyle-2.4.0-py2.py3-none-any.whl (62 kB)

Collecting typing-extensions

  Downloading typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)

Installing collected packages: typing-extensions, sqlparse, pytz, pyflakes, pycodestyle, mccabe, asgiref, flake8, djangorestframework, Django

Successfully installed Django-3.2.5 asgiref-3.4.1 djangorestframework-3.8.2 flake8-3.6.0 mccabe-0.6.1 pycodestyle-2.4.0 pyflakes-2.0.0 pytz-2021.1 sqlparse-0.4.1 typing-extensions-3.10.0.0

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Removing intermediate container f95ed035eae8

 ---> 4b3235142023

Step 6/10 : RUN mkdir /app

 ---> Running in 47fa150dab87

Removing intermediate container 47fa150dab87

 ---> 1cff96da89ca

Step 7/10 : WORKDIR /app

 ---> Running in 2c3f471f083f

Removing intermediate container 2c3f471f083f

 ---> e164eb72a3b6

Step 8/10 : COPY ./app/ /app

 ---> 9f6c8e3181c7

Step 9/10 : RUN adduser -D user

 ---> Running in d0cffd8ca7b6

Removing intermediate container d0cffd8ca7b6

 ---> 1c17e25678e8

Step 10/10 : USER user

 ---> Running in d97a863f298e

Removing intermediate container d97a863f298e

 ---> 0bea2abe6b2e

Successfully built 0bea2abe6b2e

Successfully tagged recipe-app-api_app:latest

Image for service app was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.

Creating recipe-app-api_app_run ... 

Creating recipe-app-api_app_run ... done

Creating test database for alias 'default'...

System check identified no issues (0 silenced).

....

----------------------------------------------------------------------

Ran 4 tests in 0.680s

OK

Destroying test database for alias 'default'...

./core/models.py:19:5: E303 too many blank lines (2)

./core/models.py:38:1: W391 blank line at end of file

./core/tests/test_models.py:20:5: E303 too many blank lines (2)

./core/tests/test_models.py:28:5: E303 too many blank lines (2)

./core/tests/test_models.py:34:5: E303 too many blank lines (2)

./core/tests/test_models.py:43:1: W391 blank line at end of file

./core/tests/test_models.py:43:9: E265 block comment should start with '# '

./core/tests/test_models.py:43:36: W292 no newline at end of file

./core/tests/test_models.py:43:36: W292 no newline at end of file

1

The command "docker-compose run app sh -c "python manage.py test && flake8"" exited with 1.

Done. Your build exited with 1.```

Source: Docker Questions

LEAVE A COMMENT