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

[WAIT] - Automationtest #585

Closed
wants to merge 5 commits into from
Closed

[WAIT] - Automationtest #585

wants to merge 5 commits into from

Conversation

davidelang
Copy link
Collaborator

The splitaplist script splits the aplist.csv into apmac.csv (map of serial number to mac address)
and apuse.csv (the rest of the info, not counting the ipv4 network prefix)

there is an additional file roommap.csv that identifies:
what building each room prefix is in
what the ip range is for that room
what map id it would appear on

buildaplist takes these files and creates a new aplist.csv that has the correct combination of information

when editing the aplist directly we tend to change the name and the rest of the stuff stays the same
this breaks when the spare was in a different building
it also drags the rest of the per-location information from the spare

This new approach lets us change what AP is where by editing the apuser.csv file
with the mac changing automatically in the aplist.csv file
while keeping the rest of the per-location information being the same

@davidelang
Copy link
Collaborator Author

talking with Rob, do we want to eliminate aplist.csv entirely and have a checkin/deployment time script use the new files directly?

this would avoid confusion for people who see the aplist file and think it can/should be edited directly (the splitaplist script can take an aplist file and extract the other files from it, so if someone does edit aplist directly, we have a path to use the new approach, it just leads to confusion)

@davidelang
Copy link
Collaborator Author

additional commit time checks can be written to make sure there are no duplicate mac addresses or serial numbers in the apmac and apuse files

future automation can auto-assign IP addresses and channels (for a first pass to make sure we don't have everything in the room on the same channel anyway :-) )

@sarcasticadmin sarcasticadmin changed the title Automationtest [WAIT] - Automationtest Mar 13, 2023
@kylerisse
Copy link
Member

I tend to agree @davidelang . There's no need to maintain a derivative file aplist.csv if it can be reproduced and validated at deploy time consistently, especially through the Nix process. I can help.

@sarcasticadmin
Copy link
Member

This all seems reasonable enough, as a part of this Ill work on updating the drv so that this information actually flows to the kea config. Then we can drop the original aplist.csv all together

@owendelong
Copy link
Collaborator

IMNSHO:

We should only have one source of truth for any datum maintained in the repo. Any file which can be produced from other files in the repo containing the data should not be maintained in the repo and should be treated as object code built from the source code in the repo.

@davidelang
Copy link
Collaborator Author

davidelang commented Mar 23, 2023 via email

@sarcasticadmin
Copy link
Member

Rob is talking about modifying the tooling that consumes aplist to instead
consume the separate files. I'm in favor of this, but was not pushing this
initially just to minimize the impact of changes.

Yep exactly

@owendelong
Copy link
Collaborator

Excellent. Sounds like we all agree.

@davidelang
Copy link
Collaborator Author

see #494 and handle as part of the tooling

@owendelong
Copy link
Collaborator

This is still labeled wait, but has been reviewed and appears ready for merging... Is there still a reason for the WAIT designation?

@owendelong
Copy link
Collaborator

If the WAIT is for the retooling, I see two reasonable scenarios and I'm OK with either one, but we should pick one and act accordingly:

  1. Merge this PR and do the needful with the retooling (including deprecating the split script) in a later PR
    or
  2. Reset the review state on this PR and do a fresh review when those additional changes have been incorporated into it.

I'm not OK with leaving this PR waiting for additional work after being reviewed such that it can be merged without further review after more (significant) work is done on it. It's one thing to do minor corrections based on the review and then merge, but an entirely different thing to make significant additional changes without having a review required.

@sarcasticadmin
Copy link
Member

sarcasticadmin commented Nov 8, 2023

After taking another look at here were some things that popped out to me:

  1. With this PR we still dont have a single, isolated source of truth for the serial or mac address. Since aplist.csv is required to be present to regenerate a new aplist.csv since its the only place that the serial and mac address are stored. My preference would be to have this be an input to aplist.csv this way its no longer modified after we confirm the inventory of the aps. This would go a long way to actually tracking our complete list of aps
  2. roommap.csv doesnt seem necessary since we can get this from https://github.com/socallinuxexpo/scale-network/blob/e857c20374465b3b1b810c70c8339a65286b4156/switch-configuration/config/vlans.d/Conference

What I think would be better would be to separate this into two files slightly differently:

  1. serial,mac address - This should change pretty much never unless we update our inventory of APs. Call this aps.csv
  2. name,serial,ipv4.ipv4,2.4Ghz_chan,5Ghz_chan,config_ver,map_id,map_x,map_y - The stuff that pretty much already makes up apuse.csv but is subject to change

Bonus here is that we could get away from labeling spares in the apuse.csv but keep them tracked via the aps.csv

@owendelong
Copy link
Collaborator

After taking another look at here were some things that popped out to me:

  1. With this PR we still dont have a single, isolated source of truth for the serial or mac address. Since aplist.csv is required to be present to regenerate a new aplist.csv since its the only place that the serial and mac address are stored. My preference would be to have this be an input to aplist.csv this way its no longer modified after we confirm the inventory of the aps. This would go a long way to actually tracking our complete list of aps
  2. roommap.csv doesnt seem necessary since we can get this from https://github.com/socallinuxexpo/scale-network/blob/e857c20374465b3b1b810c70c8339a65286b4156/switch-configuration/config/vlans.d/Conference

What I think would be better would be to separate this into two files slightly differently:

  1. serial,mac address - This should change pretty much never unless we update our inventory of APs. Call this aps.csv
  2. name,serial,ipv4.ipv4,2.4Ghz_chan,5Ghz_chan,config_ver,map_id,map_x,map_y - The stuff that pretty much already makes up apuse.csv but is subject to change

Bonus here is that we could get away from labeling spares in the apuse.csv but keep them tracked via the aps.csv

I really like this approach... David? Any thoughts?

Copy link
Collaborator

@owendelong owendelong left a comment

Choose a reason for hiding this comment

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

Hoping this will change the status of my previous approval.

@owendelong
Copy link
Collaborator

Hoping this will change the status of my previous approval.

Yay.. That worked.

@davidelang
Copy link
Collaborator Author

davidelang commented Nov 8, 2023 via email

@davidelang
Copy link
Collaborator Author

roommap is covering data not in switchconfig.

this is related to the idea of creating a monitoring map that shows devices overlayed on a map of the facilities. The split may not be the right one yet as the coordinates of the AP on the map are in the apuse file.

a better thing for this may be to have the roommap also have some coordinates to define the rectangle of the room and then have the coordinates in the apuse file be relative coordinates

note that we are not currently generating these maps, so it doesn't really matter yet.

@owendelong
Copy link
Collaborator

owendelong commented Nov 8, 2023 via email

@tweak42
Copy link

tweak42 commented Nov 19, 2023

In consultation with David, I created a database schema that breaks down the data fields into three tables / files.

See the pretty graphic here:
https://dbdiagram.io/d/Scale-Access-Point-table-reference-655930ae3be14957874478d7

Here's a copy paste of the raw text, including comments.

Table AP_physical {
  serial_num varchar [primary key]
  mac_address varchar
  problem_flag varchar // text field for problems
}

Table Rooms_facts {
  room_name varchar [primary key]
  mapID integer // see site map
  bottom_left_px integer  // screen pixel dimensions
  top_right_px integer
  dim_x_ft integer // physical room dimension
  dim_y_ft integer
  }

Table AP_locations {
  AP_location varchar [primary key]
  room_name varchar // implied field, derived from AP_loc, split AP_loc by - and use the first field as RM_name
  serial_num integer
  IP_address  varchar
  channel_24 integer
  channel_50 integer
  switch_config varchar
  x_ft integer // coords inside of room
  y_ft integer
}

Ref: AP_physical.serial_num - AP_locations.serial_num
Ref: Rooms_facts.room_name < AP_locations.room_name

@owendelong
Copy link
Collaborator

owendelong commented Nov 20, 2023 via email

@@ -0,0 +1,36 @@
name,map_id,ll_px_x,ll_px_y,ur_px_x,ur_px_y,x_ft,y_ft
Copy link
Member

Choose a reason for hiding this comment

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

@davidelang arent we missing the csv with the serials and macs?

@davidelang
Copy link
Collaborator Author

davidelang commented Nov 28, 2023 via email

@owendelong
Copy link
Collaborator

Closing with prejudice, will not be implemented.

@owendelong owendelong closed this Mar 13, 2024
@sarcasticadmin sarcasticadmin deleted the automationtest branch September 19, 2024 16:20
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.

5 participants