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 with Travis CI integration #99

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

jstarcher
Copy link

@jstarcher jstarcher commented Feb 16, 2017

Adding an Alpine based Docker image with Travis CI builds
docker run --rm -t jstarcher/siege -d1 -r10 -c25 example.com

@jstarcher jstarcher changed the title Official Docker Image Official Docker Image with Travis CI integration Feb 17, 2017
Copy link
Owner

@JoeDog JoeDog left a comment

Choose a reason for hiding this comment

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

Could you help me understand what this implements? I'm not familiar with docker? Does this create new dependencies?

@jstarcher
Copy link
Author

jstarcher commented Feb 20, 2017

Actually it's the other way around. This PR does a few things:

  • Docker is a platform for running and managing containers and this allows people to run siege with a pre-build image. The advantage to using Alpine linux as the base image is that this entire image is now only 11.3mb which is the full linux OS + Siege v4.0.3rc3. By having an official image it allows folks to run siege with the same OS and dependencies to eliminate any guess work. If someone is having a segfault on ubuntu but on on centos for example, then it takes some effort to get to the bottom of this. With docker, the image can be run on any host OS but the container environment will be exactly the same so the results are consistent and reproducible.

  • By having this docker image you can easily run the example command above and a one line command it'll run siege. No need to compile siege or install from any package managers. If you have Docker installed on Windows or Mac, you can run the same command and it'll run the linux container under those environments as well without any dependency issues.

  • This is also super useful for testing with a cluster using something like Swarm, Kubernetes, AWS ECS, etc. With this image I was able to make a few clicks in the AWS ECS UI and create a testing cluster as large as I wanted. I could spin up 25 VMs for example, run the test, and spin them down. This can be extremely useful for large scale testing.

  • With the Travis CI integration I added you are getting a very very basic CI setup which is really useful as well. Anytime a new tag is pushed, the code will get compiled and an example siege test will run. If the code fails to compile or if it segfaults when the test tries to run, the build will fail and we'll all be able to see that in the status badge.

Hope this clears it up!

Cheers

@adamrights
Copy link

We've been using Siege w/Docker at Dowjones for stress/regression tests on many of the WSJ.com properties.

@@ -0,0 +1,10 @@
FROM frolvlad/alpine-glibc:alpine-3.5

Choose a reason for hiding this comment

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

I would feel uneasy about relying on an unofficial base image.

Copy link

@futjikato futjikato Jul 29, 2017

Choose a reason for hiding this comment

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

I agree. But the problem is that alpine uses musl libc and so we have to get some glibc package in there because otherwise siege will just segfault.
Some other potential solution is to use an official alpine image and install https://github.com/sgerrand/alpine-pkg-glibc in the dockerfile but that means we rely on that as a somewhat sketchy other thingy.

rm -rf build
mkdir build

docker run --rm -t -v $PWD/build:/opt/siege -v $PWD/compile.sh:/opt/compile.sh ubuntu bash /opt/compile.sh

Choose a reason for hiding this comment

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

Personally, I like using the virtual package option of apk to install dependencies, compile, then uninstall dependencies - all in one layer. That way a single docker build results in a light, functional image - without the need for intermediary containers as in line 6.

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.

None yet

6 participants