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

Base Locust Docker image on non-alpine python image #1435

Merged
merged 6 commits into from
Jun 17, 2020

Conversation

heyman
Copy link
Member

@heyman heyman commented Jun 17, 2020

This PR makes Locust use the python:3.8 docker image instead of python:3.8-alpine as the base image.

The reason for this is that it'll make it possible to pip install ... most PyPI packages out of the box, which should be a very common thing to do in project specific docker images.

It comes with a ~900 MB cost in total image size, though I think the python:3.8 image should be a very common base image to already have pulled, in which case there will effectively be no higher disk usage, and I think it makes sense to prioritize developer convenience and happiness over disk usage.

This is what the description at the official docker python repo says about the python:3.8 image:

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

We could consider maintaining two branches of docker images (locustio/locust and locustio/locust-alpine), but I don't think it's worth the extra maintenance work.

We would have to bump the Locust version to 1.1 if we release this, since it might break end-users custom docker images (the fixes should be very easy though, and mostly consist of removing a bunch of lines no longer needed from their Dockerfiles).

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #1435 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1435      +/-   ##
==========================================
+ Coverage   81.27%   81.31%   +0.04%     
==========================================
  Files          26       26              
  Lines        2344     2344              
  Branches      362      362              
==========================================
+ Hits         1905     1906       +1     
  Misses        348      348              
+ Partials       91       90       -1     
Impacted Files Coverage Δ
locust/user/task.py 97.26% <0.00%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca8ef51...eb3c183. Read the comment docs.

@cyberw
Copy link
Collaborator

cyberw commented Jun 17, 2020

Nice!

Can we drop the use of a builder image while we’re at it? I dont think it saves much (if anything) in image size now, and it simplifies things a little when users make derived images.

Copy link
Collaborator

@cyberw cyberw left a comment

Choose a reason for hiding this comment

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

Nice. +1

@heyman
Copy link
Member Author

heyman commented Jun 17, 2020

Great! I'll merge this, and then we'll bump the locust version to 1.1 with the next release.

@heyman heyman merged commit 5ea0342 into master Jun 17, 2020
@cyberw cyberw deleted the non-alpine-docker-image branch August 19, 2020 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running locust with docker breaks pip install for some packages
2 participants