{"action":"created","comment":{"url":"https://api.github.com/repos/lago-project/lago/pulls/comments/79301140","id":79301140,"diff_hunk":"@@ -108,6 +108,188 @@ with a minimal fedora 23 installation. It will leave any logs under the `logs`\n directory and any generated artifacts under `exported-artifacts`.\n \n \n-\n    .. _`official yapf repo`: https://github.com/google/yapf\n    .. _`copr`: https://copr.Fedoraproject.org/coprs/fulltext/?fulltext=yapf\n+\n+\n+Running Lago in virtualenv\n+---------------------------\n+This was tested on a fresh Fedora-24 Cloud image, but should work on Fedora 23\n+and most likely with little package-names resolving on CentOS >7.\n+\n+Install dependencies::\n+\n+  > sudo dnf install -y redhat-rpm-config libvirt libvirt-devel \\\n+     libguestfs-devel libguestfs-tools qemu-img qemu-kvm \\\n+     libvirt-daemon git gcc libffi-devel python-devel \\\n+     openssl-devel bats python-magic python-libguestfs\n+\n+Note that ``python-magic`` and ``python-libguestfs`` are currently not\n+available on PyPI, so we have to install them from RPMs.\n+\n+Install virtualenv::\n+\n+  > sudo pip install virtualenv\n+\n+Add your user to ``qemu`` group and vice versa::\n+\n+  > sudo usermod -a -G qemu \"$USER\"\n+  > sudo usermod -a -G \"$USER\" qemu\n+\n+Add a polkitd policy to allow your user to connect to libvirtd::\n+\n+  > echo \"polkit.addRule(function(action, subject) {\n+    if (action.id == \\\"org.libvirt.unix.manage\\\" &&\n+       subject.user == \\\"$USER\\\") {\n+          return polkit.Result.YES;\n+          }\n+        }); \" | sudo tee \"/etc/polkit-1/rules.d/50-libvirt-$USER.rules\"\n+\n+Enable nested virtualization(assuming Intel here)::\n+\n+ > echo \"options kvm-intel nested=y\" | sudo tee /etc/modprobe.d/kvm-intel.conf\n+ > sudo bash -c 'modprobe -r kvm_intel && modprobe kvm_intel'\n+\n+Enable libvirtd::\n+\n+ > sudo bash -c 'systemctl enable libvirtd && systemctl start libvirtd'\n+ > sudo bash -c 'systemctl enable virtlogd && systemctl start virtlogd'\n+\n+Update home directory permissions::\n+\n+ > chmod g+x \"$HOME\"\n+\n+We are going to create the following directory structure::\n+\n+ .\n+ ├── data\n+ │   ├── repo - lago repo directory\n+ │   ├── store - lago template store directory\n+ │   └── subnets - lago subnets lease files\n+ ├── lago - lago git repository\n+ └── venv-lago - venv installed modules\n+\n+Create the directories::\n+\n+ > mkdir -p \"$HOME\"/data/{repo,store,subnets}\n+\n+Overriding the ``subnet_lease_dir`` is still not supported, so we will\n+have to create the directory under ``/var/lib/lago``::\n+\n+  > sudo mkdir -p /var/lib/lago\n+  > sudo chown \"$USER:$USER\" /var/lib/lago\n+\n+Create a local ``.lago.conf`` file pointing to our new directory structure::\n+\n+ > cat > \"$HOME/.lago.conf\" << EOF\n+   [lago]\n+   template_store=/home/$USER/data/store\n+   template_repos=/home/$USER/data/repo\n+   subnet_lease_dir=/home/$USER/data/subnets\n+   EOF\n+\n+Setup and activate a virtualenv, dragging the libraries already installed by\n+the RPMs::\n+\n+  > virtualenv --system-site-packages ~/venv-lago && \\\n+      source \"$HOME\"/venv-lago/bin/activate\n+\n+Install Lago's Python dependencies in the newly created virtualenv::\n+\n+  > pip install -I enum dulwich flake8 libvirt-python lockfile \\","path":"docs/Env_Setup.rst","position":102,"original_position":102,"commit_id":"4df1f7710c61619694bdb3417f90c34f5db9ffb0","original_commit_id":"4df1f7710c61619694bdb3417f90c34f5db9ffb0","user":{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false},"body":"To do anything useful in the virtualenv, you would probably need the 'test-requires.txt' and not the minimalistic requirements(i.e. with flake8 and its friends), so I think having \r\n```pip install -r test-requires.txt ``` should suffice.\r\n\r\nMy problem with ```test-requires.txt``` is that it includes 'python-magic', and as far as I understand this is not the actual packge we are using(we use python-magic from the RPMs, which is not found on PyPi). I don't know if its there by mistake or there is some other process in ```automation``` scripts that plants the \"true\" package afterwards. So for now I rather list it explictly until it is resolved. (otherwise you would actually need to run ```bash pip install -r test-requires.txt && pip uninstall python-magic``` ) ","created_at":"2016-09-18T08:50:55Z","updated_at":"2016-09-18T08:50:55Z","html_url":"https://github.com/lago-project/lago/pull/316#discussion_r79301140","pull_request_url":"https://api.github.com/repos/lago-project/lago/pulls/316","_links":{"self":{"href":"https://api.github.com/repos/lago-project/lago/pulls/comments/79301140"},"html":{"href":"https://github.com/lago-project/lago/pull/316#discussion_r79301140"},"pull_request":{"href":"https://api.github.com/repos/lago-project/lago/pulls/316"}}},"pull_request":{"url":"https://api.github.com/repos/lago-project/lago/pulls/316","id":84890543,"html_url":"https://github.com/lago-project/lago/pull/316","diff_url":"https://github.com/lago-project/lago/pull/316.diff","patch_url":"https://github.com/lago-project/lago/pull/316.patch","issue_url":"https://api.github.com/repos/lago-project/lago/issues/316","number":316,"state":"open","locked":false,"title":"Docs - Setup Lago in virtualenv","user":{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false},"body":"Note that this depends on https://github.com/lago-project/lago/pull/312 to work.\r\n","created_at":"2016-09-12T15:19:39Z","updated_at":"2016-09-18T08:50:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d0c955fa5c90720c6183db2fcb0e3f5f590122f","assignee":{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false},"assignees":[{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lago-project/lago/pulls/316/commits","review_comments_url":"https://api.github.com/repos/lago-project/lago/pulls/316/comments","review_comment_url":"https://api.github.com/repos/lago-project/lago/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lago-project/lago/issues/316/comments","statuses_url":"https://api.github.com/repos/lago-project/lago/statuses/4df1f7710c61619694bdb3417f90c34f5db9ffb0","head":{"label":"nvgoldin:docs_venv","ref":"docs_venv","sha":"4df1f7710c61619694bdb3417f90c34f5db9ffb0","user":{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false},"repo":{"id":66766250,"name":"lago","full_name":"nvgoldin/lago","owner":{"login":"nvgoldin","id":13018704,"avatar_url":"https://avatars.githubusercontent.com/u/13018704?v=3","gravatar_id":"","url":"https://api.github.com/users/nvgoldin","html_url":"https://github.com/nvgoldin","followers_url":"https://api.github.com/users/nvgoldin/followers","following_url":"https://api.github.com/users/nvgoldin/following{/other_user}","gists_url":"https://api.github.com/users/nvgoldin/gists{/gist_id}","starred_url":"https://api.github.com/users/nvgoldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvgoldin/subscriptions","organizations_url":"https://api.github.com/users/nvgoldin/orgs","repos_url":"https://api.github.com/users/nvgoldin/repos","events_url":"https://api.github.com/users/nvgoldin/events{/privacy}","received_events_url":"https://api.github.com/users/nvgoldin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nvgoldin/lago","description":"Ad-hoc virtual testing environment framework","fork":true,"url":"https://api.github.com/repos/nvgoldin/lago","forks_url":"https://api.github.com/repos/nvgoldin/lago/forks","keys_url":"https://api.github.com/repos/nvgoldin/lago/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nvgoldin/lago/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nvgoldin/lago/teams","hooks_url":"https://api.github.com/repos/nvgoldin/lago/hooks","issue_events_url":"https://api.github.com/repos/nvgoldin/lago/issues/events{/number}","events_url":"https://api.github.com/repos/nvgoldin/lago/events","assignees_url":"https://api.github.com/repos/nvgoldin/lago/assignees{/user}","branches_url":"https://api.github.com/repos/nvgoldin/lago/branches{/branch}","tags_url":"https://api.github.com/repos/nvgoldin/lago/tags","blobs_url":"https://api.github.com/repos/nvgoldin/lago/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nvgoldin/lago/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nvgoldin/lago/git/refs{/sha}","trees_url":"https://api.github.com/repos/nvgoldin/lago/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nvgoldin/lago/statuses/{sha}","languages_url":"https://api.github.com/repos/nvgoldin/lago/languages","stargazers_url":"https://api.github.com/repos/nvgoldin/lago/stargazers","contributors_url":"https://api.github.com/repos/nvgoldin/lago/contributors","subscribers_url":"https://api.github.com/repos/nvgoldin/lago/subscribers","subscription_url":"https://api.github.com/repos/nvgoldin/lago/subscription","commits_url":"https://api.github.com/repos/nvgoldin/lago/commits{/sha}","git_commits_url":"https://api.github.com/repos/nvgoldin/lago/git/commits{/sha}","comments_url":"https://api.github.com/repos/nvgoldin/lago/comments{/number}","issue_comment_url":"https://api.github.com/repos/nvgoldin/lago/issues/comments{/number}","contents_url":"https://api.github.com/repos/nvgoldin/lago/contents/{+path}","compare_url":"https://api.github.com/repos/nvgoldin/lago/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nvgoldin/lago/merges","archive_url":"https://api.github.com/repos/nvgoldin/lago/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nvgoldin/lago/downloads","issues_url":"https://api.github.com/repos/nvgoldin/lago/issues{/number}","pulls_url":"https://api.github.com/repos/nvgoldin/lago/pulls{/number}","milestones_url":"https://api.github.com/repos/nvgoldin/lago/milestones{/number}","notifications_url":"https://api.github.com/repos/nvgoldin/lago/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nvgoldin/lago/labels{/name}","releases_url":"https://api.github.com/repos/nvgoldin/lago/releases{/id}","deployments_url":"https://api.github.com/repos/nvgoldin/lago/deployments","created_at":"2016-08-28T12:09:57Z","updated_at":"2016-08-28T12:09:58Z","pushed_at":"2016-09-13T08:39:33Z","git_url":"git://github.com/nvgoldin/lago.git","ssh_url":"git@github.com:nvgoldin/lago.git","clone_url":"https://github.com/nvgoldin/lago.git","svn_url":"https://github.com/nvgoldin/lago","homepage":"http://lago.readthedocs.org","size":37829,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lago-project:master","ref":"master","sha":"061207c6cfce8b23a9101ad5fa29af15dd98d739","user":{"login":"lago-project","id":16708442,"avatar_url":"https://avatars.githubusercontent.com/u/16708442?v=3","gravatar_id":"","url":"https://api.github.com/users/lago-project","html_url":"https://github.com/lago-project","followers_url":"https://api.github.com/users/lago-project/followers","following_url":"https://api.github.com/users/lago-project/following{/other_user}","gists_url":"https://api.github.com/users/lago-project/gists{/gist_id}","starred_url":"https://api.github.com/users/lago-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lago-project/subscriptions","organizations_url":"https://api.github.com/users/lago-project/orgs","repos_url":"https://api.github.com/users/lago-project/repos","events_url":"https://api.github.com/users/lago-project/events{/privacy}","received_events_url":"https://api.github.com/users/lago-project/received_events","type":"Organization","site_admin":false},"repo":{"id":49959573,"name":"lago","full_name":"lago-project/lago","owner":{"login":"lago-project","id":16708442,"avatar_url":"https://avatars.githubusercontent.com/u/16708442?v=3","gravatar_id":"","url":"https://api.github.com/users/lago-project","html_url":"https://github.com/lago-project","followers_url":"https://api.github.com/users/lago-project/followers","following_url":"https://api.github.com/users/lago-project/following{/other_user}","gists_url":"https://api.github.com/users/lago-project/gists{/gist_id}","starred_url":"https://api.github.com/users/lago-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lago-project/subscriptions","organizations_url":"https://api.github.com/users/lago-project/orgs","repos_url":"https://api.github.com/users/lago-project/repos","events_url":"https://api.github.com/users/lago-project/events{/privacy}","received_events_url":"https://api.github.com/users/lago-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lago-project/lago","description":"Ad-hoc virtual testing environment framework","fork":false,"url":"https://api.github.com/repos/lago-project/lago","forks_url":"https://api.github.com/repos/lago-project/lago/forks","keys_url":"https://api.github.com/repos/lago-project/lago/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lago-project/lago/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lago-project/lago/teams","hooks_url":"https://api.github.com/repos/lago-project/lago/hooks","issue_events_url":"https://api.github.com/repos/lago-project/lago/issues/events{/number}","events_url":"https://api.github.com/repos/lago-project/lago/events","assignees_url":"https://api.github.com/repos/lago-project/lago/assignees{/user}","branches_url":"https://api.github.com/repos/lago-project/lago/branches{/branch}","tags_url":"https://api.github.com/repos/lago-project/lago/tags","blobs_url":"https://api.github.com/repos/lago-project/lago/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lago-project/lago/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lago-project/lago/git/refs{/sha}","trees_url":"https://api.github.com/repos/lago-project/lago/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lago-project/lago/statuses/{sha}","languages_url":"https://api.github.com/repos/lago-project/lago/languages","stargazers_url":"https://api.github.com/repos/lago-project/lago/stargazers","contributors_url":"https://api.github.com/repos/lago-project/lago/contributors","subscribers_url":"https://api.github.com/repos/lago-project/lago/subscribers","subscription_url":"https://api.github.com/repos/lago-project/lago/subscription","commits_url":"https://api.github.com/repos/lago-project/lago/commits{/sha}","git_commits_url":"https://api.github.com/repos/lago-project/lago/git/commits{/sha}","comments_url":"https://api.github.com/repos/lago-project/lago/comments{/number}","issue_comment_url":"https://api.github.com/repos/lago-project/lago/issues/comments{/number}","contents_url":"https://api.github.com/repos/lago-project/lago/contents/{+path}","compare_url":"https://api.github.com/repos/lago-project/lago/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lago-project/lago/merges","archive_url":"https://api.github.com/repos/lago-project/lago/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lago-project/lago/downloads","issues_url":"https://api.github.com/repos/lago-project/lago/issues{/number}","pulls_url":"https://api.github.com/repos/lago-project/lago/pulls{/number}","milestones_url":"https://api.github.com/repos/lago-project/lago/milestones{/number}","notifications_url":"https://api.github.com/repos/lago-project/lago/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lago-project/lago/labels{/name}","releases_url":"https://api.github.com/repos/lago-project/lago/releases{/id}","deployments_url":"https://api.github.com/repos/lago-project/lago/deployments","created_at":"2016-01-19T14:53:46Z","updated_at":"2016-09-08T12:45:54Z","pushed_at":"2016-09-15T12:56:44Z","git_url":"git://github.com/lago-project/lago.git","ssh_url":"git@github.com:lago-project/lago.git","clone_url":"https://github.com/lago-project/lago.git","svn_url":"https://github.com/lago-project/lago","homepage":"http://lago.readthedocs.org","size":37958,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":87,"forks":22,"open_issues":87,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lago-project/lago/pulls/316"},"html":{"href":"https://github.com/lago-project/lago/pull/316"},"issue":{"href":"https://api.github.com/repos/lago-project/lago/issues/316"},"comments":{"href":"https://api.github.com/repos/lago-project/lago/issues/316/comments"},"review_comments":{"href":"https://api.github.com/repos/lago-project/lago/pulls/316/comments"},"review_comment":{"href":"https://api.github.com/repos/lago-project/lago/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lago-project/lago/pulls/316/commits"},"statuses":{"href":"https://api.github.com/repos/lago-project/lago/statuses/4df1f7710c61619694bdb3417f90c34f5db9ffb0"}}}}
{"actor":{"display_login":"nvgoldin"}}