{"action":"created","comment":{"url":"https://api.github.com/repos/sql-machine-learning/models/pulls/comments/302010582","pull_request_review_id":260024291,"id":302010582,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwMjAxMDU4Mg==","diff_hunk":"@@ -0,0 +1,71 @@\n+# How to Contribute SQLFLow Models\n+\n+This guide will introduce how to contribute to SQLFlow models. If you haven't checked [Define SQLFLow Models](/doc/customized+model.md), please check it out first.\n+\n+## Add an SQLFlow Model\n+\n+1. Open the [SQLFlow models repo](https://github.com/sql-machine-learning/models) on your web browser, and fork the official repo to your account.\n+\n+1. Clone the forked repo on your hosts:\n+\n+    ``` bash\n+    > git clone https://github.com/<Your Github ID>/models.git\n+    ```\n+\n+1. You can add a new mode definition Python script under the folder [sqlflow_models](/sqlflow_models). For example, adding a new Python script `mydnnclassfier.py`:\n+\n+    ``` text\n+    `-sqlflow_models\n+        |- dnnclassifier.py\n+        `- mydnnclassifier.py\n+    ```\n+\n+1. Define your model named `MyDNNClassifier`:\n+\n+    ``` python\n+    import tensorflow as tf\n+\n+    class MyDNNClassifier(tf.keras.Model):\n+    def __init__(self, feature_columns, hidden_units=[10,10], n_classes=2):\n+        ...\n+    ```\n+\n+1. Import `MyDNNClassfier` in [sqlflow_models/__ini__.py]:\n+\n+    ``` python\n+    ...\n+    from .mydnnclassfier import MyDNNClassifier\n+    ```\n+\n+## Integration test with SQLFlow gRPC server\n+\n+If you have developed a new model, please perform the integration test with the SQLFlow gRPC server to make sure it works well with SQLFlow.\n+\n+1. Launch an SQLFlow all-in-one Docker container\n+\n+    ``` bash\n+    cd ./models\n+    > docker run --rm -it -v $PWD:/models -p 8888:8888 sqlflow/sqlflow\n+    ```\n+\n+1. Update `sqlflow_models` in the SQLFlow all-in-one Docker container:\n+\n+    ``` bash\n+    > docker exec -it <container-id> pip install -U /models","path":"doc/contribute_models.md","position":55,"original_position":54,"commit_id":"3b898f4c7c7e6b1e0575c4d5ab51551861f7968b","original_commit_id":"654ccee2165dae49b595198f6a9df8f2120115c3","user":{"login":"Yancey1989","id":1426912,"node_id":"MDQ6VXNlcjE0MjY5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1426912?v=4","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false},"body":"`pip install -U /models` works well, but throw an exception for the first execution:\r\n``` text\r\n    return self._has(path)\r\n  File \"/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py\", line 1845, in _has\r\n    return zip_path in self.zipinfo or zip_path in self._index()\r\n  File \"/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py\", line 1722, in zipinfo\r\n    return self._zip_manifests.load(self.loader.archive)\r\n  File \"/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py\", line 1679, in load\r\n    mtime = os.stat(path).st_mtime\r\nFileNotFoundError: [Errno 2] No such file or directory: '/miniconda/envs/sqlflow-dev/lib/python3.6/site-packages/sqlflow_models-0.0.1-py3.6.egg'```\r\n\r\nI'm not sure what is the best practices, will test it later.\r\n","created_at":"2019-07-10T11:13:27Z","updated_at":"2019-07-10T11:13:27Z","html_url":"https://github.com/sql-machine-learning/models/pull/14#discussion_r302010582","pull_request_url":"https://api.github.com/repos/sql-machine-learning/models/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/comments/302010582"},"html":{"href":"https://github.com/sql-machine-learning/models/pull/14#discussion_r302010582"},"pull_request":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/14"}},"in_reply_to_id":301931893},"pull_request":{"url":"https://api.github.com/repos/sql-machine-learning/models/pulls/14","id":296048388,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk2MDQ4Mzg4","html_url":"https://github.com/sql-machine-learning/models/pull/14","diff_url":"https://github.com/sql-machine-learning/models/pull/14.diff","patch_url":"https://github.com/sql-machine-learning/models/pull/14.patch","issue_url":"https://api.github.com/repos/sql-machine-learning/models/issues/14","number":14,"state":"open","locked":false,"title":"add contribute models doc","user":{"login":"Yancey1989","id":1426912,"node_id":"MDQ6VXNlcjE0MjY5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1426912?v=4","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-07-10T07:44:02Z","updated_at":"2019-07-10T11:13:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21a4fa776f15c206321678b469383b1827232480","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sql-machine-learning/models/pulls/14/commits","review_comments_url":"https://api.github.com/repos/sql-machine-learning/models/pulls/14/comments","review_comment_url":"https://api.github.com/repos/sql-machine-learning/models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sql-machine-learning/models/issues/14/comments","statuses_url":"https://api.github.com/repos/sql-machine-learning/models/statuses/3b898f4c7c7e6b1e0575c4d5ab51551861f7968b","head":{"label":"Yancey1989:contribute_doc","ref":"contribute_doc","sha":"3b898f4c7c7e6b1e0575c4d5ab51551861f7968b","user":{"login":"Yancey1989","id":1426912,"node_id":"MDQ6VXNlcjE0MjY5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1426912?v=4","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false},"repo":{"id":192530584,"node_id":"MDEwOlJlcG9zaXRvcnkxOTI1MzA1ODQ=","name":"models","full_name":"Yancey1989/models","private":false,"owner":{"login":"Yancey1989","id":1426912,"node_id":"MDQ6VXNlcjE0MjY5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1426912?v=4","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Yancey1989/models","description":"Premade models for SQLFlow","fork":true,"url":"https://api.github.com/repos/Yancey1989/models","forks_url":"https://api.github.com/repos/Yancey1989/models/forks","keys_url":"https://api.github.com/repos/Yancey1989/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yancey1989/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yancey1989/models/teams","hooks_url":"https://api.github.com/repos/Yancey1989/models/hooks","issue_events_url":"https://api.github.com/repos/Yancey1989/models/issues/events{/number}","events_url":"https://api.github.com/repos/Yancey1989/models/events","assignees_url":"https://api.github.com/repos/Yancey1989/models/assignees{/user}","branches_url":"https://api.github.com/repos/Yancey1989/models/branches{/branch}","tags_url":"https://api.github.com/repos/Yancey1989/models/tags","blobs_url":"https://api.github.com/repos/Yancey1989/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yancey1989/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yancey1989/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yancey1989/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yancey1989/models/statuses/{sha}","languages_url":"https://api.github.com/repos/Yancey1989/models/languages","stargazers_url":"https://api.github.com/repos/Yancey1989/models/stargazers","contributors_url":"https://api.github.com/repos/Yancey1989/models/contributors","subscribers_url":"https://api.github.com/repos/Yancey1989/models/subscribers","subscription_url":"https://api.github.com/repos/Yancey1989/models/subscription","commits_url":"https://api.github.com/repos/Yancey1989/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yancey1989/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yancey1989/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yancey1989/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yancey1989/models/contents/{+path}","compare_url":"https://api.github.com/repos/Yancey1989/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yancey1989/models/merges","archive_url":"https://api.github.com/repos/Yancey1989/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yancey1989/models/downloads","issues_url":"https://api.github.com/repos/Yancey1989/models/issues{/number}","pulls_url":"https://api.github.com/repos/Yancey1989/models/pulls{/number}","milestones_url":"https://api.github.com/repos/Yancey1989/models/milestones{/number}","notifications_url":"https://api.github.com/repos/Yancey1989/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yancey1989/models/labels{/name}","releases_url":"https://api.github.com/repos/Yancey1989/models/releases{/id}","deployments_url":"https://api.github.com/repos/Yancey1989/models/deployments","created_at":"2019-06-18T11:54:27Z","updated_at":"2019-06-18T11:54:30Z","pushed_at":"2019-07-10T11:08:27Z","git_url":"git://github.com/Yancey1989/models.git","ssh_url":"git@github.com:Yancey1989/models.git","clone_url":"https://github.com/Yancey1989/models.git","svn_url":"https://github.com/Yancey1989/models","homepage":"","size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"sql-machine-learning:develop","ref":"develop","sha":"cf58e97ea3df41ac549e57839a7dccfe1b64335f","user":{"login":"sql-machine-learning","id":48231449,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4MjMxNDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/48231449?v=4","gravatar_id":"","url":"https://api.github.com/users/sql-machine-learning","html_url":"https://github.com/sql-machine-learning","followers_url":"https://api.github.com/users/sql-machine-learning/followers","following_url":"https://api.github.com/users/sql-machine-learning/following{/other_user}","gists_url":"https://api.github.com/users/sql-machine-learning/gists{/gist_id}","starred_url":"https://api.github.com/users/sql-machine-learning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sql-machine-learning/subscriptions","organizations_url":"https://api.github.com/users/sql-machine-learning/orgs","repos_url":"https://api.github.com/users/sql-machine-learning/repos","events_url":"https://api.github.com/users/sql-machine-learning/events{/privacy}","received_events_url":"https://api.github.com/users/sql-machine-learning/received_events","type":"Organization","site_admin":false},"repo":{"id":184006313,"node_id":"MDEwOlJlcG9zaXRvcnkxODQwMDYzMTM=","name":"models","full_name":"sql-machine-learning/models","private":false,"owner":{"login":"sql-machine-learning","id":48231449,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4MjMxNDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/48231449?v=4","gravatar_id":"","url":"https://api.github.com/users/sql-machine-learning","html_url":"https://github.com/sql-machine-learning","followers_url":"https://api.github.com/users/sql-machine-learning/followers","following_url":"https://api.github.com/users/sql-machine-learning/following{/other_user}","gists_url":"https://api.github.com/users/sql-machine-learning/gists{/gist_id}","starred_url":"https://api.github.com/users/sql-machine-learning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sql-machine-learning/subscriptions","organizations_url":"https://api.github.com/users/sql-machine-learning/orgs","repos_url":"https://api.github.com/users/sql-machine-learning/repos","events_url":"https://api.github.com/users/sql-machine-learning/events{/privacy}","received_events_url":"https://api.github.com/users/sql-machine-learning/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sql-machine-learning/models","description":"Premade models for SQLFlow","fork":false,"url":"https://api.github.com/repos/sql-machine-learning/models","forks_url":"https://api.github.com/repos/sql-machine-learning/models/forks","keys_url":"https://api.github.com/repos/sql-machine-learning/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sql-machine-learning/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sql-machine-learning/models/teams","hooks_url":"https://api.github.com/repos/sql-machine-learning/models/hooks","issue_events_url":"https://api.github.com/repos/sql-machine-learning/models/issues/events{/number}","events_url":"https://api.github.com/repos/sql-machine-learning/models/events","assignees_url":"https://api.github.com/repos/sql-machine-learning/models/assignees{/user}","branches_url":"https://api.github.com/repos/sql-machine-learning/models/branches{/branch}","tags_url":"https://api.github.com/repos/sql-machine-learning/models/tags","blobs_url":"https://api.github.com/repos/sql-machine-learning/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sql-machine-learning/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sql-machine-learning/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/sql-machine-learning/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sql-machine-learning/models/statuses/{sha}","languages_url":"https://api.github.com/repos/sql-machine-learning/models/languages","stargazers_url":"https://api.github.com/repos/sql-machine-learning/models/stargazers","contributors_url":"https://api.github.com/repos/sql-machine-learning/models/contributors","subscribers_url":"https://api.github.com/repos/sql-machine-learning/models/subscribers","subscription_url":"https://api.github.com/repos/sql-machine-learning/models/subscription","commits_url":"https://api.github.com/repos/sql-machine-learning/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/sql-machine-learning/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/sql-machine-learning/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/sql-machine-learning/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/sql-machine-learning/models/contents/{+path}","compare_url":"https://api.github.com/repos/sql-machine-learning/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sql-machine-learning/models/merges","archive_url":"https://api.github.com/repos/sql-machine-learning/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sql-machine-learning/models/downloads","issues_url":"https://api.github.com/repos/sql-machine-learning/models/issues{/number}","pulls_url":"https://api.github.com/repos/sql-machine-learning/models/pulls{/number}","milestones_url":"https://api.github.com/repos/sql-machine-learning/models/milestones{/number}","notifications_url":"https://api.github.com/repos/sql-machine-learning/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sql-machine-learning/models/labels{/name}","releases_url":"https://api.github.com/repos/sql-machine-learning/models/releases{/id}","deployments_url":"https://api.github.com/repos/sql-machine-learning/models/deployments","created_at":"2019-04-29T05:37:47Z","updated_at":"2019-07-01T06:00:51Z","pushed_at":"2019-07-10T11:08:29Z","git_url":"git://github.com/sql-machine-learning/models.git","ssh_url":"git@github.com:sql-machine-learning/models.git","clone_url":"https://github.com/sql-machine-learning/models.git","svn_url":"https://github.com/sql-machine-learning/models","homepage":"","size":19,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":4,"open_issues":5,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/14"},"html":{"href":"https://github.com/sql-machine-learning/models/pull/14"},"issue":{"href":"https://api.github.com/repos/sql-machine-learning/models/issues/14"},"comments":{"href":"https://api.github.com/repos/sql-machine-learning/models/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sql-machine-learning/models/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/sql-machine-learning/models/statuses/3b898f4c7c7e6b1e0575c4d5ab51551861f7968b"}},"author_association":"NONE"}}
{"actor":{"display_login":"Yancey1989"}}