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

Official Docker image and documentation #850

Closed
wants to merge 5 commits into from

Conversation

JDiPierro
Copy link
Contributor

@JDiPierro JDiPierro commented Jul 25, 2018

For #849 :)

Adds a basic Dockerfile that starts from python:3.6 and a includes custom startup script that allows you to start in any mode.

Includes a first attempt at documentation.

I added a Travis stage to build the image but for releasing I think the better approach is for someone to create a DockerHub account for locustio and set up an automated build for the repository. I believe they do security scanning on the resulting image as well.

Let me know if there's any docs changes, extra features, etc you'd like to see or if I can help with the DockerHub setup. I'm hanging around the Slack server as @JDiPierro as well :D

@codecov
Copy link

codecov bot commented Jul 25, 2018

Codecov Report

Merging #850 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #850   +/-   ##
=======================================
  Coverage   66.55%   66.55%           
=======================================
  Files          14       14           
  Lines        1438     1438           
  Branches      226      226           
=======================================
  Hits          957      957           
  Misses        430      430           
  Partials       51       51

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 c59360e...cb624eb. Read the comment docs.

@cgoldberg
Copy link
Member

thanks for this!
I'd like a few maintainers to give this a review and try it out, so we are able to maintain it and answer questions that come up.
@aldenpeterson-wf @mbeacom can you guys give this a look and try it out when you have a chance?

I've found it easier to run locust locally in standalone mode while developing the locustfile.
The example docker-compose file still exists though.
@heyman
Copy link
Member

heyman commented Aug 15, 2018

Hey! I think having an official Docker image for Locust would be great.

Do we really need the docker_start.sh shell-script? It introduces a new API and interface that you have to "learn" to use Locust with Docker. Couldn't we just set the Docker entrypoint to the locust binary?

@@ -11,6 +11,8 @@ matrix:
env: TOXENV=py34
- python: 2.7
env: TOXENV=py27
- stage: Verify Docker image builds
script: docker build -t locustio/locust .
Copy link
Member

Choose a reason for hiding this comment

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

Can we update this to push latest if the branch is master?

@@ -0,0 +1,10 @@
FROM python:3.6
Copy link
Member

Choose a reason for hiding this comment

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

I think we should use either alpine or slim-stretch variants to reduce the image size.

@@ -0,0 +1,25 @@
#!/usr/bin/env bash

if [ -z "${TARGET_URL}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

While I agree we should handle env vars for all of these settings, I think we should handle these at the app leveland simply take whatever the $@ entrypoint is, defaulting to locust. This allows the user to modify their entry as necessary and simply pass the envvars to be used.


```
FROM locustio/locust
ADD locustfile.py locustfile.py
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should discourage the usage of ADD for the user's locustfile.py and document mounting a directory with the locustfile.py instead.

@@ -0,0 +1,25 @@
version: "3.4"
Copy link
Member

Choose a reason for hiding this comment

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

I'm all for using the latest docker-compose syntax version, but maybe we could pin at 3 to increase availability/adoption.

@sekka1
Copy link

sekka1 commented Sep 25, 2018

I have tried the docker image as is in this PR branch and it works great! There was a Locust Helm chart in the stable repository that hasn't been updated in about a year. I made all of the changes necessary to do the update to v0.9.0 and also added a bunch of other Kubernetes items in there to make it work a little nicer like nodeSelectors/Taints and an Ingress.

I have this PR for the Helm Chart update but I should probably wait for an official image instead of using the image in my Docker Hub repo. Here is the updated Chart: https://github.com/helm/charts/compare/master...sekka1:with-v0.9.0?expand=1#diff-c9789cc33518b31f9230b6284b2b6116R4

The last response to the updates was about a month ago. I'm happy to continue on if @JDiPierro is too busy now.

Thoughs @mbeacom

@cgoldberg
Copy link
Member

I'm happy to continue on if @JDiPierro is too busy now.

@sekka1 this PR was superseded by #882 , which has already been merged... so Docker stuff is in master branch now. Could you give it a try?

I am going to close this one now.

@cgoldberg cgoldberg closed this Sep 25, 2018
@sekka1
Copy link

sekka1 commented Sep 25, 2018

The Docker image in Master works for me.

@cgoldberg Is there any plans for an official Locust Docker hub image?

@quorak
Copy link

quorak commented Jan 14, 2019

It would be great to release the image to an official account. This account looks like scam https://hub.docker.com/r/locustio/locust , though not sure if it actually is.

https://hub.docker.com/r/_/locust would be great !

@swarupdonepudi
Copy link

Is this docker image built and pushed to a public registry yet?

@swarupdonepudi
Copy link

Is this docker image built and pushed to a public registry yet?

Nevermind. There is an ongoing discussion around this topic - #849

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.

7 participants