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

[testing] Added basic travis-ci tests #23

Merged
merged 1 commit into from
May 26, 2019
Merged

Conversation

atb00ker
Copy link
Member

@atb00ker atb00ker commented May 21, 2019

  • Initial travis tests
  • Changes in docker images to ensure that tests don't take too long. (A following PR will be dedicated to build-time improvements.)

Related: #9 #24 #29

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Great work @atb00ker 👍

I think this can be improved further before proceeding, let me know what you think.

.travis.yml Outdated Show resolved Hide resolved
build/openwisp_radius/Dockerfile Outdated Show resolved Hide resolved
COPY ./openwisp_dashboard/requirements.txt /opt/openwisp/requirements.txt
RUN pip install -r requirements.txt
RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
Copy link
Member

Choose a reason for hiding this comment

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

is it good to use http://dl-cdn.alpinelinux.org/alpine/edge/testing?

From https://wiki.alpinelinux.org/wiki/Edge

Warning: "edge" is under constant development so be careful using it in production. It is possible that bugs in "edge" could cause data loss or could break your system.

@2stacks @hispanico what do you think?

It seems to me that we should use something safer.

Copy link
Member Author

@atb00ker atb00ker May 22, 2019

Choose a reason for hiding this comment

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

Currently gdal-dev geos-dev are only available in edge, alternative would be to compile them, I was initially compiling them but that takes a lot of time and is a maintenance hassle, so for convenience I moved to this.
Let me know if compiling them sounds better. :-)

tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Outdated Show resolved Hide resolved
tests/tests.sh Show resolved Hide resolved
@atb00ker atb00ker force-pushed the travis branch 6 times, most recently from 4fd1753 to 6461479 Compare May 22, 2019 12:00
docker-compose.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
build/openwisp_controller/Dockerfile Outdated Show resolved Hide resolved
build/openwisp_base/Dockerfile Outdated Show resolved Hide resolved
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev geos-dev zlib-dev jpeg-dev openssl-dev libffi-dev gettext gcc && \
apk add --update --virtual .build-deps postgresql-dev git build-base linux-headers && \
pip install --no-cache-dir -r /opt/openwisp/requirements.txt && \
Copy link
Member

Choose a reason for hiding this comment

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

I see now that you do everything in one step, are you doing it to save on image size?

I would separate the part which deal with system packages and the part which deals with the python packages

Copy link
Member Author

Choose a reason for hiding this comment

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

It's done in one step because .build-deps are installed and uninstalled in the same layer to avoid taking useless files to next layer. It's a common practice I've noticed in a lot of other images as well.
The system packages not in .build-deps don't take a lot of time to install, the real thing that takes a lot of time is pip install only, hence, I coupled all of them in one layer.

Should I keep .build-deps with python packages only or move them seperately as well?
(That makes dockerfiles look cleaner but bloats the image to about twice the size.)

Copy link
Member

Choose a reason for hiding this comment

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

how much size increase are we talking about? If it's less than 100 MB, proceed to separate them.

Copy link
Member Author

@atb00ker atb00ker May 25, 2019

Choose a reason for hiding this comment

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

After the new changes, the current size is ~450MBs and seperating will make it around ~570MBs. (However, since this is the base image, all the derived image size will be increased.)
For now, I am seperating them to different steps, since now I know what all are build dependencies, we can put them in one step without a problem in future (as per the size and build time difference in the final images.)

Let me know if your thoughts differ.

tests/tests.sh Show resolved Hide resolved
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

See my last comments and then proceed please. Thanks.

--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
gdal-dev geos-dev zlib-dev jpeg-dev openssl-dev libffi-dev gettext gcc && \
apk add --update --virtual .build-deps postgresql-dev git build-base linux-headers && \
pip install --no-cache-dir -r /opt/openwisp/requirements.txt && \
Copy link
Member

Choose a reason for hiding this comment

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

how much size increase are we talking about? If it's less than 100 MB, proceed to separate them.

build/openwisp_controller/Dockerfile Outdated Show resolved Hide resolved
@atb00ker atb00ker force-pushed the travis branch 5 times, most recently from 80b8eb8 to af316de Compare May 25, 2019 11:30
@atb00ker
Copy link
Member Author

atb00ker commented May 25, 2019

@nemesisdesign Alright, Updated! 👍

@hispanico hispanico merged commit 6851d50 into openwisp:master May 26, 2019
@atb00ker atb00ker deleted the travis branch May 27, 2019 20:00
@atb00ker atb00ker moved this from In progress to Done in [GSOC-19] Dockerize OpenWISP2 May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants