{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto-admin/issues/103","labels_url":"https://api.github.com/repos/prestodb/presto-admin/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto-admin/issues/103/comments","events_url":"https://api.github.com/repos/prestodb/presto-admin/issues/103/events","html_url":"https://github.com/prestodb/presto-admin/pull/103","id":122873258,"number":103,"title":"Mode switching","user":{"login":"ebd2","id":12751788,"avatar_url":"https://avatars.githubusercontent.com/u/12751788?v=3","gravatar_id":"","url":"https://api.github.com/users/ebd2","html_url":"https://github.com/ebd2","followers_url":"https://api.github.com/users/ebd2/followers","following_url":"https://api.github.com/users/ebd2/following{/other_user}","gists_url":"https://api.github.com/users/ebd2/gists{/gist_id}","starred_url":"https://api.github.com/users/ebd2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebd2/subscriptions","organizations_url":"https://api.github.com/users/ebd2/orgs","repos_url":"https://api.github.com/users/ebd2/repos","events_url":"https://api.github.com/users/ebd2/events{/privacy}","received_events_url":"https://api.github.com/users/ebd2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-18T03:44:58Z","updated_at":"2015-12-18T18:32:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prestodb/presto-admin/pulls/103","html_url":"https://github.com/prestodb/presto-admin/pull/103","diff_url":"https://github.com/prestodb/presto-admin/pull/103.diff","patch_url":"https://github.com/prestodb/presto-admin/pull/103.patch"},"body":"Fun times in the world of doing different things for different implementations.\r\nThis serves two purposes:\r\n1. This provides a user-friendly way to switch back and forth between managing a YARN-slider managed cluster and a standalone cluster, which is provided with the new 'mode' subcommand.\r\n2. We want the user experience and interface to remain pretty consistent for people managing standalone and YARN-slider managed presto installations. This is done by setting up the imports in __init__.py such that (for example) the commands to start and stop a cluster are exposed through the 'server' subcommand whether you're managing a standalone or YARN-slider managed cluster.\r\n\r\nprestoadmin/__init__.py is responsible for importing the right modules and setting up __all__ correctly for main.py to pick it up and load the tasks from the correct modules.\r\n\r\nprestoadmin/mode.py is responsible for getting and updating the mode.\r\n\r\nEverything else followed from those changes:\r\n* Moving slider install/uninstall into their own module avoided having a bizarre subcommand exception and weird handling for them\r\n* The product tests now need to have a mode.json file installed, so there are now two ModeInstallers.\r\n* Getting the help tests to run was heinous, and getting them to both run in the same test run required some sleuthing to figure out what global state was getting modified (state.env.commands).\r\n* The existing slider product tests had to be updated to use the new subcommands."},"comment":{"url":"https://api.github.com/repos/prestodb/presto-admin/issues/comments/165865272","html_url":"https://github.com/prestodb/presto-admin/pull/103#issuecomment-165865272","issue_url":"https://api.github.com/repos/prestodb/presto-admin/issues/103","id":165865272,"user":{"login":"rschlussel","id":10963789,"avatar_url":"https://avatars.githubusercontent.com/u/10963789?v=3","gravatar_id":"","url":"https://api.github.com/users/rschlussel","html_url":"https://github.com/rschlussel","followers_url":"https://api.github.com/users/rschlussel/followers","following_url":"https://api.github.com/users/rschlussel/following{/other_user}","gists_url":"https://api.github.com/users/rschlussel/gists{/gist_id}","starred_url":"https://api.github.com/users/rschlussel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rschlussel/subscriptions","organizations_url":"https://api.github.com/users/rschlussel/orgs","repos_url":"https://api.github.com/users/rschlussel/repos","events_url":"https://api.github.com/users/rschlussel/events{/privacy}","received_events_url":"https://api.github.com/users/rschlussel/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T18:32:48Z","updated_at":"2015-12-18T18:32:48Z","body":"The rest looks good"}}