Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.

Conversation

@bcongdon
Copy link
Member

@bcongdon bcongdon commented Aug 24, 2017

  • Now using volumes to live-reload development code from projects that support this
    • Some services like the api-gateway won't work like this, you'll have to still rebuild the container because the gateway needs to be recompiled
  • Set the -u flag on api-gateway to not require gateway authentication while doing dev work
  • Set debug environment variables to allow python services to live-reload

This can be merged as-is, but if we want full live-reload support we'll need:

  • A way to live-reload node services -- maybe nodemon?
  • A way to live-reload ruby services -- I think Sinatra supports this, we just have to set a development flag somewhere

Additionally, we'll need to patch the Dockerfiles for Ruby services to move wait-for-it out of the application source directory. See acm-uiuc/groot-users-service#15 for an example

Ruby service dockerfiles needing patch:

  • groot-users-service
  • groot-auth-stub-service
  • groot-merch-service
  • groot-quotes-service
  • groot-recruiters-service

@bcongdon
Copy link
Member Author

@sameetandpotatoes: I think we can use Sinatra::Reloader for our ruby services? http://www.sinatrarb.com/contrib/reloader

@narendasan
Copy link
Member

how do we deploy this (like removing the -u flag)?
is it possible to create a hook or something to trigger a script in a container (for rebuilding the gateway) or should we just kill that container and restart it?
If containers are killed can we spin them backup automatically?
In this PR or a separate one can we also add the unified env file as well?

@bcongdon
Copy link
Member Author

@narendasan:

  1. We have a separate prod docker-compose file
  2. This isn't possible within docker-compose, but there are other solutions using something like nodemon that could emulate this. I'd prefer to have services that can reload themselves manage that themselves, as there's less restart overhead from docker that way. I'll look into a livereload solution for the api gateway.
  3. It looks like if you docker kill a container, it doesn't restart. If the container processes crashes, or otherwise exits, it does restart. However, running docker-compose up will start any containers that need to be started.
  4. Yeah, that'll take some more work, but that's still on my radar.

@bcongdon
Copy link
Member Author

bcongdon commented Sep 3, 2017

This can be merged as-is. The work to add live-reloading to Ruby / Node / Go services can be tracked in separate issues:

#48
#49
acm-uiuc/groot-api-gateway#69

Copy link
Member

@sameetandpotatoes sameetandpotatoes left a comment

Choose a reason for hiding this comment

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

Just one comment, lgtm otherwise

- db
- groot-api-gateway
volumes:
- ./groot-users-service:/usr/src/app
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add RACK_ENV=development to the ruby services? Or is development assumed by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Development is the default

@bcongdon bcongdon merged commit a8b7e02 into master Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants