Author Topic: Remote build from OSX  (Read 2961 times)

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Remote build from OSX
« 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

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: Remote build from OSX
« Reply #1 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&

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: Remote build from OSX
« Reply #2 on: November 02, 2015, 01:51:44 pm »
Oops. That needs to be +supty. The - turns this switch off which is the default.

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Re: Remote build from OSX
« Reply #3 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

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 863
  • Hero Points: 55
Re: Remote build from OSX
« Reply #4 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]

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Re: Remote build from OSX
« Reply #5 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.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 863
  • Hero Points: 55
Re: Remote build from OSX
« Reply #6 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. 

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Re: Remote build from OSX
« Reply #7 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

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 863
  • Hero Points: 55
Re: Remote build from OSX
« Reply #8 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.

pvonkaenel

  • Senior Community Member
  • Posts: 211
  • Hero Points: 6
Re: Remote build from OSX
« Reply #9 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

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 863
  • Hero Points: 55
Re: Remote build from OSX
« Reply #10 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.

tim_k

  • Senior Community Member
  • Posts: 113
  • Hero Points: 6
Re: Remote build from OSX
« Reply #11 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

rowbearto

  • Senior Community Member
  • Posts: 946
  • Hero Points: 44
Re: Remote build from OSX
« Reply #12 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.
« Last Edit: March 09, 2018, 08:28:23 pm by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 946
  • Hero Points: 44
Re: Remote build from OSX
« Reply #13 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
« Last Edit: March 09, 2018, 08:39:57 pm by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 946
  • Hero Points: 44
Re: Remote build from OSX
« Reply #14 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