{"action":"created","issue":{"url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/100","labels_url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/100/comments","events_url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/100/events","html_url":"https://github.com/FNNDSC/chrisreloaded/issues/100","id":64571146,"number":100,"title":"SSH to cluster head node on different port","user":{"login":"knikolla","id":4123322,"avatar_url":"https://avatars.githubusercontent.com/u/4123322?v=3","gravatar_id":"","url":"https://api.github.com/users/knikolla","html_url":"https://github.com/knikolla","followers_url":"https://api.github.com/users/knikolla/followers","following_url":"https://api.github.com/users/knikolla/following{/other_user}","gists_url":"https://api.github.com/users/knikolla/gists{/gist_id}","starred_url":"https://api.github.com/users/knikolla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knikolla/subscriptions","organizations_url":"https://api.github.com/users/knikolla/orgs","repos_url":"https://api.github.com/users/knikolla/repos","events_url":"https://api.github.com/users/knikolla/events{/privacy}","received_events_url":"https://api.github.com/users/knikolla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-26T16:18:42Z","updated_at":"2015-03-27T08:41:36Z","closed_at":null,"body":"Hi,\r\n\r\nFor our ChRIS in the MOC project we need the ability to SSH to a different port of the CLUSTER_HOST, because it will be set up via a SSH tunnel.  \r\n\r\nThe remote connection in launcher.php uses the default port, and we need to introduce a new constant in the config file and change the remoteSsh initialization line in the launcher.php to\r\n\r\n```\r\n$separatedRun->remoteSsh = new Net_SSH2(CLUSTER_HOST, CLUSTER_HEAD_PORT);\r\n```\r\n\r\nHow should I call that option in the config file? (because CLUSTER_PORT refers to the reverse tunnel port which has a different function)\r\n\r\nIf I create a pull request, will those changes be eventually merged?\r\n\r\nThank you,\r\nKristi Nikolla"},"comment":{"url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/comments/86869897","html_url":"https://github.com/FNNDSC/chrisreloaded/issues/100#issuecomment-86869897","issue_url":"https://api.github.com/repos/FNNDSC/chrisreloaded/issues/100","id":86869897,"user":{"login":"NicolasRannou","id":214063,"avatar_url":"https://avatars.githubusercontent.com/u/214063?v=3","gravatar_id":"","url":"https://api.github.com/users/NicolasRannou","html_url":"https://github.com/NicolasRannou","followers_url":"https://api.github.com/users/NicolasRannou/followers","following_url":"https://api.github.com/users/NicolasRannou/following{/other_user}","gists_url":"https://api.github.com/users/NicolasRannou/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolasRannou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolasRannou/subscriptions","organizations_url":"https://api.github.com/users/NicolasRannou/orgs","repos_url":"https://api.github.com/users/NicolasRannou/repos","events_url":"https://api.github.com/users/NicolasRannou/events{/privacy}","received_events_url":"https://api.github.com/users/NicolasRannou/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T08:41:36Z","updated_at":"2015-03-27T08:41:36Z","body":"Yes definitly thanks!\r\n\r\nI think the best is to push it even further with something like that:\r\n```\r\nCLUSTER_TO_SERVER_HOST\r\nCLUSTER_TO_SERVER_PORT\r\nSERVER_TO_CLUSTER_HOST\r\nSERVER_TO_CLUSTER_PORT\r\n```\r\n\r\ninstead of the current CLUSTER_HOST and CLUSTER_PORT.\r\n\r\nDoes it make sense?\r\nWe might have to propagate the changes in more place:\r\n```\r\nchris@chris:/neuro/users/chris/src/chrisreloaded (master@6ec3-aded-)$>grep -R \"CLUSTER_\" controller/\r\ncontroller/user.controller.php:    $sshCluster = new Net_SSH2(CLUSTER_HOST);\r\ncontroller/user.controller.php:        $sshCluster = new Net_SSH2(CLUSTER_HOST);\r\ncontroller/user.controller.php:        $sshCluster = new Net_SSH2(CLUSTER_HOST);\r\ncontroller/launcher.php:    if(CLUSTER_SHARED_FS){\r\ncontroller/launcher.php:    $sharedRun->remoteSsh = new Net_SSH2(CLUSTER_HOST);\r\ncontroller/launcher.php:    $separatedRun->remoteSsh = new Net_SSH2(CLUSTER_HOST);\r\ncontroller/launcher.php:    $runtimePath = str_replace($plugin_path, CLUSTER_CHRIS.'/users/'.$username, $job_path);\r\ncontroller/runner.php:    $this->ssh->exec(bash('echo \"export ENV_CLUSTERTYPE='.CLUSTER_TYPE.'\" >>  '.$envfile));\r\ncontroller/runner.php:    $this->ssh->exec(bash('echo \"export PYTHONPATH='.joinPaths(CLUSTER_CHRIS, 'lib', 'py').':\\$PYTHONPATH\" >>  '.$envfile));\r\ncontroller/runner.php:    $this->ssh->exec(bash('echo \"export PATH='.joinPaths(CLUSTER_CHRIS, 'bin').':\\$PATH\" >>  '.$envfile));\r\ncontroller/runner.php:    $this->ssh->exec(bash('echo \"export LD_LIBRARY_PATH='.joinPaths(CLUSTER_CHRIS, 'lib').':\\$LD_LIBRARY_PATH\" >>  '.$envfile));\r\ncontroller/runner.php:    if (CLUSTER_PORT==22) {\r\ncontroller/runner.php:      $tunnel_host = CLUSTER_HOST;\r\ncontroller/runner.php:    $crunWrap = joinPaths(CLUSTER_CHRIS, CHRIS_SRC, 'lib/_common/crun.py');\r\ncontroller/runner.php:    $crunWrap = $crunWrap . ' -u ' . $this->username . ' --out ' . $this->runtimePath . '/_chrisRun_ --err '. $this->runtimePath . '/_chrisRun_ --host ' . $tunnel_host . ' -s ' . CLUSTER_TYPE . ' --saveJobID ' . $this->runtimePath . '/_chrisRun_';\r\ncontroller/runner.php:    $executable = joinPaths(CLUSTER_CHRIS, CHRIS_SRC, 'plugins/', $executableName, '/', $executableName);\r\ncontroller/runner.php:    if (CLUSTER_PORT==22) {\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' -o StrictHostKeyChecking=no ' . $this->username.'@'.$tunnel_host. ' '.$cmd.' >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    $cmd = $cmd.PHP_EOL.'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host.':'.$this->path.'/_chrisInput_.tar.gz ' .$this->runtimePath.' >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err;';\r\ncontroller/runner.php:    $cmd = $cmd.PHP_EOL.'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' rm '.$this->path.'/_chrisInput_.tar.gz >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err;';\r\ncontroller/runner.php:    $cmd = 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P ' .CLUSTER_PORT. ' ' . $this->runtimePath.'/../'.$data.'.tar.gz ' . $this->username.'@'.$tunnel_host.':'.$this->path.'/..  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err;';\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:      $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    if (CLUSTER_PORT==22) {\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/runner.php:    $cmd = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ' .CLUSTER_PORT. ' ' . $this->username.'@'.$tunnel_host . ' '.$cmd.'  >> ' .$this->runtimePath.'/_chrisRun_/chris.std 2> ' .$this->runtimePath. '/_chrisRun_/chris.err';\r\ncontroller/feed.controller.php:      $cluster_kill_command = 'export PYTHONPATH='.joinPaths(CLUSTER_CHRIS, 'lib', 'py'). ';';\r\ncontroller/feed.controller.php:      $cluster_kill_command = $cluster_kill_command . joinPaths(CLUSTER_CHRIS, CHRIS_SRC, 'lib/_common/crun.py');\r\ncontroller/feed.controller.php:      $cluster_kill_command = $cluster_kill_command . ' -u ' . $username . ' --host ' . CLUSTER_HOST . ' -s '. CLUSTER_TYPE . ' --kill ';\r\ncontroller/feed.controller.php:      $cluster_user_path = joinPaths(CLUSTER_CHRIS, 'users', $username);\r\nchris@chris:/neuro/users/chris/src/chrisreloaded (master@6ec3-aded-)$>grep -R \"CLUSTER_\" view/\r\nchris@chris:/neuro/users/chris/src/chrisreloaded (master@6ec3-aded-)$>grep -R \"CLUSTER_\" plugins/\r\nplugins/pacs_pull/pacs_pull:  plugin.add_parameter('HIDDEN', Plugin.STRING, '--clustertmpdir', action='store', dest='CLUSTER', default=plugin.envVars['ENV_CLUSTER_TMP_DIR'], help='TMP DIR')\r\nplugins/recon_all/recon_all:      tempdir = tempfile.mkdtemp('free', 'surf', self.envVars['ENV_CLUSTER_TMP_DIR'])\r\nplugins/mosix_test/mosix_test:        tmpdir      = tempfile.mkdtemp('mosix', 'test', self.envVars['ENV_CLUSTER_TMP_DIR'])\r\nBinary file plugins/plugin1in1out.pyc matches\r\nplugins/fyborg/fyborg:    tempdir = tempfile.mkdtemp('fy', 'borg', self.envVars['ENV_CLUSTER_TMP_DIR'])\r\nplugins/plugin1in1out.py:        tempdir = mkdtemp('free', 'surf', self.envVars['ENV_CLUSTER_TMP_DIR'])\r\nplugins/plugin.conf:ENV_CLUSTER_TMP_DIR: /neuro/tmp\r\n```"}}