{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/comments/90119412","pull_request_review_id":10643933,"id":90119412,"diff_hunk":"@@ -51,7 +78,8 @@ parse_command_line () {\n \n   # See if profile document was provided\n   mkdir -p $HOME/.unison\n-  cp -rf /profile/default.prf $HOME/.unison/default.prf\n+  \n+  [ -f /profile/default.prf ] && cp -rf /profile/default.prf $HOME/.unison/default.prf","path":"che-mount/entrypoint.sh","position":63,"original_position":63,"commit_id":"b2ebc99bd7bdbfb29fae6b73a80ec34b7b52e2f6","original_commit_id":"b2ebc99bd7bdbfb29fae6b73a80ec34b7b52e2f6","user":{"login":"JamesDrummond","id":20580888,"avatar_url":"https://avatars.githubusercontent.com/u/20580888?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesDrummond","html_url":"https://github.com/JamesDrummond","followers_url":"https://api.github.com/users/JamesDrummond/followers","following_url":"https://api.github.com/users/JamesDrummond/following{/other_user}","gists_url":"https://api.github.com/users/JamesDrummond/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesDrummond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesDrummond/subscriptions","organizations_url":"https://api.github.com/users/JamesDrummond/orgs","repos_url":"https://api.github.com/users/JamesDrummond/repos","events_url":"https://api.github.com/users/JamesDrummond/events{/privacy}","received_events_url":"https://api.github.com/users/JamesDrummond/received_events","type":"User","site_admin":false},"body":"Revised.","created_at":"2016-11-29T21:36:01Z","updated_at":"2016-11-29T21:36:01Z","html_url":"https://github.com/eclipse/che-dockerfiles/pull/48#discussion_r90119412","pull_request_url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/comments/90119412"},"html":{"href":"https://github.com/eclipse/che-dockerfiles/pull/48#discussion_r90119412"},"pull_request":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48","id":95055029,"html_url":"https://github.com/eclipse/che-dockerfiles/pull/48","diff_url":"https://github.com/eclipse/che-dockerfiles/pull/48.diff","patch_url":"https://github.com/eclipse/che-dockerfiles/pull/48.patch","issue_url":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/48","number":48,"state":"open","locked":false,"title":"File Sync Agent Support for Che-Mount","user":{"login":"JamesDrummond","id":20580888,"avatar_url":"https://avatars.githubusercontent.com/u/20580888?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesDrummond","html_url":"https://github.com/JamesDrummond","followers_url":"https://api.github.com/users/JamesDrummond/followers","following_url":"https://api.github.com/users/JamesDrummond/following{/other_user}","gists_url":"https://api.github.com/users/JamesDrummond/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesDrummond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesDrummond/subscriptions","organizations_url":"https://api.github.com/users/JamesDrummond/orgs","repos_url":"https://api.github.com/users/JamesDrummond/repos","events_url":"https://api.github.com/users/JamesDrummond/events{/privacy}","received_events_url":"https://api.github.com/users/JamesDrummond/received_events","type":"User","site_admin":false},"body":"# Overview\r\nThis pull request adds file sync agent support for che-mount docker image. It uses unison ssh feature to create a workspace machine's unison process that can communicate with with che-mount unison process. This create a form of unison master/slave relationship between workspace machine and che-mount. The current implementation using a combination sshfs and unison has the che-mount unison process scan workspace machine folders/files in the che-mount folder /mntssh with the desktop machines volume mounted folder located at /mnthost. When there is high latency in network between che-mount machine and a remote workspace machine, the che-mount unison process scan of the remote /mntssh can take considerable amount of time. By having a \"slave\" workspace machine's unison process scan the files on the workspace machine and share it's results with master che-mount unison process it can save considerable amount of time when there is high latency. \r\n\r\nThe following are some measurements I made using remote che server running on a linode 4 core ubuntu 16.04 os and my local pc is running windows 10 home with boot2docker AMD FX-8320 16gb of ram and TOSHIBA DT01ACA200 2TB 7200 RPM 64MB Cache SATA 6.0Gb/s. I created on the remote che-server a java project and imported/cloned che repo for testing of a large remote repo ~120MB. The following is the time it took for initial sync to complete with the local folder empty in each case.\r\n\r\n1. 22 minutes with current sshfs and unison combination on empty local folder.\r\n2. 13 minutes while testing an rsync in lieu of unison for initial sync on empty local folder.\r\n3. 3 minutes with file sync agent support on empty local folder.\r\n\r\nWhen latency is low between che-mount machine and a remote workspace machine there is less performance gain when using sync agent support than remote but still it is still slightly fast even when master/slave unison process are both on same desktop machine.\r\n\r\n# Narrative of Code Changes\r\n\r\nBelow are changes to code. There were some enhancement I made to allow me to use codenvy to develop the docker images to make note of.\r\n\r\n1. Che-mount uses server api to determine if `org.eclipse.che.unison` agent is loaded in workspace machine. When unison agent is loaded che-mount will use master/slave relationship between workspace machine's unison process and che-mount's unison process. \r\n\r\n2. Provided test to determine if local folder is empty. If not, sends user warning message that files maybe overwritten and prompts user to accept.\r\n\r\n3. The unison `repeat` operand was giving me blocking errors. I removed it and replaced with endless while loop with `sleep ${UNISON_REPEAT_DELAY_IN_SEC}` delay.\r\n\r\n4. Replaced build script's bourne shell(sh) with bash shebang(env bash).\r\n\r\n7. Revised che--typescript build script to remove dto volume mount. I was using codenvy to develop and volume mounts will not use workspace machine/container folder but folders located on docker daemon host. I replaced dto volume mount with `docker cp` to copy files over from workspace to the build container. Copying files instead of volume mount might be the way we should have che-in-che too. Would reduce performance though as the files would need to be copied but might be acceptable.\r\n\r\n# CLI\r\nNo changes to original CLI.\r\n\r\nExample on windows using boot2docker\r\n```\r\nmkdir c:\\Users\\%username%\\sync\r\nmkdir c:\\Users\\%username%\\sync\\profile\r\nmkdir c:\\Users\\%username%\\sync\\sync\r\ndocker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse --name che-mount -v /var/run/docker.sock:/var/run/docker.sock -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro -v /c/Users/%username%/sync/profile:/profile -e CHE_VERSION=nightly  -v /c/Users/%username%/sync/sync:/mnthost eclipse/che-mount:nightly <workspace name> --url=<che/codenvy server url> --user=<username> --password=<password>\r\n```\r\n\r\n# Issues\r\nI cannot get this to work with https://codenvy.io/ because there was a change to ssh api in pull request https://github.com/eclipse/che/pull/3000 which will be in the upcoming 5.0.0-M8 release. I did testing with onprem nightly version.","created_at":"2016-11-23T18:14:19Z","updated_at":"2016-11-29T21:36:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"679c0301ceaf175d52fdf4ad7d49db8d3e560b3d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48/commits","review_comments_url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48/comments","review_comment_url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/48/comments","statuses_url":"https://api.github.com/repos/eclipse/che-dockerfiles/statuses/b2ebc99bd7bdbfb29fae6b73a80ec34b7b52e2f6","head":{"label":"JamesDrummond:master","ref":"master","sha":"b2ebc99bd7bdbfb29fae6b73a80ec34b7b52e2f6","user":{"login":"JamesDrummond","id":20580888,"avatar_url":"https://avatars.githubusercontent.com/u/20580888?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesDrummond","html_url":"https://github.com/JamesDrummond","followers_url":"https://api.github.com/users/JamesDrummond/followers","following_url":"https://api.github.com/users/JamesDrummond/following{/other_user}","gists_url":"https://api.github.com/users/JamesDrummond/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesDrummond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesDrummond/subscriptions","organizations_url":"https://api.github.com/users/JamesDrummond/orgs","repos_url":"https://api.github.com/users/JamesDrummond/repos","events_url":"https://api.github.com/users/JamesDrummond/events{/privacy}","received_events_url":"https://api.github.com/users/JamesDrummond/received_events","type":"User","site_admin":false},"repo":{"id":74480702,"name":"che-dockerfiles","full_name":"JamesDrummond/che-dockerfiles","owner":{"login":"JamesDrummond","id":20580888,"avatar_url":"https://avatars.githubusercontent.com/u/20580888?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesDrummond","html_url":"https://github.com/JamesDrummond","followers_url":"https://api.github.com/users/JamesDrummond/followers","following_url":"https://api.github.com/users/JamesDrummond/following{/other_user}","gists_url":"https://api.github.com/users/JamesDrummond/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesDrummond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesDrummond/subscriptions","organizations_url":"https://api.github.com/users/JamesDrummond/orgs","repos_url":"https://api.github.com/users/JamesDrummond/repos","events_url":"https://api.github.com/users/JamesDrummond/events{/privacy}","received_events_url":"https://api.github.com/users/JamesDrummond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JamesDrummond/che-dockerfiles","description":null,"fork":true,"url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles","forks_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/forks","keys_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/teams","hooks_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/hooks","issue_events_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/issues/events{/number}","events_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/events","assignees_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/assignees{/user}","branches_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/branches{/branch}","tags_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/tags","blobs_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/statuses/{sha}","languages_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/languages","stargazers_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/stargazers","contributors_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/contributors","subscribers_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/subscribers","subscription_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/subscription","commits_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/issues/comments{/number}","contents_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/contents/{+path}","compare_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/merges","archive_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/downloads","issues_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/issues{/number}","pulls_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/pulls{/number}","milestones_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/milestones{/number}","notifications_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/labels{/name}","releases_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/releases{/id}","deployments_url":"https://api.github.com/repos/JamesDrummond/che-dockerfiles/deployments","created_at":"2016-11-22T14:30:28Z","updated_at":"2016-11-22T14:30:30Z","pushed_at":"2016-11-26T04:52:45Z","git_url":"git://github.com/JamesDrummond/che-dockerfiles.git","ssh_url":"git@github.com:JamesDrummond/che-dockerfiles.git","clone_url":"https://github.com/JamesDrummond/che-dockerfiles.git","svn_url":"https://github.com/JamesDrummond/che-dockerfiles","homepage":null,"size":11792,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"eclipse:master","ref":"master","sha":"9e6891c2b586100703c1cb880c66a9e7b72aa1dd","user":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":66377221,"name":"che-dockerfiles","full_name":"eclipse/che-dockerfiles","owner":{"login":"eclipse","id":56974,"avatar_url":"https://avatars.githubusercontent.com/u/56974?v=3","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/che-dockerfiles","description":null,"fork":false,"url":"https://api.github.com/repos/eclipse/che-dockerfiles","forks_url":"https://api.github.com/repos/eclipse/che-dockerfiles/forks","keys_url":"https://api.github.com/repos/eclipse/che-dockerfiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/che-dockerfiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/che-dockerfiles/teams","hooks_url":"https://api.github.com/repos/eclipse/che-dockerfiles/hooks","issue_events_url":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/che-dockerfiles/events","assignees_url":"https://api.github.com/repos/eclipse/che-dockerfiles/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/che-dockerfiles/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/che-dockerfiles/tags","blobs_url":"https://api.github.com/repos/eclipse/che-dockerfiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/che-dockerfiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/che-dockerfiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/che-dockerfiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/che-dockerfiles/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/che-dockerfiles/languages","stargazers_url":"https://api.github.com/repos/eclipse/che-dockerfiles/stargazers","contributors_url":"https://api.github.com/repos/eclipse/che-dockerfiles/contributors","subscribers_url":"https://api.github.com/repos/eclipse/che-dockerfiles/subscribers","subscription_url":"https://api.github.com/repos/eclipse/che-dockerfiles/subscription","commits_url":"https://api.github.com/repos/eclipse/che-dockerfiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/che-dockerfiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/che-dockerfiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/che-dockerfiles/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/che-dockerfiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/che-dockerfiles/merges","archive_url":"https://api.github.com/repos/eclipse/che-dockerfiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/che-dockerfiles/downloads","issues_url":"https://api.github.com/repos/eclipse/che-dockerfiles/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/che-dockerfiles/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/che-dockerfiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/che-dockerfiles/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/che-dockerfiles/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/che-dockerfiles/deployments","created_at":"2016-08-23T15:02:02Z","updated_at":"2016-11-26T14:31:17Z","pushed_at":"2016-11-29T18:15:39Z","git_url":"git://github.com/eclipse/che-dockerfiles.git","ssh_url":"git@github.com:eclipse/che-dockerfiles.git","clone_url":"https://github.com/eclipse/che-dockerfiles.git","svn_url":"https://github.com/eclipse/che-dockerfiles","homepage":null,"size":11883,"stargazers_count":8,"watchers_count":8,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":1,"forks":12,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48"},"html":{"href":"https://github.com/eclipse/che-dockerfiles/pull/48"},"issue":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/48"},"comments":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/che-dockerfiles/statuses/b2ebc99bd7bdbfb29fae6b73a80ec34b7b52e2f6"}}}}
{"actor":{"display_login":"JamesDrummond"}}