robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

Identify SSH client for deployment #25

Closed virtuald closed 9 years ago

virtuald commented 9 years ago

Ideally, I think the RobotPy/wpilib deployment script (#2) should run from the user's computer, and that they don't need to have to figure out how to ssh/scp files to the RoboRIO -- which, while easy, isn't always the most intuitive thing.

Another requirement for the installer is that we shouldn't require Windows users to have a compiler installed, in order for them to run the installer successfully. Having a compiler requirement on Windows will limit our user base.

OSX/Linux users will already have SSH installed, so there we could just interact with those via the command line.

Paramiko/fabric are great tools to use for SSH in native python, but require compilation + dependencies. One possible workaround is using pyinstaller to create a binary package for Windows, but it only has experimental python3 support.

Alternatively, we could write the installer in a different language and distribute a binary that way.

Solving this problem will be necessary for pyfrc to continue to be a useful mechanism to upload code to the robot.

virtuald commented 9 years ago

@Twinters007 this is the problem I was mentioning earlier

PeterJohnson commented 9 years ago

Why can't we just use pscp (and plink for running remote shell commands)?

virtuald commented 9 years ago

Ha. I haven't used Windows in so long, that I forgot about those.

computer-whisperer commented 9 years ago

What about some form of rsync? I have found that scp can be rather inefficient when copying large numbers of small files, and when you are actively developing code for a robot, you may not need to transfer everything. Plus, I just did some tests with the wpilib library as an example, and scp took ~3 min to transfer to a remote server vs ~10 sec with rsync.

Also, here is a native python implementation of it: http://freecode.com/projects/pysync/

virtuald commented 9 years ago

I have found using rsync on Windows is problematic. Also (and this surprised me a few months ago), it requires an rsync binary to be present on the remote machine.

computer-whisperer commented 9 years ago

Does the roborio have it pre-installed?

virtuald commented 9 years ago

It does not.

PeterJohnson commented 9 years ago

The RoboRIO has tar and unzip. Why can't we zip/tar locally, scp the zip/tar file, and run the right remote command to unzip/untar? I would recommend tar as there's some options we can use to only update files that have later modification times.

PeterJohnson commented 9 years ago

For wpilib/hal, we should use the opkg package manager (uses .ipk files which are basically tgz files with a required package structure) to install them on the RoboRIO. For user programs, we can use tar or zip.

virtuald commented 9 years ago

I think I disagree with that -- let's not do more packaging than we need to do. We already have python packages for wpilib/hal/et al. Why not distribute those as sdists, copy them to the robot, and run 'pip install foo.tar.gz' there? This will allow us to also have the installer do things like install utility libraries/etc without extra effort (#6).

Python 3.4 comes with pip preinstalled, so I assume that the python ipk has it.

PeterJohnson commented 9 years ago

Whoops, I forgot that we already had this discussion... been a long week. Concur that pip is fine to use for the libraries after Python is installed with an ipk.

Yes, pip is installed as part of the Python package.

virtuald commented 9 years ago

Haha, I thought we had this discussion, but I too had forgotten.

PeterJohnson commented 9 years ago

Can this be closed? It looks like the install scripts use the putty tools on Windows.

virtuald commented 9 years ago

Yes, thanks. They even work too, I tested it a few minutes ago.