{"action":"created","issue":{"url":"https://api.github.com/repos/onfsdn/faucet/issues/12","repository_url":"https://api.github.com/repos/onfsdn/faucet","labels_url":"https://api.github.com/repos/onfsdn/faucet/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/onfsdn/faucet/issues/12/comments","events_url":"https://api.github.com/repos/onfsdn/faucet/issues/12/events","html_url":"https://github.com/onfsdn/faucet/pull/12","id":172238420,"number":12,"title":"Fix static setup location","user":{"login":"leonexis","id":3529333,"avatar_url":"https://avatars.githubusercontent.com/u/3529333?v=3","gravatar_id":"","url":"https://api.github.com/users/leonexis","html_url":"https://github.com/leonexis","followers_url":"https://api.github.com/users/leonexis/followers","following_url":"https://api.github.com/users/leonexis/following{/other_user}","gists_url":"https://api.github.com/users/leonexis/gists{/gist_id}","starred_url":"https://api.github.com/users/leonexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonexis/subscriptions","organizations_url":"https://api.github.com/users/leonexis/orgs","repos_url":"https://api.github.com/users/leonexis/repos","events_url":"https://api.github.com/users/leonexis/events{/privacy}","received_events_url":"https://api.github.com/users/leonexis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-19T23:27:24Z","updated_at":"2016-08-31T17:16:52Z","closed_at":"2016-08-22T00:53:53Z","pull_request":{"url":"https://api.github.com/repos/onfsdn/faucet/pulls/12","html_url":"https://github.com/onfsdn/faucet/pull/12","diff_url":"https://github.com/onfsdn/faucet/pull/12.diff","patch_url":"https://github.com/onfsdn/faucet/pull/12.patch"},"body":"Resolves #11 by using `sys.prefix` in `setup.py`, `faucet.py`, and `gauge.py` if it detects that Faucet is being installed or run in a virtual envrionment. Any other case keeps the default locations.\r\n\r\nTests were performed in two scenarios: Global installation (currently working and documented method) and installation within a virtual environment created by `virtualenv`. \r\n\r\n* Global Install\r\n  * New Ubuntu 16.04 VM created with prereqs required by Faucet installed globally\r\n    * Required manually installing pip 8.1.2 as ryu 4.5 dependencies fail to install with the default pip 8.1.1 provided by Ubuntu 16.04 (you can see this fail when you build the Faucet Docker.tests container, but ryu is already installed so the test still passes).\r\n  * Faucet installed by using `sudo pip install <faucet_location>`\r\n    * Confirmed configuration files placed in `/etc/ryu/faucet` both before and after changes\r\n  * Replaced default config with simple config for testing with Mininet\r\n  * Confirmed Faucet working by running `sudo ryu-manager $faucet_prefix/ryu_faucet/org/onfsdn/faucet/faucet.py` where `faucet_prefix=$(pip show ryu-faucet | grep ^Location: | awk -e '{print $2}')`\r\n  * Ran `sudo mn --test pingpair --mac --controller remote,<ip>:6633`. Mininet was run in a different VM.\r\n* Virtual Environment Install\r\n  * New Ubuntu 16.04 VM created with prereqs required by Python and `virtualenv` only\r\n    * Used standard system pip 8.1.1 as `virtualenv` automatically installs the latest pip in the created virtual environment.\r\n  * New virtual environment created using `virtualenv ~/faucet-dev/venv` as an unprivileged user\r\n  * Copied Faucet to `~/faucet-dev/faucet`\r\n  * Faucet installed by using `pip install ~/faucet-dev/faucet` inside the activated virtual environment\r\n    * Current master fails as it tries to write to `/etc/ryu/faucet` as an unprivileged user\r\n    * These changes cause install to pass with default config placed in `~/faucet-dev/venv/etc/ryu/faucet/`\r\n  * Confirmed Faucet working by running `ryu-manager ~/faucet-dev/faucet/ryu_faucet/org/onfsdn/faucet/faucet.py` in the activated virtual environment as an unprivileged user. (after changes only)\r\n  * Ran `sudo mn --test pingpair --mac --controller remote,<ip>:6633`. Again, Mininet was run in a different VM. (after changes only)\r\n\r\nThe full test suite is available at https://github.com/inside-openflow/faucet-vagrant-tests which I put together to test Faucet installations in different environments. It tested more than I described here. \r\n\r\nThe only thing I'm unsure about are the changes to the documentation. Also, this is my first pull-request I filed on github. Feedback is appreciated.\r\n"},"comment":{"url":"https://api.github.com/repos/onfsdn/faucet/issues/comments/243835088","html_url":"https://github.com/onfsdn/faucet/pull/12#issuecomment-243835088","issue_url":"https://api.github.com/repos/onfsdn/faucet/issues/12","id":243835088,"user":{"login":"leonexis","id":3529333,"avatar_url":"https://avatars.githubusercontent.com/u/3529333?v=3","gravatar_id":"","url":"https://api.github.com/users/leonexis","html_url":"https://github.com/leonexis","followers_url":"https://api.github.com/users/leonexis/followers","following_url":"https://api.github.com/users/leonexis/following{/other_user}","gists_url":"https://api.github.com/users/leonexis/gists{/gist_id}","starred_url":"https://api.github.com/users/leonexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonexis/subscriptions","organizations_url":"https://api.github.com/users/leonexis/orgs","repos_url":"https://api.github.com/users/leonexis/repos","events_url":"https://api.github.com/users/leonexis/events{/privacy}","received_events_url":"https://api.github.com/users/leonexis/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T17:16:52Z","updated_at":"2016-08-31T17:16:52Z","body":"I should also mention that the PR included two commits. The first one removed the first slash in all cases, the second one put it back except if it could tell if it was in a venv."}}
{"actor":{"display_login":"leonexis"}}