SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: pvonkaenel on October 31, 2015, 07:51:43 PM

Title: Remote build from OSX
Post by: pvonkaenel on October 31, 2015, 07:51:43 PM
Hi there,

I'm currently trying to use the OSX version of SE to edit files for a Linux project.  What I'd like to do is add a "Remote Build" command to trigger a remote build of the project, but I'm having problems using ssh from the SE command line.  Whenever I try to ssh from the terminal I get the following:

Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

Is there anything special I need to do in the OSX version of SE to either get ssh to work from the terminal, or to trigger a remote build?

Thanks,
Peter
Title: Re: Remote build from OSX
Post by: Clark on October 31, 2015, 09:52:49 PM
You can try invoking SlickEdit with the -supty switch. It will try to make a pseudo tty for the process buffer. I don't know if or how well it works on Mac.

vs -supty&
Title: Re: Remote build from OSX
Post by: Clark on November 02, 2015, 01:51:44 PM
Oops. That needs to be +supty. The - turns this switch off which is the default.
Title: Re: Remote build from OSX
Post by: pvonkaenel on November 03, 2015, 03:26:53 PM
Well, it did behave differently, but still not correct.  I started vs from the command line using the argument you suggested, but when I try to ssh to my remote machine from the SE command line, the bash problem where I started vs had a continuous loop requesting credentials.

Any other ideas?  I'd really like to use the OSX version of SE since it just plain works better than the Linux version in XQuartz.

Thanks,
Peter
Title: Re: Remote build from OSX
Post by: patrick on November 03, 2015, 06:35:31 PM
So, if you run SlickEdit without the +supty option, does it work for you if you try it like the following?

SSH_ASKPASS=$VSLICKBIN/vs-ssh-askpass ssh [rest of your ssh command]
Title: Re: Remote build from OSX
Post by: pvonkaenel on November 03, 2015, 08:39:22 PM
This is bit different also.  It did pop up a credentials dialog box, but after entering my passwd, it just seemed to hang with the following in the SE terminal:

[SE peter@nj-orca /]$ SSH_ASKPASS=$VSLICKBIN/vs-ssh-askpass ssh myaccount@10.81.100.94
Pseudo-terminal will not be allocated because stdin is not a terminal.
vs-ssh-askpass password: vs-ssh-askpass done.
Title: Re: Remote build from OSX
Post by: patrick on November 03, 2015, 08:48:59 PM
Interesting.  On mine, I don't get any command prompt (I should have warned about that), but I can still type in commands like ls, and have the output come back. 
Title: Re: Remote build from OSX
Post by: pvonkaenel on November 03, 2015, 09:20:29 PM
Okay, it kind of works.  I guess as long as I have the build commands in all their verbose glory (ssh to a linux box to use a Docker build container), it might work.  I'll give it a shot.

Any idea if there are plans to make this easier?  I think I had something similar which worked really well in Slickedit v4 for OS/2 to trigger builds under Solaris.

Thanks,
Peter
Title: Re: Remote build from OSX
Post by: patrick on November 04, 2015, 04:57:44 PM
There's a feature request for terminal emulation, which I will add your post to.   We know from previous passes at it that it's not an easy fix.  'ssh' needs several more features from our pseudo terminal implementation to be able to prompt for a password within the build window.

I agree automating remote actions like that can certainly be a pain for cases where you can't distill the remote action into a script that you can just call with 'ssh user@remote StartTheBuildCommand' or something similar.
Title: Re: Remote build from OSX
Post by: pvonkaenel on November 04, 2015, 06:05:36 PM
Well that's an interesting statement.  Should it work if I script everything?  I'm not worried about credentials being in the script since I'm trying to trigger a build in a Vagrant/Docker image which everyone uses with the same credentials.  I'll give it a try.

Thanks,
Peter
Title: Re: Remote build from OSX
Post by: patrick on November 04, 2015, 07:18:49 PM
Scripting it like that (if you can) doesn't change any of the issues you saw, it would just make it so you wouldn't have to type in a lot of stuff on a live SSH session that isn't showing prompts in the build window.  You'd still need to override the SSH_ASKPASS for the ssh command that calls the remote script.
Title: Re: Remote build from OSX
Post by: tim_k on March 09, 2018, 06:33:24 PM
Bumping this one to see - has anything more been done on this? I'd love to have real remote build capability. I'm running on a Mac but everything builds on a linux farm. Being able to build from within SE and get all the benefits there would be great.

-Tim
Title: Re: Remote build from OSX
Post by: rowbearto on March 09, 2018, 08:24:05 PM
I do remote builds inside SE with ssh (from one linux machine to another), but I have my own homemade python wrapper script that invokes ssh inside a pseudo-terminal.

My wrapper is proprietary but I think you can use the "script" command to run ssh inside of a pty. Something like "script -eqfc yourscript" will run "yourscript" inside of a pty - then you can invoke ssh under a pty without launching SE with any special parameters. Google around for "script" and "pseudoterminal" and you may find what you need.

My wrapper is kind of fancy in that it can trap a SIGINT or Ctrl-C, and send it to the remote so that SIGINT is invoked on the remote for doing a more proper abort of the build - if you have the time to invest in a wrapper like this it could help you with smoother build cancellation - but maybe script will work ok - give it a try.
Title: Re: Remote build from OSX
Post by: rowbearto on March 09, 2018, 08:27:27 PM
Did some more digging, try invoking this as your SE build line to run any build command inside a pseudo-terminal.

script -eqfc "<build_command_to_run>" /dev/null

If you want to actually log the build output, change /dev/null to the path for your logfile.

Example:

script -eqfc "ssh user@host make target" /dev/null
Title: Re: Remote build from OSX
Post by: rowbearto on March 09, 2018, 09:01:20 PM
Just noticed that can launch "ssh user@host command" without wrapping in script, and it can run a remote command from the SE terminal - did this from the prompt in SE build window - but maybe if you invoke from SE build it is different story.

With or without using 'script', this assumes you already setup ssh passwordless login with your public/private key - which should be a given for anything like this - don't want to be asked for username/password when invoking a build.

Also useful is to add the following into your $HOME/.ssh/config file so you are not asked about unknown hosts or pesky ssh security things:

Host *
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null
  LogLevel=quiet
Title: Re: Remote build from OSX
Post by: tim_k on March 12, 2018, 01:49:56 PM
Thanks for the info rowbearto.

Unfortunately, I'm in a pretty security paranoid environment and I'm not sure I can go with a key pair login. I'll have to investigate. The ideal scenario for me is that I log into a ssh session once in the SE build terminal, and everything executes there. I've tried just logging in and the password prompt confuses things and I get disconnected for too many authentication failures. I never even see the password prompt.

-Tim
Title: Re: Remote build from OSX
Post by: rowbearto on March 12, 2018, 01:59:06 PM
I'd be surprised if you can't use key pair, but if you really can't, try running ssh inside of "script" in the SE terminal so that it can be provided a pty:

script -eqfc "ssh user@host" /dev/null

I think ssh needs to think it is running in a terminal in order to provide password prompt, running inside script will make ssh think that.