God.pid_file_directory = '/var/run/perforce/web-services' God.watch do |w| p4webapi_root = '{{ pillar['p4_web_api.dir'] }}' bundle_path = '{{ pillar['p4webapi.ruby.wrappers'] }}/bundle' pid_file = '/var/run/perforce/web-services/p4webapi.pid' w.name = 'p4_web_api' w.interval = 30.seconds w.pid_file = pid_file # unicorn needs to be run from the rails root w.start = "cd #{p4webapi_root} && #{bundle_path} exec unicorn -c config/unicorn.rb" # QUIT gracefully shuts down workers w.stop = "kill -QUIT `cat #{pid_file}`" # USR2 causes the master to re-create itself and spawn a new worker pool w.restart = "kill -USR2 `cat #{pid_file}`" w.start_grace = 10.seconds w.restart_grace = 10.seconds w.uid = 'webservices' w.gid = 'webservices' w.behavior(:clean_pid_file) w.start_if do |start| start.condition(:process_running) do |c| c.interval = 5.seconds c.running = false end end # For more reference see here: # https://github.com/blog/519-unicorn-god end God.watch do |w| p4_project_services_root = '{{ pillar['p4_project_services.dir'] }}' bundle_path = '{{ pillar['p4_project_services.ruby.wrappers'] }}/bundle' pid_file = '/var/run/perforce/web-services/p4_project_services.pid' w.name = 'p4_project_services' w.interval = 30.seconds w.pid_file = pid_file # unicorn needs to be run from the rails root w.start = "cd #{p4_project_services_root} && #{bundle_path} exec puma -C config/puma.rb" # QUIT gracefully shuts down workers w.stop = "kill -QUIT `cat #{pid_file}`" # USR2 causes the master to re-create itself and spawn a new worker pool w.restart = "kill -USR2 `cat #{pid_file}`" w.start_grace = 10.seconds w.restart_grace = 10.seconds w.uid = 'webservices' w.gid = 'webservices' w.behavior(:clean_pid_file) w.start_if do |start| start.condition(:process_running) do |c| c.interval = 5.seconds c.running = false end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#4 | 13689 | tjuricek | Switch from Resque to Sidekiq. | ||
#3 | 13535 | tjuricek |
Add notification_services to deployment, and reconfigure build step to exec bash. The execution bit doesn't seem to stay set on config/bash.sh The notification_services service doesn't have advanced tests just yet. |
||
#2 | 13530 | tjuricek |
Add p4_phoenix_services package and Salt configuration for deployment. This uncovered a couple of issues from the C++ API during it's conversion to C++03. So, in a nutshell, most operations, except for notifications, appear to be working (well, using Vagrant machines). |
||
#1 | 13525 | tjuricek |
Setup God to manage both the p4 web api and p4 project services processes. Apparently, there can only be one true god per machine. |