Skip to content
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

Dump current running ldmsd configuration #1203

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

nick-enoent
Copy link
Collaborator

Adds "dump_cfg" command to ldmsd_controller and function to ldmsd_communicator to write the current running configuration of a ldmsd in v4 configuration format. The file name will be the hostname and port number used to communicate with the ldmsd, e.g. node-10-10001.conf.

Parameters:
path - path to write the configuration file. If not specified, ldmsd will write to the calling users home directory.

@nick-enoent
Copy link
Collaborator Author

nick-enoent commented May 11, 2023

@tom95858 @nichamon @narategithub Hey guys, would you mind reviewing this? I don't think I can add reviewers to ovis PR's.

@baallan
Copy link
Collaborator

baallan commented May 12, 2023

Please revise to dump result to stdout if path is not specified. Dumping to a home directory is relatively uncommon and surprising for utilities (destroys whatever data may already be there by the same name).

Also please update affected man pages and include documentation changes with the commit.

@baallan baallan assigned baallan and tom95858 and unassigned baallan May 12, 2023
ldms/src/ldmsd/ldmsd_request.c Outdated Show resolved Hide resolved
ldms/python/ldmsd/ldmsd_communicator.py Outdated Show resolved Hide resolved
ldms/python/ldmsd/ldmsd_communicator.py Outdated Show resolved Hide resolved
if (listen->auth_dom_name)
fprintf(fp, " auth=%s", listen->auth_dom_name);
else
fprintf(fp, " auth=DEFAULT");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the else here. If no authentication is specified, the default auth will be used automatically.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this is included is because this configuration assumes that no configuration options will be specified when starting a ldmsd with the "dumped" configuration files. I meant to make a note of this in the top of each configuration file, but dropped the ball. I'm open to a discussion about whether this is the correct approach or not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including auth=DEFAULT is not wrong as long as the generated config file includes a line auth_add name=DEFAULT <other necessary attr-value pairs>. I think this is what your code does, so it is OK to have auth=DEFAULT in the listen line.

Here is the explanation of how ldmsd creates the default authentication domain and how listen and prdcr_add work regarding the auth cmd-line options. ldmsd always automatically adds the default authentication. The -a command-line option is to specify the auth method, e.g., munge and ovis.

  • ldmsd
  • ldmsd -x sock:10001
  • ldmsd -c ldmsd.conf and ldmsd.conf contains listen xprt=sock port=10001.

The three ldms daemons started by the above commands have the same default authentication, which uses 'auth_none.' The last two ldms daemons listen on the same port, using the same transport and the same default authentication.

ldms/src/ldmsd/ldmsd_request.c Show resolved Hide resolved
ldms/src/ldmsd/ldmsd_config.c Outdated Show resolved Hide resolved
ldms/src/ldmsd/ldmsd_request.c Outdated Show resolved Hide resolved
ldms/src/ldmsd/ldmsd_request.c Outdated Show resolved Hide resolved
ldms/src/ldmsd/ldmsd_request.c Outdated Show resolved Hide resolved
ldms/src/ldmsd/ldmsd_request.c Outdated Show resolved Hide resolved
@nichamon
Copy link
Collaborator

@nick-enoent Please add the new command to ldmsctl too.

@baallan
Copy link
Collaborator

baallan commented May 22, 2023

@nick-enoent there are several plugins that use the keywords as well as the key=value, so keyword list should be captured.

Command dump_cfg added to ldmsd_controller and ldmsd_communicator.
Writes the current running configuration to a file named after the daemon's host
and communication port, <hostname>-<port>.conf, in path specified in argument. If
no path is specified it writes the file to the user's home path.

Parameters:
path - [optional] The path to the configuration file
@tom95858 tom95858 merged commit 7d0cfad into ovis-hpc:OVIS-4 Jul 3, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants