{"action":"created","issue":{"url":"https://api.github.com/repos/luci/luci-py/issues/143","repository_url":"https://api.github.com/repos/luci/luci-py","labels_url":"https://api.github.com/repos/luci/luci-py/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/luci/luci-py/issues/143/comments","events_url":"https://api.github.com/repos/luci/luci-py/issues/143/events","html_url":"https://github.com/luci/luci-py/issues/143","id":65274853,"number":143,"title":"Add optional dimension filtering in task request, e.g. allow a dimension to be a list instead of a single value","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/luci/luci-py/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/luci/luci-py/labels/Module-SwarmServ","name":"Module-SwarmServ","color":"ededed"},{"url":"https://api.github.com/repos/luci/luci-py/labels/Priority-2","name":"Priority-2","color":"ededed"},{"url":"https://api.github.com/repos/luci/luci-py/labels/Type-Feature","name":"Type-Feature","color":"ededed"},{"url":"https://api.github.com/repos/luci/luci-py/labels/Usability","name":"Usability","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-30T18:41:43Z","updated_at":"2016-04-20T23:29:50Z","closed_at":null,"body":"```\nGoal:\nGuarantee a minimum throughput for each consumer teams/project by assigning \ndedicated pools to subteams by dedicating bots.\n\nUse case:\nLet's say there's dedicated pool of 10 devices for team A, another pool of 10 \nfor team B, and a 40 shared pool usable by both team A, B and C. Teams A and B \nare guaranteed basic throughput and can each expand on the shared pool of 40 \nbots. Team C is \"free riding\" the shared pool. This is orthogonal to task \npriority, so that each team can stomp on each other with higher priority task \nas needed.\n\nThe way to specify that is that you state an optional dimension:\n  ./swarming.py trigger ... -d lab sharedpool -d lab teamApool\n\nIt would allow a device assigned to the team A dedicated pool or one in the \nshared tool, whatever is available first. Note that priorities are still taken \nin account, it just enables more seamless sharing of different pools to get \ndedicated throughput.\n\n\nImplementation:\nhttps://code.google.com/p/swarming/source/browse/services/swarming/server/task_t\no_run.py#45\nTaskToRun is the key hash. What we'd want is the hash to be a list. The way to \ndo this is to add a new property:\nhashes = ndb.IntegerProperty(repeated=True, indexed=False)\nso that the loop at \nhttps://code.google.com/p/swarming/source/browse/services/swarming/server/task_t\no_run.py#345\nwould do instead:\nif not any(h in accepted_dimensions_hash for h in task_key.hashes):\n\nThe change can be done live by enabling the store of the new property in \nTaskToRun first, waiting for all pending tasks since the instance switch over \nto be done, then switching yield_next_available_task_to_dispatch() to use the \nnew logic and stop using the entity key.\n\n\n\nNon-use case:\n[This is already supported and listed for demonstrative purposes]\nA select number of bots have a specific configurations. Let's say they are \nequipped for performance tests that require a sensor to be associated with it. \nThe layout would be as follow:\nperf bots would have dimension depending on their physical setup:\n- {'temperature_sensor': '1', 'camera': '0'}\n- {'temperature_sensor': '0', 'camera': '1'} \n- {'temperature_sensor': '1', ''camera': '1'}\nnormal bots would have dimension {'temperature_sensor': '0', 'camera': '0'}\n\nFor use case where a camera recording the screen is needed, the request could \nbe:\n{'camera': '1'}\nso that bots with or without 'temperature_sensor': '1' would be used.\n\nBut bots with a temperature sensor are rare and will likely be starved! The \nright way to handle this use case is to use higher priority for tasks that \nrequires limited throughput bots. This is why closely tuning priorities is \nimportant.\n\n```\n\nOriginal issue reported on code.google.com by `maruel@chromium.org` on 15 Aug 2014 at 4:04"},"comment":{"url":"https://api.github.com/repos/luci/luci-py/issues/comments/212651340","html_url":"https://github.com/luci/luci-py/issues/143#issuecomment-212651340","issue_url":"https://api.github.com/repos/luci/luci-py/issues/143","id":212651340,"user":{"login":"kenrussell","id":1149904,"avatar_url":"https://avatars.githubusercontent.com/u/1149904?v=3","gravatar_id":"","url":"https://api.github.com/users/kenrussell","html_url":"https://github.com/kenrussell","followers_url":"https://api.github.com/users/kenrussell/followers","following_url":"https://api.github.com/users/kenrussell/following{/other_user}","gists_url":"https://api.github.com/users/kenrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/kenrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenrussell/subscriptions","organizations_url":"https://api.github.com/users/kenrussell/orgs","repos_url":"https://api.github.com/users/kenrussell/repos","events_url":"https://api.github.com/users/kenrussell/events{/privacy}","received_events_url":"https://api.github.com/users/kenrussell/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T23:29:50Z","updated_at":"2016-04-20T23:29:50Z","body":"Thanks for the suggestions. I just found that the GPU vendor irrespective of GPU device is already there, so \"--dimension gpu 10de\" already works. Never mind my particular use case, since it's already supported."}}