OpenFabrics / fsdp_setup

Setup scripts for use with the FSDP cluster
GNU Lesser General Public License v2.1
0 stars 1 forks source link

Need to finalize dhcp config file handling #17

Closed dledford closed 2 years ago

dledford commented 3 years ago

Right now, the setup scripts simply tftp the $HOST.conf.# files to the tftp server in the directory hosts.d.

There are two issues with this:

1) The client can't delete old files, they can only overwrite them. This is fine, unless you have a reduction in the number of interfaces in a machine, in which case it's impossible to remove the stale, old files. 2) We still don't have a way to tell builder to restart the dhcp server. We had talked about a small daemon listening on a port that we can ping to make it happen. Which sounds fine to me.

I suggest we kill to birds with one stone. A simple php/python script on the web server of builder-00 that has a page that will take a POST element of a machine name and delete all the dhcp files from hosts.d/ would solve the removing old files. Likewise, a page that we can simply hit to trigger a dhcp server reload would solve the other one. Of course, once you have these two pages, a third page to upload files and turn off tftp entirely would work too and only be a minor bit of additional work. So I'm not sure if we want to keep tftp or not, but this might work for the other aspects.

How think you @lylavoie?

lylavoie commented 3 years ago

Yup, we can even make the API support the "Delete" rest call, so you can delete specific files (in the allowed locations), so that is easy to fix and support. I was expecting to make an endpoint that would rebuild and restart and one that would just restart, in addition to the delete. Let me know if there are other things you want it to do.

On Fri, Jun 11, 2021 at 10:32 AM Doug Ledford @.***> wrote:

Right now, the setup scripts simply tftp the $HOST.conf.# files to the tftp server in the directory hosts.d.

There are two issues with this:

  1. The client can't delete old files, they can only overwrite them. This is fine, unless you have a reduction in the number of interfaces in a machine, in which case it's impossible to remove the stale, old files.
  2. We still don't have a way to tell builder to restart the dhcp server. We had talked about a small daemon listening on a port that we can ping to make it happen. Which sounds fine to me.

I suggest we kill to birds with one stone. A simple php/python script on the web server of builder-00 that has a page that will take a POST element of a machine name and delete all the dhcp files from hosts.d/ would solve the removing old files. Likewise, a page that we can simply hit to trigger a dhcp server reload would solve the other one. Of course, once you have these two pages, a third page to upload files and turn off tftp entirely would work too and only be a minor bit of additional work. So I'm not sure if we want to keep tftp or not, but this might work for the other aspects.

How think you @lylavoie https://github.com/lylavoie?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenFabrics/fsdp_setup/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXKZ7O6FSJS4SFLJQSN7ULTSIM7PANCNFSM46Q3RTPQ .

-- Lincoln Lavoie Principal Engineer, Broadband Technologies 21 Madbury Rd., Ste. 100, Durham, NH 03824 @.*** https://www.iol.unh.edu +1-603-674-2755 (m) https://www.iol.unh.edu

JSpewock commented 2 years ago

@dledford The api service should be running properly on the server now if you wanted to trying curling to it. I wrote all the routes in the README.md file that is inside the builder-00 directory. At the top is just a table of the general routes, actions, and methods and then further below I also wrote the expected outputs and what each would mean. It's running under the service dhcp_api on builder so you should be able to check the status, restart it, or end it if needed using systemctl commands. NOTE: both restart DHCP4 and restart DHCP6 routes currently aren't working as there is an error preventing those services from starting. Let me know if there are any other issues or if you need me to clarify anything.

dledford commented 2 years ago

@JSpewock Where is the builder-00 directory that I'm supposed look into? Is it in your checkout of this git repo, or do you mean somewhere on builder-00 itself?

lylavoie commented 2 years ago

@dledford there is a branch in fsdp_setup repo with all of this work. We haven't finalized yet, so no pull request has been made yet.

dledford commented 2 years ago

@lylavoie OK, I can take a look. Can you guys go ahead and start the service so I can start testing against it? Also, for all of the operations with method POST, none of them appear to need any data, does it matter what the contents of the POST data are? Finally, I'm not sure I've ever heard of a DELETE method and curl --help has nothing to say about a possible DELETE method. Can you expound on that?

lylavoie commented 2 years ago

@dledford The DELETE method is part of the HTTP specifications, since it allows deleting of API endpoints, etc. Example of some documentation is here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods For curl, you can do something like curl -X DELETE url_ref.

JSpewock commented 2 years ago

@dledford As for the POST methods, they don't need data so it shouldn't matter what data you give them. They aren't setup to process any of it so I believe if you hand them any data in your request it will just get ignored.