-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/trace-collector-service #12
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
base: main
Are you sure you want to change the base?
Feature/trace-collector-service #12
Conversation
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.
Please squash the commits.
docker-compose.yml
Outdated
volumes: | ||
- /home/.ssh:/root/.ssh:ro | ||
- /home/ndnops/traces:/dump | ||
- ${PWD}/dist/nlsr:/config |
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.
Do you really need write access to the ${PWD}/dist/nlsr
folder?
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.
I was trying to figure this out, we need the nlsr.conf
file, but the read
access should be enough.
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.
This was a semi-hack we had in the old scripts to get a unique "node name", IIRC. I think we can do better now with the new framework, e.g. pass the name to the container via env or something...
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.
@pulsejet what's the easiest way to pass the site
from host_vars to the container?
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.
Create a new config template, have the container read off 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.
The latest commit has an entrypoint.sh.j2
template which directly reads site name.
As discussed in 2025-02-28 meeting, the SSH key pair should be handled as follows:
Upon service start, the entrypoint script should perform the following:
After the first run of the service, the public key of a router shall be retrievable with ndncat command: ndncat get-segmented /ndn/edu/neu/file-server/trace-collector-pubkey/id_ed25519.pub |
1199061
to
6d82848
Compare
The
If we just mount ssh and dump subdirectories under the trace-collector ($PWD/dist/trace-collector/.ssh, etc.), it probably should be enough instead of asking persistent volumes. Please suggest what's best. @pulsejet |
# Ensure permissions | ||
mkdir -p "$SSH_DIR" | ||
chmod 700 "$SSH_DIR" |
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.
ssh-keygen should already take care of this, no?
# Generate SSH key pair if not already present | ||
if [[ ! -f "$PRIVATE_KEY" || ! -f "$PUBLIC_KEY" ]]; then | ||
echo "[trace-collector] No SSH key pair found. Generating a new one..." | ||
ssh-keygen -t rsa -b 4096 -N "" -f "$PRIVATE_KEY" |
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.
can we use ed25519 instead of rsa?
SSH_DIR="/root/.ssh" | ||
PRIVATE_KEY="$SSH_DIR/id_rsa" | ||
PUBLIC_KEY="$SSH_DIR/id_rsa.pub" | ||
PUBKEY_EXPORT_PATH="/file-server/trace-collector-pubkey/id_rsa.pub" |
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.
Just set this to the directory instead of the file name, it seems simpler. The file name should just be the standard one used by openssh (e.g. id_rsa.pub
or id_ed25519.pub
).
The same applies to the previous two variables. Specifying the file name seems pointless unless there's a way to pass a different identity to the container. If we don't have a use case for this, just keep it simple and use the default openssh naming conventions.
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.
The file name has been referenced multiple times in the script: Checking existence, non-interactive generation with the file name specified, and during copying. Should we keep the private and public key variables? The export path I believe can just be a directory name.
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.
Should we keep the private and public key variables?
If you prefer to use a variable, that's fine. But one variable for the private key should be enough, the public key name should always be privatekey + .pub
per openssh conventions.
The export path I believe can just be a directory name.
On second thought, we should really avoid using a dot in the NDN name of the pubkey (e.g. id_rsa.pub
) because one dot becomes four dots in NDN URI syntax, which is quite ugly. I'd say just use the directory name trace-collector-pubkey
as the actual key name. I don't think we need a subdir for this.
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.
one dot becomes four dots in NDN URI syntax
False.
One dot becomes four dots only if the component consists solely of dots.
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.
If you prefer to use a variable, that's fine. But one variable for the private key should be enough, the public key name should always be privatekey +
.pub
per openssh conventions.
Sure.
restart: unless-stopped | ||
depends_on: | ||
nfd: { condition: service_healthy } | ||
file-server: { condition: service_healthy } |
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.
is there an actual dependency on the file server?
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.
I put this there I think from a documentary perspective, there is no actual dependency. It should be just nfd
.
This adds a dockerized trace collection service.
ndntdump-exp-2023
to generictraces
which will be present on the host and will contain collected traces.Source repository: https://github.com/tntech-ngin/ndn-traffic-capture-scripts/tree/feature/docker