-
Notifications
You must be signed in to change notification settings - Fork 1
Development and Interaction Set Up
Since the ZCU is low powered, I don't want to be doing things that are unnecessary there (because its slow and I'm worried about disk space). For this reason, I do all of my analysis are large-scale refactoring on a different computer - called dev
in these notes. I will refer to the ZCU102 connected to the HGCROC as zcu
in these notes.
In order to make this interaction more seamless, I use ProxyJump to make sure I can SSH directly to zcu
from dev
.
The relevant parts of my SSH config on dev
are
# file: dev:~/.ssh/config
# central computer in our lab, need to get there first
Host cmslab1
HostName cmslab1.spa.umn.edu
ProxyJump spa-ssh-01.spa.umn.edu # SSH entrypoint node
Host zcu
User eichl008
ProxyJump cmslab1
HostName zcu102-ldmx
Match host *.spa.umn.edu
User eichl008
and I needed to copy my public key ID to both cmslab1
and zcu
(e.g. using ssh-copy-id
):
# on dev machine
ssh-copy-id cmslab1
ssh-copy-id zcu
Now that I can ssh zcu
from dev
without multiple password typings, its easier to copy files between them.
Specifically, I usually put the data files produced by runs of pftool
into pflib/data
and so I mount this directory into dev
so I can get immediate access.
# in pflib on dev
sshfs zcu:pflib/data data
It is important to unmount this directory after you are done with your work.
fusermount -u data
A longer sshfs
command can be more helpful (constructed after reading this askubuntu thread and looking at man sshfs
).
sshfs \
-d \ # print debug information
-o reconnect \ # auto-attempt reconnect if connection interrupted
-o ServerAliveInterval=15 \ # interpret connection as dropped if no response from host after 3*15 s
-C \ # enable compression
zcu:pflib/data data
I don't really understand the debug information it prints, but it does keep the command in the foreground so if I kill it with Ctrl+C
then the directory is unmounted and I don't need to run the fusermount -u
command.
If you don't like SSHFS or its not as responsive due to network limitations, you can also rsync
.
rsync
is not currently installed into the ZCU image, so you could do that yourself in order to enable it.
# need to have admin install rsync on the ZCU as well
rsync -avmu zcu:pflib/data/ data/
Using scp
works out-of-the-box though because it comes with SSH.
scp -r zcu:pflib/data/ data/
Warning
scp
will copy all of the files on every call so it might be preferable to be more specific about which files you want to copy.
Sometimes I find myself wanting to do a more major refactor or to write some code that doesn't interact directly with the ZCU/HGCROC (e.g. developing the Menu apparatus or decoding).
These developments do not need to happen on the low-powered ZCU.
I've written a Containerfile
(in pflib/env) which can be used to build a container image which mimics the ZCU environment and I've added a justfile
to pflib since many of us already have just
+denv
installed for use with ldmx-sw.
# once on your dev computer, builds the image and then initializes a denv
just init
And then you can use the other just
recipes to configure, build, and test pflib away from the ZCU.
just configure build test
We often want to share what we did with pftool
with another person so that they can see what we did, how to run a specific command, or the bug we are observing.
The script
command is helpful for this purpose. It captures all output (including normally escaped sequences like backspace and ansi colors) from running with a command and writes them to an output file.
script -c './pftool -z' pftool-record.log
This command opens pftool
like normal but records everything in the session until you exit into the pftool-record.log
file. As mentioned earlier, this includes backspace and ansi color characters, so viewing this file with less -R
is suggested. You can also use tools like ansi2html
or ansi2txt
to remove most of the escape sequences from the log file for easier viewing/sharing.
Cleaning
ansi2txt <pftool-record.log >pftool-record-no-ansi.log
sed 's/[^[:print:]]//g' pftool-record-no-ansi.log > pftool-record-no-special.log