-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
There was a problem hiding this 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.
build/openwisp_dashboard/Dockerfile
Outdated
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 \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :-)
4fd1753
to
6461479
Compare
build/openwisp_base/Dockerfile
Outdated
--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 && \ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
fb67a98
to
fe4f0a3
Compare
There was a problem hiding this 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.
build/openwisp_base/Dockerfile
Outdated
--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 && \ |
There was a problem hiding this comment.
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.
80b8eb8
to
af316de
Compare
@nemesisdesign Alright, Updated! 👍 |
Related: #9 #24 #29