{"action":"created","comment":{"url":"https://api.github.com/repos/OpenMined/Grid/pulls/comments/178421027","pull_request_review_id":108476924,"id":178421027,"diff_hunk":"@@ -0,0 +1,81 @@\n+\"\"\" This module contains an implementation of an IPFS\n+version-control system, which is structured as a directed in-tree with nodes\n+represented by the bytes representation of the VersionTreeNode class. \"\"\"\n+from typing import Optional, Iterator\n+\n+from grid import ipfsapi\n+\n+# TODO: Unit tests.\n+# TODO: Do we want to store the hash on the node after it's been committed?\n+class VersionTreeNode:\n+    \"\"\" Thin wrapper around a piece of IPFS-versioned data and the\n+    IPFS multihash of its parent. \"\"\"\n+    # Delimiter for serializing packed object.\n+    DELIMITER = b\"|\"\n+\n+    def __init__(self,\n+                 contents: bytes,\n+                 parent_hash: Optional[str] = None,\n+                 ipfs_client: ipfsapi.Client = None):\n+        \"\"\" parent_hash is a UTF-8 IPFS multihash identifying\n+        this node's parent in the version tree. If parent_hash is None,\n+        this node is the root of a version tree. \"\"\"\n+        self.contents = contents\n+        # Convert empty string to None to minimize typing bugs.\n+        self.parent_hash = parent_hash.decode(\"utf-8\") or None\n+        self.ipfs_client = ipfs_client\n+\n+    # TODO: Should there just be a singleton IPFS client in the ipfsapi.client\n+    # module?  It seems like the current architecture would require\n+    # it to either be passed around all over the place or potentially go\n+    # through the connection process multiple times, and I don't think\n+    # multiple configurations need to be maintained for a given worker node.\n+    def commit(self, ipfs_client: ipfsapi.Client = None) -> str:","path":"grid/ipfsapi/version_tree.py","position":33,"original_position":33,"commit_id":"861844893fc90893a60be85067363fbb55e52ade","original_commit_id":"861844893fc90893a60be85067363fbb55e52ade","user":{"login":"jvmancuso","id":7891333,"avatar_url":"https://avatars2.githubusercontent.com/u/7891333?v=4","gravatar_id":"","url":"https://api.github.com/users/jvmancuso","html_url":"https://github.com/jvmancuso","followers_url":"https://api.github.com/users/jvmancuso/followers","following_url":"https://api.github.com/users/jvmancuso/following{/other_user}","gists_url":"https://api.github.com/users/jvmancuso/gists{/gist_id}","starred_url":"https://api.github.com/users/jvmancuso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvmancuso/subscriptions","organizations_url":"https://api.github.com/users/jvmancuso/orgs","repos_url":"https://api.github.com/users/jvmancuso/repos","events_url":"https://api.github.com/users/jvmancuso/events{/privacy}","received_events_url":"https://api.github.com/users/jvmancuso/received_events","type":"User","site_admin":false},"body":"We'll want to expose this in other methods at some point. For example with torch, we'll usually want to commit gradients of model Parameters, either directly on the Parameter's grad or with some helper function.","created_at":"2018-03-31T02:35:39Z","updated_at":"2018-03-31T02:37:40Z","html_url":"https://github.com/OpenMined/Grid/pull/159#discussion_r178421027","pull_request_url":"https://api.github.com/repos/OpenMined/Grid/pulls/159","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/comments/178421027"},"html":{"href":"https://github.com/OpenMined/Grid/pull/159#discussion_r178421027"},"pull_request":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/159"}}},"pull_request":{"url":"https://api.github.com/repos/OpenMined/Grid/pulls/159","id":178263978,"html_url":"https://github.com/OpenMined/Grid/pull/159","diff_url":"https://github.com/OpenMined/Grid/pull/159.diff","patch_url":"https://github.com/OpenMined/Grid/pull/159.patch","issue_url":"https://api.github.com/repos/OpenMined/Grid/issues/159","number":159,"state":"open","locked":false,"title":"Added version_tree module to support versioning of arbitrary objects …","user":{"login":"vbawa","id":1940176,"avatar_url":"https://avatars1.githubusercontent.com/u/1940176?v=4","gravatar_id":"","url":"https://api.github.com/users/vbawa","html_url":"https://github.com/vbawa","followers_url":"https://api.github.com/users/vbawa/followers","following_url":"https://api.github.com/users/vbawa/following{/other_user}","gists_url":"https://api.github.com/users/vbawa/gists{/gist_id}","starred_url":"https://api.github.com/users/vbawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbawa/subscriptions","organizations_url":"https://api.github.com/users/vbawa/orgs","repos_url":"https://api.github.com/users/vbawa/repos","events_url":"https://api.github.com/users/vbawa/events{/privacy}","received_events_url":"https://api.github.com/users/vbawa/received_events","type":"User","site_admin":false},"body":"…in IPFS","created_at":"2018-03-29T08:48:50Z","updated_at":"2018-03-31T02:37:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fda36e499b73686485632ea780e1c7daf6b12d7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenMined/Grid/pulls/159/commits","review_comments_url":"https://api.github.com/repos/OpenMined/Grid/pulls/159/comments","review_comment_url":"https://api.github.com/repos/OpenMined/Grid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenMined/Grid/issues/159/comments","statuses_url":"https://api.github.com/repos/OpenMined/Grid/statuses/861844893fc90893a60be85067363fbb55e52ade","head":{"label":"vbawa:feature/version-tree-initial","ref":"feature/version-tree-initial","sha":"861844893fc90893a60be85067363fbb55e52ade","user":{"login":"vbawa","id":1940176,"avatar_url":"https://avatars1.githubusercontent.com/u/1940176?v=4","gravatar_id":"","url":"https://api.github.com/users/vbawa","html_url":"https://github.com/vbawa","followers_url":"https://api.github.com/users/vbawa/followers","following_url":"https://api.github.com/users/vbawa/following{/other_user}","gists_url":"https://api.github.com/users/vbawa/gists{/gist_id}","starred_url":"https://api.github.com/users/vbawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbawa/subscriptions","organizations_url":"https://api.github.com/users/vbawa/orgs","repos_url":"https://api.github.com/users/vbawa/repos","events_url":"https://api.github.com/users/vbawa/events{/privacy}","received_events_url":"https://api.github.com/users/vbawa/received_events","type":"User","site_admin":false},"repo":{"id":124365010,"name":"Grid","full_name":"vbawa/Grid","owner":{"login":"vbawa","id":1940176,"avatar_url":"https://avatars1.githubusercontent.com/u/1940176?v=4","gravatar_id":"","url":"https://api.github.com/users/vbawa","html_url":"https://github.com/vbawa","followers_url":"https://api.github.com/users/vbawa/followers","following_url":"https://api.github.com/users/vbawa/following{/other_user}","gists_url":"https://api.github.com/users/vbawa/gists{/gist_id}","starred_url":"https://api.github.com/users/vbawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbawa/subscriptions","organizations_url":"https://api.github.com/users/vbawa/orgs","repos_url":"https://api.github.com/users/vbawa/repos","events_url":"https://api.github.com/users/vbawa/events{/privacy}","received_events_url":"https://api.github.com/users/vbawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vbawa/Grid","description":null,"fork":true,"url":"https://api.github.com/repos/vbawa/Grid","forks_url":"https://api.github.com/repos/vbawa/Grid/forks","keys_url":"https://api.github.com/repos/vbawa/Grid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vbawa/Grid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vbawa/Grid/teams","hooks_url":"https://api.github.com/repos/vbawa/Grid/hooks","issue_events_url":"https://api.github.com/repos/vbawa/Grid/issues/events{/number}","events_url":"https://api.github.com/repos/vbawa/Grid/events","assignees_url":"https://api.github.com/repos/vbawa/Grid/assignees{/user}","branches_url":"https://api.github.com/repos/vbawa/Grid/branches{/branch}","tags_url":"https://api.github.com/repos/vbawa/Grid/tags","blobs_url":"https://api.github.com/repos/vbawa/Grid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vbawa/Grid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vbawa/Grid/git/refs{/sha}","trees_url":"https://api.github.com/repos/vbawa/Grid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vbawa/Grid/statuses/{sha}","languages_url":"https://api.github.com/repos/vbawa/Grid/languages","stargazers_url":"https://api.github.com/repos/vbawa/Grid/stargazers","contributors_url":"https://api.github.com/repos/vbawa/Grid/contributors","subscribers_url":"https://api.github.com/repos/vbawa/Grid/subscribers","subscription_url":"https://api.github.com/repos/vbawa/Grid/subscription","commits_url":"https://api.github.com/repos/vbawa/Grid/commits{/sha}","git_commits_url":"https://api.github.com/repos/vbawa/Grid/git/commits{/sha}","comments_url":"https://api.github.com/repos/vbawa/Grid/comments{/number}","issue_comment_url":"https://api.github.com/repos/vbawa/Grid/issues/comments{/number}","contents_url":"https://api.github.com/repos/vbawa/Grid/contents/{+path}","compare_url":"https://api.github.com/repos/vbawa/Grid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vbawa/Grid/merges","archive_url":"https://api.github.com/repos/vbawa/Grid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vbawa/Grid/downloads","issues_url":"https://api.github.com/repos/vbawa/Grid/issues{/number}","pulls_url":"https://api.github.com/repos/vbawa/Grid/pulls{/number}","milestones_url":"https://api.github.com/repos/vbawa/Grid/milestones{/number}","notifications_url":"https://api.github.com/repos/vbawa/Grid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vbawa/Grid/labels{/name}","releases_url":"https://api.github.com/repos/vbawa/Grid/releases{/id}","deployments_url":"https://api.github.com/repos/vbawa/Grid/deployments","created_at":"2018-03-08T09:00:46Z","updated_at":"2018-03-22T01:48:52Z","pushed_at":"2018-03-29T09:19:14Z","git_url":"git://github.com/vbawa/Grid.git","ssh_url":"git@github.com:vbawa/Grid.git","clone_url":"https://github.com/vbawa/Grid.git","svn_url":"https://github.com/vbawa/Grid","homepage":null,"size":2287,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenMined:master","ref":"master","sha":"4511cce75b31409b77695a1f04382a4ddc539762","user":{"login":"OpenMined","id":30185530,"avatar_url":"https://avatars3.githubusercontent.com/u/30185530?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenMined","html_url":"https://github.com/OpenMined","followers_url":"https://api.github.com/users/OpenMined/followers","following_url":"https://api.github.com/users/OpenMined/following{/other_user}","gists_url":"https://api.github.com/users/OpenMined/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMined/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMined/subscriptions","organizations_url":"https://api.github.com/users/OpenMined/orgs","repos_url":"https://api.github.com/users/OpenMined/repos","events_url":"https://api.github.com/users/OpenMined/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMined/received_events","type":"Organization","site_admin":false},"repo":{"id":119101987,"name":"Grid","full_name":"OpenMined/Grid","owner":{"login":"OpenMined","id":30185530,"avatar_url":"https://avatars3.githubusercontent.com/u/30185530?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenMined","html_url":"https://github.com/OpenMined","followers_url":"https://api.github.com/users/OpenMined/followers","following_url":"https://api.github.com/users/OpenMined/following{/other_user}","gists_url":"https://api.github.com/users/OpenMined/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMined/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMined/subscriptions","organizations_url":"https://api.github.com/users/OpenMined/orgs","repos_url":"https://api.github.com/users/OpenMined/repos","events_url":"https://api.github.com/users/OpenMined/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMined/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenMined/Grid","description":null,"fork":false,"url":"https://api.github.com/repos/OpenMined/Grid","forks_url":"https://api.github.com/repos/OpenMined/Grid/forks","keys_url":"https://api.github.com/repos/OpenMined/Grid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenMined/Grid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenMined/Grid/teams","hooks_url":"https://api.github.com/repos/OpenMined/Grid/hooks","issue_events_url":"https://api.github.com/repos/OpenMined/Grid/issues/events{/number}","events_url":"https://api.github.com/repos/OpenMined/Grid/events","assignees_url":"https://api.github.com/repos/OpenMined/Grid/assignees{/user}","branches_url":"https://api.github.com/repos/OpenMined/Grid/branches{/branch}","tags_url":"https://api.github.com/repos/OpenMined/Grid/tags","blobs_url":"https://api.github.com/repos/OpenMined/Grid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenMined/Grid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenMined/Grid/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenMined/Grid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenMined/Grid/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenMined/Grid/languages","stargazers_url":"https://api.github.com/repos/OpenMined/Grid/stargazers","contributors_url":"https://api.github.com/repos/OpenMined/Grid/contributors","subscribers_url":"https://api.github.com/repos/OpenMined/Grid/subscribers","subscription_url":"https://api.github.com/repos/OpenMined/Grid/subscription","commits_url":"https://api.github.com/repos/OpenMined/Grid/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenMined/Grid/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenMined/Grid/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenMined/Grid/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenMined/Grid/contents/{+path}","compare_url":"https://api.github.com/repos/OpenMined/Grid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenMined/Grid/merges","archive_url":"https://api.github.com/repos/OpenMined/Grid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenMined/Grid/downloads","issues_url":"https://api.github.com/repos/OpenMined/Grid/issues{/number}","pulls_url":"https://api.github.com/repos/OpenMined/Grid/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenMined/Grid/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenMined/Grid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenMined/Grid/labels{/name}","releases_url":"https://api.github.com/repos/OpenMined/Grid/releases{/id}","deployments_url":"https://api.github.com/repos/OpenMined/Grid/deployments","created_at":"2018-01-26T20:53:03Z","updated_at":"2018-03-31T00:20:57Z","pushed_at":"2018-03-31T01:16:43Z","git_url":"git://github.com/OpenMined/Grid.git","ssh_url":"git@github.com:OpenMined/Grid.git","clone_url":"https://github.com/OpenMined/Grid.git","svn_url":"https://github.com/OpenMined/Grid","homepage":null,"size":2339,"stargazers_count":31,"watchers_count":31,"language":"Jupyter Notebook","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":32,"open_issues":32,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/159"},"html":{"href":"https://github.com/OpenMined/Grid/pull/159"},"issue":{"href":"https://api.github.com/repos/OpenMined/Grid/issues/159"},"comments":{"href":"https://api.github.com/repos/OpenMined/Grid/issues/159/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/159/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenMined/Grid/pulls/159/commits"},"statuses":{"href":"https://api.github.com/repos/OpenMined/Grid/statuses/861844893fc90893a60be85067363fbb55e52ade"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jvmancuso"}}