mozilla / ssh_scan_api

An API for ssh_scan (https://github.com/mozilla/ssh_scan) and the backend API service for the Mozilla SSH Observatory (https://observatory.mozilla.org/)
31 stars 12 forks source link

First pass at dockerizing ssh_scan infra #64

Closed claudijd closed 7 years ago

claudijd commented 7 years ago

This is an attempt to dockerize some of the ssh_scan_api project roles (API, DB, and Worker) so they can be more selectively deployed/upgraded/scaled/etc.

claudijd commented 7 years ago

Ok guys, it wasn't pretty, but I basically crash coursed in docker over the past day. Open to a final round of feedback before I land this thing.

claudijd commented 7 years ago

Needs travis.yaml adds for building/uploading.

Also, not really sure how to best conventionally deal with images(prod) vs. build(dev), so any feedback there would be particularly interesting/helpful.

claudijd commented 7 years ago

Lastly, I tried scaling out the workers in two ways thus far...

1.) with the --scale to docker-compose, like so "docker-compose up --scale worker=3" (didn't work, popped help, unclear to me what the issue is) 2.) with version 3/3.1, specifying deploy and a replicas integer (seems to only boot up one worker regardless of integer value)

Any guidance or docker ninjary there would be of assistance.

claudijd commented 7 years ago

I believe the scaling issue to potentially be related to container_name ref in worker group (per some things I've read), but removing it doesn't seem to help with docker-compose up --scale syntax above.

claudijd commented 7 years ago

Figured out the scaling, went with strategy 1 above, had the syntax wrong, removed container names and that worked like a charm.

claudijd commented 7 years ago

Merging what I have now, as it's a decent MVP for the docker deployment. If any of the reviewers have further comments, please drop them here or open an issue and I'll iterate from there.