{"action":"created","comment":{"url":"https://api.github.com/repos/open-craft/opencraft/pulls/comments/61271279","id":61271279,"diff_hunk":"@@ -0,0 +1,6 @@\n+EDXAPP_SWIFT_AUTH_VERSION: '2'\n+EDXAPP_SWIFT_USERNAME: '{{ user }}'\n+EDXAPP_SWIFT_KEY: '{{ password }}'\n+EDXAPP_SWIFT_TENANT_NAME: '{{ tenant }}'\n+EDXAPP_SWIFT_AUTH_URL: '{{ auth_url }}'\n+EDXAPP_SWIFT_REGION_NAME: '{{ region }}'","path":"instance/templates/instance/ansible/swift.yml","position":8,"original_position":6,"commit_id":"1145ea85ffae75cdf8f62cbfd6dc85e3bca0c051","original_commit_id":"6a8821888d1aba92085204eed62b6f09114a97f2","user":{"login":"OmarKan","id":7842450,"avatar_url":"https://avatars.githubusercontent.com/u/7842450?v=3","gravatar_id":"","url":"https://api.github.com/users/OmarKan","html_url":"https://github.com/OmarKan","followers_url":"https://api.github.com/users/OmarKan/followers","following_url":"https://api.github.com/users/OmarKan/following{/other_user}","gists_url":"https://api.github.com/users/OmarKan/gists{/gist_id}","starred_url":"https://api.github.com/users/OmarKan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmarKan/subscriptions","organizations_url":"https://api.github.com/users/OmarKan/orgs","repos_url":"https://api.github.com/users/OmarKan/repos","events_url":"https://api.github.com/users/OmarKan/events{/privacy}","received_events_url":"https://api.github.com/users/OmarKan/received_events","type":"User","site_admin":false},"body":"Dear Marnach,\n\nI have been mentioned in this forum due to a spelling mistake, please stop\nmentioning me :)\n\nThank you.\n\nOn Wed, Apr 27, 2016 at 1:06 AM, Sven Marnach <notifications@github.com>\nwrote:\n\n> In instance/templates/instance/ansible/swift.yml\n> <https://github.com/open-craft/opencraft/pull/54#discussion_r61173246>:\n>\n> > @@ -0,0 +1,6 @@\n> > +EDXAPP_SWIFT_AUTH_VERSION: '2'\n> > +EDXAPP_SWIFT_USERNAME: '{{ user }}'\n> > +EDXAPP_SWIFT_KEY: '{{ password }}'\n> > +EDXAPP_SWIFT_TENANT_NAME: '{{ tenant }}'\n> > +EDXAPP_SWIFT_AUTH_URL: '{{ auth_url }}'\n> > +EDXAPP_SWIFT_REGION_NAME: '{{ region }}'\n>\n> @omarkhan <https://github.com/omarkhan> Thanks for the suggestion. This\n> sounds like it will work. I will test it tomorrow.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/open-craft/opencraft/pull/54/files/6a8821888d1aba92085204eed62b6f09114a97f2#r61173246>\n>\n","created_at":"2016-04-27T14:47:48Z","updated_at":"2016-04-27T14:47:48Z","html_url":"https://github.com/open-craft/opencraft/pull/54#discussion_r61271279","pull_request_url":"https://api.github.com/repos/open-craft/opencraft/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/comments/61271279"},"html":{"href":"https://github.com/open-craft/opencraft/pull/54#discussion_r61271279"},"pull_request":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/open-craft/opencraft/pulls/54","id":66745343,"html_url":"https://github.com/open-craft/opencraft/pull/54","diff_url":"https://github.com/open-craft/opencraft/pull/54.diff","patch_url":"https://github.com/open-craft/opencraft/pull/54.patch","issue_url":"https://api.github.com/repos/open-craft/opencraft/issues/54","number":54,"state":"closed","locked":false,"title":"Support provisioning Swift containers.","user":{"login":"smarnach","id":249196,"avatar_url":"https://avatars.githubusercontent.com/u/249196?v=3","gravatar_id":"","url":"https://api.github.com/users/smarnach","html_url":"https://github.com/smarnach","followers_url":"https://api.github.com/users/smarnach/followers","following_url":"https://api.github.com/users/smarnach/following{/other_user}","gists_url":"https://api.github.com/users/smarnach/gists{/gist_id}","starred_url":"https://api.github.com/users/smarnach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarnach/subscriptions","organizations_url":"https://api.github.com/users/smarnach/orgs","repos_url":"https://api.github.com/users/smarnach/repos","events_url":"https://api.github.com/users/smarnach/events{/privacy}","received_events_url":"https://api.github.com/users/smarnach/received_events","type":"User","site_admin":false},"body":"Add support to provision Swift containers.  This is implemented analogously to MySQL and MongoDB provisioning (see #11).  Swift containers are only provisioned for instances with persistent databases, but I also added a separate flag to disable Swift provisioning if it's unwanted for some reason.\r\n\r\nUnlike MySQL and MongoDB provisioning, Swift provisioning can't be tested locally with reasonable effort (see the [Swift All-In-One documentation](http://docs.openstack.org/developer/swift/development_saio.html) to get an idea of the complexity of setting up a local Swift cluster.), so the unit tests only test whether the API call to the Swift API is made.  The integration test will provision Swift containers though.  They aren't cleaned up when the instance is terminated (which is kind of the point of persistent databases).  In the long run we need some clean-up process to remove unused Swift containers. (The same holds for unused MongoDB and MySQL databases, which aren't cleaned up either.)\r\n\r\nI had to modify the hack I implemented in one of the migrations, since it didn't work anymore for the latest version of `OpenEdXInstance`.  The new version of the hack should be more resilient, though it will fail to migrate instances correctly for people with a very old version of the instance manager installed, which shouldn't be a problem in practice.\r\n\r\nAs discussed on Jira, the full OpenStack credentials are passed on to the instance.  We should get a separate OpenStack project that doesn't have the permission to provision VMs soon, so we at least don't have the OpenStack credentials used to provision the VMs themselves on the servers.\r\n\r\n**Testing instructions**\r\n\r\nOn the development Vagrant instance, run `pip install -r requirements.txt` to make sure the Swift client is installed.  Make sure OpenStack credentials are configured in `.env`, and provision a new instance from the development installation, e.g. by running `make shell` and entering\r\n\r\n    In [1]: from instance.tasks import provision_instance\r\n    In [2]: instance = OpenEdXInstance(sub_domain='swift-test', name='Swift Test')\r\n    In [3]: provision_instance(instance.pk)\r\n\r\nOnce the provisioning finishes, verify the value of `instance.swift_provisioned` and copy the value of `instance.swift_container_name`.  In the shell, set the environment variables `OS_USERNAME`, `OS_TENANT_NAME`, `OS_PASSWORD`, `OS_AUTH_URL` and `OS_REGION_NAME` to the corresponding values from the `.env` file (note that the variable names in that file are different), and run\r\n\r\n    swift stat <container_name>\r\n\r\nwith the container name noted above.  Verify that the container has the `.r:*` read ACL.\r\n\r\nAn even better test would be to provision an instance using the branch from https://github.com/edx/edx-platform/pull/11286, and then test the instance actually works with the container (which I didn't test yet).","created_at":"2016-04-16T18:08:35Z","updated_at":"2016-04-27T14:47:48Z","closed_at":"2016-04-23T08:32:08Z","merged_at":"2016-04-23T08:32:08Z","merge_commit_sha":"a5773018a870909cb37d63bdd8abce86af411551","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/opencraft/pulls/54/commits","review_comments_url":"https://api.github.com/repos/open-craft/opencraft/pulls/54/comments","review_comment_url":"https://api.github.com/repos/open-craft/opencraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-craft/opencraft/issues/54/comments","statuses_url":"https://api.github.com/repos/open-craft/opencraft/statuses/1145ea85ffae75cdf8f62cbfd6dc85e3bca0c051","head":{"label":"open-craft:smarnach/swift","ref":"smarnach/swift","sha":"1145ea85ffae75cdf8f62cbfd6dc85e3bca0c051","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":40447973,"name":"opencraft","full_name":"open-craft/opencraft","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/opencraft","description":"OpenCraft - Instance Manager","fork":false,"url":"https://api.github.com/repos/open-craft/opencraft","forks_url":"https://api.github.com/repos/open-craft/opencraft/forks","keys_url":"https://api.github.com/repos/open-craft/opencraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/opencraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/opencraft/teams","hooks_url":"https://api.github.com/repos/open-craft/opencraft/hooks","issue_events_url":"https://api.github.com/repos/open-craft/opencraft/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/opencraft/events","assignees_url":"https://api.github.com/repos/open-craft/opencraft/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/opencraft/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/opencraft/tags","blobs_url":"https://api.github.com/repos/open-craft/opencraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/opencraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/opencraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/opencraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/opencraft/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/opencraft/languages","stargazers_url":"https://api.github.com/repos/open-craft/opencraft/stargazers","contributors_url":"https://api.github.com/repos/open-craft/opencraft/contributors","subscribers_url":"https://api.github.com/repos/open-craft/opencraft/subscribers","subscription_url":"https://api.github.com/repos/open-craft/opencraft/subscription","commits_url":"https://api.github.com/repos/open-craft/opencraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/opencraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/opencraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/opencraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/opencraft/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/opencraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/opencraft/merges","archive_url":"https://api.github.com/repos/open-craft/opencraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/opencraft/downloads","issues_url":"https://api.github.com/repos/open-craft/opencraft/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/opencraft/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/opencraft/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/opencraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/opencraft/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/opencraft/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/opencraft/deployments","created_at":"2015-08-09T19:35:05Z","updated_at":"2016-02-17T16:53:19Z","pushed_at":"2016-04-27T13:28:16Z","git_url":"git://github.com/open-craft/opencraft.git","ssh_url":"git@github.com:open-craft/opencraft.git","clone_url":"https://github.com/open-craft/opencraft.git","svn_url":"https://github.com/open-craft/opencraft","homepage":null,"size":1567,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":6,"default_branch":"master"}},"base":{"label":"open-craft:master","ref":"master","sha":"b9d16cdca6e4274555c3ea267882cfe544d5cd9d","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":40447973,"name":"opencraft","full_name":"open-craft/opencraft","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/opencraft","description":"OpenCraft - Instance Manager","fork":false,"url":"https://api.github.com/repos/open-craft/opencraft","forks_url":"https://api.github.com/repos/open-craft/opencraft/forks","keys_url":"https://api.github.com/repos/open-craft/opencraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/opencraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/opencraft/teams","hooks_url":"https://api.github.com/repos/open-craft/opencraft/hooks","issue_events_url":"https://api.github.com/repos/open-craft/opencraft/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/opencraft/events","assignees_url":"https://api.github.com/repos/open-craft/opencraft/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/opencraft/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/opencraft/tags","blobs_url":"https://api.github.com/repos/open-craft/opencraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/opencraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/opencraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/opencraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/opencraft/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/opencraft/languages","stargazers_url":"https://api.github.com/repos/open-craft/opencraft/stargazers","contributors_url":"https://api.github.com/repos/open-craft/opencraft/contributors","subscribers_url":"https://api.github.com/repos/open-craft/opencraft/subscribers","subscription_url":"https://api.github.com/repos/open-craft/opencraft/subscription","commits_url":"https://api.github.com/repos/open-craft/opencraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/opencraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/opencraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/opencraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/opencraft/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/opencraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/opencraft/merges","archive_url":"https://api.github.com/repos/open-craft/opencraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/opencraft/downloads","issues_url":"https://api.github.com/repos/open-craft/opencraft/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/opencraft/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/opencraft/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/opencraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/opencraft/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/opencraft/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/opencraft/deployments","created_at":"2015-08-09T19:35:05Z","updated_at":"2016-02-17T16:53:19Z","pushed_at":"2016-04-27T13:28:16Z","git_url":"git://github.com/open-craft/opencraft.git","ssh_url":"git@github.com:open-craft/opencraft.git","clone_url":"https://github.com/open-craft/opencraft.git","svn_url":"https://github.com/open-craft/opencraft","homepage":null,"size":1567,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/54"},"html":{"href":"https://github.com/open-craft/opencraft/pull/54"},"issue":{"href":"https://api.github.com/repos/open-craft/opencraft/issues/54"},"comments":{"href":"https://api.github.com/repos/open-craft/opencraft/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-craft/opencraft/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/opencraft/statuses/1145ea85ffae75cdf8f62cbfd6dc85e3bca0c051"}}}}