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

Introduce docker as a test runner #197

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

Introduce docker as a test runner #197

wants to merge 19 commits into from

Conversation

bigfleet
Copy link
Contributor

A PostGIS installation on Mac OS X over the past period has been problematic to explain.

I am not ready to merge this PR yet, as I want to understand if there's a way to more fluidly mount the working directory inside the container, but this approach does provide an alternative.

All devs are invited to try it out, provide feedback, etc. I make no claims of Docker expertise, but I am beginning to use it in anger.

@bigfleet
Copy link
Contributor Author

This allows developers to change files on the local filesystem in the manner expected and run tests inside the VM. So the objections raised in the ticket posting above are invalid, and I'd consider merging this and WONTFIX'ing #166 .

I am prepared to support Docker as the test-runner of record.

What say you @dirkkelly @masonpackard and others who have landed commits recently?

@migurski
Copy link

Would Postgres.app solve the PostGIS explanation overhead, without introducing the (IMO much bigger) Docker overhead?

@masonpackard
Copy link
Contributor

With the goal of making it easy for a new developer getting up to speed, more automation and standardization may make it relatively painless for someone to start making quick and efficient contributions. Postgis has been one area that was more involved with setting up, at least for me.

So, something like Docker to quickly and more easily setup would be a great. This contribution by @bigfleet may be very helpful. Postgres.app looks interesting, as well. How well or easily does everything with Postgres go, in terms of the setup?

@bigfleet
Copy link
Contributor Author

So http://postgis.net/install/ says Postgres.app ships with Postgis, which is cool! It also says: don't mix me with other Postgres installations. That sounds right to me, I had a student in class try to use it and never recover.

I suppose the question comes down to: what setup does the typical new developer on Citygram have? Are they new enough that I myself ought to convert to Postgres.app to share their experience? The Docker choice here would mean no change for me.

I suppose I see this change as optional-- we still support running the project on your machine natively. This is just an option if you are having build trouble and want to land a commit.

While the project still requires PR's to bring new cities online, our committers may not be Postgres users or even devs.

Thanks for the thoughts, keep them coming.

On Aug 26, 2015, at 9:25 AM, Mason Packard [email protected] wrote:

With the goal of making it easy for a new developer getting up to speed, more automation and standardization may make it relatively painless for someone to start making quick and efficient contributions. Postgis has been one area that was more involved with setting up, at least for me.

So, something like Docker to quickly and more easily setup would be a great. This contribution by @bigfleet may be very helpful. Postgres.app looks interesting, as well. How well or easily does everything with Postgres go, in terms of the setup?


Reply to this email directly or view it on GitHub.

@migurski
Copy link

Yes, I believe it’s correct that you should have only one Postgres on a system. Postgres.app is meant to be the only one, but it’s an easy one to set up if you’re on a Mac.

I’m thrilled with Docker as a deployment tool, but I haven’t seen it make setup easier for new developer who aren’t already Docker users.

@benmoss
Copy link

benmoss commented Aug 27, 2015

I tried it out and it seems to work, but it errors with

Starting citygram_db_1...
rake aborted!
PG::DuplicateDatabase: ERROR:  database "citygram_development" already exists
/usr/src/app/citygram/lib/database_helper.rb:84:in `exec'
/usr/src/app/citygram/lib/database_helper.rb:84:in `docker_create_db'
/usr/src/app/citygram/lib/tasks/database.rake:52:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:docker:create
(See full trace by running task with --trace)

As I said, in spite of that, ./bin/spec still works and all the specs pass. The README you updated does say bin/test instead of bin/spec.

I tried getting the docker-compose run web part to work to run the dev server, but no luck there. I had to change the -b in command: bundle exec rackup -b '0.0.0.0' to -o, which is what I'm guessing you meant, and that got the app to boot, but it seemed like something with the port forwarding wasn't working then. It's supposed to be listening on http://localhost:9292, but not seeing anything there.

@bigfleet
Copy link
Contributor Author

@benmoss Thanks for the feedback! I'll make sure to get those things incorporated (they were not my top priority). I know what's happening with the localhost issue, and can address that with another bin script. I can alter the DB task to make sure that the DB already existing is not an error. If we're going to have Docker, may as well support it fully.

I'm still pondering the Postgres.app proposition. I think, at the end of the day, they're not mutually exclusive. Document them all, and indicate relative levels of support for each. Sound right @migurski?

@migurski
Copy link

I’d link to a page like codeforamerica/howto/PostgreSQL.md for the Postgres step, and let people figure out their stuff from there. Some parts of the setup process are going to be out of scope for Citygram, and you don’t want to have excessive docs that fall out of date.

@bigfleet
Copy link
Contributor Author

bigfleet commented Sep 2, 2015

@migurski Great feedback. I'm going to incorporate the sum total of these changes before resubmitting for reconsideration.

Jon Roes and others added 2 commits February 12, 2016 15:15
implement bin/test, fix Dockerfile apt-get line, update docs
@AtnNn
Copy link

AtnNn commented Feb 1, 2017

I tried getting Citygram running locally using this branch based on @bigfleet's suggestion

  • bin/setup had to be run twice to get Redis and Postgres running in docker
  • To run citygram I had to do docker-compose run -p 9292:9292 citygram and then open http://localhost:9292
  • There were some errors establishing TLS connections. I had to do
    • docker-compose exec citygram_citygram_run_2 apt-get update
    • docker-compose exec citygram_citygram_run_2 apt-get install ca-certificates
  • Then I ran the rake task to download publishers docker-compose exec citygram_citygram_run_2 rake publishers:download
  • A few cities were added to the UI, but there seemed to be no data. Perhaps this branch is too far behind master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants