-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: ssh/scp data for tcbsd PLCs #25
Conversation
… from each source
I think I should clean up some of the messiness before asking for reviewers on this one |
For now, I've made the docs build optional. I'll handle making a real docs build at some later date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read through the changes, lgtm!
I'm going to fix some subtle copy/paste issues I see in the docstrings and merge later today (giving some chance if others want to/have time to peek at it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Zach confirmed that this has been tested on the old PLCs as well as the new ones.
Description
Big idea: we can upload files to and download files from the TcBSD PLCs using scp instead of ftp, which is more modern and secure and is enabled by default on these. The old ftp support stays for backwards compatibility, because the old PLCs cannot use ssh/scp.
Main changes:
ssh_data
has been added with a similar API toftp_data
, but it uses ssh/scp as the transport mechanism.plc_data
has been added, which imports fromftp_data
andssh_data
and picks the method to use. It does this by trying ssh, and then trying ftp if ssh fails, and caching which one succeeded for next time.data_types
has been added, which currently generalizes the file info from each data source so that functions that may expect either can do type checking. In the future this may also have structs to help give us more detailed pmps parameter comparisons. This also required me to renamecreated_time
->modified_time
to more accurately support both ssh and ftp at the same time.cli
andgui
modules will import fromplc_data
instead of fromftp_data
and are otherwise unchanged.ftp_data
toplc_data
fabric
as a runtime dependency for the ssh/scp data transfer.Other changes:
setuptools-scm
as a runtime dependency because it is not used at runtime.Some remaining sloppiness:
data_types
module last year (?) and then didn't use it anywhere. I think I was intending to augment the comparison operations but I never implemented anything further. I should probably delete it or banish it to its own branch. (resolved: remove unused elements from data_types, keep the ones useful for comparing files between PLCs)Motivation and Context
See above, but largely: scp is more secure and is enabled by default on the new PLCs. The rest of the code doesn't have to change very much to accommodate new data transfer methodologies.
Related to:
pcdshub/lcls-twincat-motion#215
pcdshub/twincat-bsd-ansible#19
How Has This Been Tested?
Interactively only
Where Has This Been Documented?
Setup for the ecs-user account is documented on this page: https://confluence.slac.stanford.edu/display/PCDS/TcBSD+PLC+Setup
Pre-merge checklist