{"action":"created","comment":{"url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments/54909313","id":54909313,"diff_hunk":"@@ -236,6 +236,9 @@\n STATSD_HOST = os.environ.get('OTM_STATSD_HOST', 'localhost')\n STATSD_CELERY_SIGNALS = True\n \n+CELERY_DEFAULT_QUEUE = STACK_TYPE","path":"opentreemap/opentreemap/settings/default_settings.py","position":4,"original_position":4,"commit_id":"51d878775a8011720c323c20951fb8cf8672b6b1","original_commit_id":"51d878775a8011720c323c20951fb8cf8672b6b1","user":{"login":"hectcastro","id":43639,"avatar_url":"https://avatars.githubusercontent.com/u/43639?v=3","gravatar_id":"","url":"https://api.github.com/users/hectcastro","html_url":"https://github.com/hectcastro","followers_url":"https://api.github.com/users/hectcastro/followers","following_url":"https://api.github.com/users/hectcastro/following{/other_user}","gists_url":"https://api.github.com/users/hectcastro/gists{/gist_id}","starred_url":"https://api.github.com/users/hectcastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectcastro/subscriptions","organizations_url":"https://api.github.com/users/hectcastro/orgs","repos_url":"https://api.github.com/users/hectcastro/repos","events_url":"https://api.github.com/users/hectcastro/events{/privacy}","received_events_url":"https://api.github.com/users/hectcastro/received_events","type":"User","site_admin":false},"body":"`StackType` remains consistent when multiple stacks are deployed within the same environment. I think we want to use `StackColor` here.","created_at":"2016-03-03T16:53:44Z","updated_at":"2016-03-03T16:53:44Z","html_url":"https://github.com/OpenTreeMap/otm-core/pull/2527#discussion_r54909313","pull_request_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527","_links":{"self":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments/54909313"},"html":{"href":"https://github.com/OpenTreeMap/otm-core/pull/2527#discussion_r54909313"},"pull_request":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527"}}},"pull_request":{"url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527","id":61580275,"html_url":"https://github.com/OpenTreeMap/otm-core/pull/2527","diff_url":"https://github.com/OpenTreeMap/otm-core/pull/2527.diff","patch_url":"https://github.com/OpenTreeMap/otm-core/pull/2527.patch","issue_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2527","number":2527,"state":"open","locked":false,"title":"Create celery queues for each stack type","user":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"body":"Intended to allow tasks that originate with one stack to be completed by that\r\nstack, to make background tasks more resilient to code changes.\r\n\r\nConnects to OpenTreeMap/otm-cloud#177\r\n\r\nTo test, I applied this diff to the `otm-cloud` Vagrantfile to create separate VMs each with their own celery worker.\r\n```diff\r\ndiff --git a/Vagrantfile b/Vagrantfile\r\nindex 0b52b75..357cf2e 100644\r\n--- a/Vagrantfile\r\n+++ b/Vagrantfile\r\n@@ -12,7 +12,7 @@ if [\"up\", \"provision\", \"status\"].include?(ARGV.first)\r\n end\r\n\r\n ANSIBLE_GROUPS = {\r\n-  \"app-servers\" => [ \"app\" ],\r\n+  \"app-servers\" => [ \"app\", \"appcopy\" ],\r\n   \"services\" => [ \"services\" ],\r\n   \"modeling\" => [ \"modeling\" ],\r\n   \"monitoring-servers\" => [ \"services\" ],\r\n@@ -138,6 +138,33 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|\r\n     end\r\n   end\r\n\r\n+  config.vm.define \"appcopy\" do |app|\r\n+    app.vm.hostname = \"appcopy\"\r\n+    app.vm.network \"private_network\", ip: ENV.fetch(\"OTM_APP_IP\", \"33.33.34.40\")\r\n+\r\n+    app.vm.synced_folder \".\", \"/vagrant\", disabled: true\r\n+    app.vm.synced_folder \"src/otm-core\", \"/opt/app/core/\"\r\n+    app.vm.synced_folder \"src/otm-addons/\", \"/opt/app/otm-addons/\"\r\n+    app.vm.synced_folder \"src/otm-ecoservice/\", \"/opt/ecoservice/\"\r\n+    app.vm.synced_folder \"src/otm-website/\", \"/opt/website/\"\r\n+\r\n+    # Django via Nginx/Gunicorn\r\n+    app.vm.network \"forwarded_port\", {\r\n+      guest: 80,\r\n+      host: 9090\r\n+    }.merge(VAGRANT_NETWORK_OPTIONS)\r\n+\r\n+    app.vm.provider \"virtualbox\" do |v|\r\n+      v.memory = 1536\r\n+    end\r\n+\r\n+    app.vm.provision \"ansible\" do |ansible|\r\n+      ansible.playbook = \"deployment/ansible/app-servers.yml\"\r\n+      ansible.groups = ANSIBLE_GROUPS.merge(ANSIBLE_ENV_GROUPS)\r\n+      ansible.raw_arguments = [\"--timeout=60\"]\r\n+    end\r\n+  end\r\n+\r\n   config.vm.define \"tiler\" do |tiler|\r\n     tiler.vm.hostname = \"tiler\"\r\n     tiler.vm.network \"private_network\", ip: ENV.fetch(\"OTM_LOCAL_TILER_IP\", \"33.33.34.35\")\r\n```\r\n\r\nI then SSHed to each machine and modified the `OTM_STACK_TYPE` environment variable to be different on each machine.\r\n\r\nAfter that, importing a tree CSV on `localhost:6060` should create tasks only on the `app` Celery worker, and importing a CSV on `localhost:9090` should create tasks only on the `appcopy` Celery worker.\r\n\r\nYou can inspect the reserved Celery tasks for both workers by running the following command on either machine:\r\n```\r\ncd /opt/app/core/opentreemap\r\nenvdir /etc/otm.d/env celery -A \"opentreemap.celery:app\" -b \"redis://33.33.34.30:6379/2\" inspect reserved\r\n```","created_at":"2016-03-03T15:57:28Z","updated_at":"2016-03-03T16:53:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f5805e366199a98fc1c880691f55985c3f8dfc0","assignee":{"login":"jwalgran","id":17363,"avatar_url":"https://avatars.githubusercontent.com/u/17363?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalgran","html_url":"https://github.com/jwalgran","followers_url":"https://api.github.com/users/jwalgran/followers","following_url":"https://api.github.com/users/jwalgran/following{/other_user}","gists_url":"https://api.github.com/users/jwalgran/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalgran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalgran/subscriptions","organizations_url":"https://api.github.com/users/jwalgran/orgs","repos_url":"https://api.github.com/users/jwalgran/repos","events_url":"https://api.github.com/users/jwalgran/events{/privacy}","received_events_url":"https://api.github.com/users/jwalgran/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527/commits","review_comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527/comments","review_comment_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2527/comments","statuses_url":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/51d878775a8011720c323c20951fb8cf8672b6b1","head":{"label":"maurizi:separate-celery-queues","ref":"separate-celery-queues","sha":"51d878775a8011720c323c20951fb8cf8672b6b1","user":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"repo":{"id":11374160,"name":"otm-core","full_name":"maurizi/otm-core","owner":{"login":"maurizi","id":4432106,"avatar_url":"https://avatars.githubusercontent.com/u/4432106?v=3","gravatar_id":"","url":"https://api.github.com/users/maurizi","html_url":"https://github.com/maurizi","followers_url":"https://api.github.com/users/maurizi/followers","following_url":"https://api.github.com/users/maurizi/following{/other_user}","gists_url":"https://api.github.com/users/maurizi/gists{/gist_id}","starred_url":"https://api.github.com/users/maurizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maurizi/subscriptions","organizations_url":"https://api.github.com/users/maurizi/orgs","repos_url":"https://api.github.com/users/maurizi/repos","events_url":"https://api.github.com/users/maurizi/events{/privacy}","received_events_url":"https://api.github.com/users/maurizi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maurizi/otm-core","description":"","fork":true,"url":"https://api.github.com/repos/maurizi/otm-core","forks_url":"https://api.github.com/repos/maurizi/otm-core/forks","keys_url":"https://api.github.com/repos/maurizi/otm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maurizi/otm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maurizi/otm-core/teams","hooks_url":"https://api.github.com/repos/maurizi/otm-core/hooks","issue_events_url":"https://api.github.com/repos/maurizi/otm-core/issues/events{/number}","events_url":"https://api.github.com/repos/maurizi/otm-core/events","assignees_url":"https://api.github.com/repos/maurizi/otm-core/assignees{/user}","branches_url":"https://api.github.com/repos/maurizi/otm-core/branches{/branch}","tags_url":"https://api.github.com/repos/maurizi/otm-core/tags","blobs_url":"https://api.github.com/repos/maurizi/otm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maurizi/otm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maurizi/otm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/maurizi/otm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maurizi/otm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/maurizi/otm-core/languages","stargazers_url":"https://api.github.com/repos/maurizi/otm-core/stargazers","contributors_url":"https://api.github.com/repos/maurizi/otm-core/contributors","subscribers_url":"https://api.github.com/repos/maurizi/otm-core/subscribers","subscription_url":"https://api.github.com/repos/maurizi/otm-core/subscription","commits_url":"https://api.github.com/repos/maurizi/otm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/maurizi/otm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/maurizi/otm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/maurizi/otm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/maurizi/otm-core/contents/{+path}","compare_url":"https://api.github.com/repos/maurizi/otm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maurizi/otm-core/merges","archive_url":"https://api.github.com/repos/maurizi/otm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maurizi/otm-core/downloads","issues_url":"https://api.github.com/repos/maurizi/otm-core/issues{/number}","pulls_url":"https://api.github.com/repos/maurizi/otm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/maurizi/otm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/maurizi/otm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maurizi/otm-core/labels{/name}","releases_url":"https://api.github.com/repos/maurizi/otm-core/releases{/id}","deployments_url":"https://api.github.com/repos/maurizi/otm-core/deployments","created_at":"2013-07-12T17:26:29Z","updated_at":"2015-06-15T19:13:56Z","pushed_at":"2016-03-03T15:51:22Z","git_url":"git://github.com/maurizi/otm-core.git","ssh_url":"git@github.com:maurizi/otm-core.git","clone_url":"https://github.com/maurizi/otm-core.git","svn_url":"https://github.com/maurizi/otm-core","homepage":null,"size":12920,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"OpenTreeMap:develop","ref":"develop","sha":"ac2f965a45242dc7f073dfeab99f9b7153d6d36e","user":{"login":"OpenTreeMap","id":1125635,"avatar_url":"https://avatars.githubusercontent.com/u/1125635?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenTreeMap","html_url":"https://github.com/OpenTreeMap","followers_url":"https://api.github.com/users/OpenTreeMap/followers","following_url":"https://api.github.com/users/OpenTreeMap/following{/other_user}","gists_url":"https://api.github.com/users/OpenTreeMap/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTreeMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTreeMap/subscriptions","organizations_url":"https://api.github.com/users/OpenTreeMap/orgs","repos_url":"https://api.github.com/users/OpenTreeMap/repos","events_url":"https://api.github.com/users/OpenTreeMap/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTreeMap/received_events","type":"Organization","site_admin":false},"repo":{"id":8292625,"name":"otm-core","full_name":"OpenTreeMap/otm-core","owner":{"login":"OpenTreeMap","id":1125635,"avatar_url":"https://avatars.githubusercontent.com/u/1125635?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenTreeMap","html_url":"https://github.com/OpenTreeMap","followers_url":"https://api.github.com/users/OpenTreeMap/followers","following_url":"https://api.github.com/users/OpenTreeMap/following{/other_user}","gists_url":"https://api.github.com/users/OpenTreeMap/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTreeMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTreeMap/subscriptions","organizations_url":"https://api.github.com/users/OpenTreeMap/orgs","repos_url":"https://api.github.com/users/OpenTreeMap/repos","events_url":"https://api.github.com/users/OpenTreeMap/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTreeMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenTreeMap/otm-core","description":"OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.","fork":false,"url":"https://api.github.com/repos/OpenTreeMap/otm-core","forks_url":"https://api.github.com/repos/OpenTreeMap/otm-core/forks","keys_url":"https://api.github.com/repos/OpenTreeMap/otm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenTreeMap/otm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenTreeMap/otm-core/teams","hooks_url":"https://api.github.com/repos/OpenTreeMap/otm-core/hooks","issue_events_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/events{/number}","events_url":"https://api.github.com/repos/OpenTreeMap/otm-core/events","assignees_url":"https://api.github.com/repos/OpenTreeMap/otm-core/assignees{/user}","branches_url":"https://api.github.com/repos/OpenTreeMap/otm-core/branches{/branch}","tags_url":"https://api.github.com/repos/OpenTreeMap/otm-core/tags","blobs_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenTreeMap/otm-core/languages","stargazers_url":"https://api.github.com/repos/OpenTreeMap/otm-core/stargazers","contributors_url":"https://api.github.com/repos/OpenTreeMap/otm-core/contributors","subscribers_url":"https://api.github.com/repos/OpenTreeMap/otm-core/subscribers","subscription_url":"https://api.github.com/repos/OpenTreeMap/otm-core/subscription","commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenTreeMap/otm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenTreeMap/otm-core/contents/{+path}","compare_url":"https://api.github.com/repos/OpenTreeMap/otm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenTreeMap/otm-core/merges","archive_url":"https://api.github.com/repos/OpenTreeMap/otm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenTreeMap/otm-core/downloads","issues_url":"https://api.github.com/repos/OpenTreeMap/otm-core/issues{/number}","pulls_url":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenTreeMap/otm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenTreeMap/otm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenTreeMap/otm-core/labels{/name}","releases_url":"https://api.github.com/repos/OpenTreeMap/otm-core/releases{/id}","deployments_url":"https://api.github.com/repos/OpenTreeMap/otm-core/deployments","created_at":"2013-02-19T15:11:04Z","updated_at":"2016-02-26T15:09:28Z","pushed_at":"2016-03-03T15:57:29Z","git_url":"git://github.com/OpenTreeMap/otm-core.git","ssh_url":"git@github.com:OpenTreeMap/otm-core.git","clone_url":"https://github.com/OpenTreeMap/otm-core.git","svn_url":"https://github.com/OpenTreeMap/otm-core","homepage":"www.opentreemap.org","size":13243,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":334,"forks":45,"open_issues":334,"watchers":74,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527"},"html":{"href":"https://github.com/OpenTreeMap/otm-core/pull/2527"},"issue":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2527"},"comments":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/issues/2527/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/pulls/2527/commits"},"statuses":{"href":"https://api.github.com/repos/OpenTreeMap/otm-core/statuses/51d878775a8011720c323c20951fb8cf8672b6b1"}}}}