Skip to content

Aux data inserters-->aux data managers#67

Merged
webbpinner merged 11 commits intoOceanDataTools:dev_2.5from
ljones37oet:aux-data-manager
Mar 6, 2026
Merged

Aux data inserters-->aux data managers#67
webbpinner merged 11 commits intoOceanDataTools:dev_2.5from
ljones37oet:aux-data-manager

Conversation

@ljones37oet
Copy link
Copy Markdown

This change simplifies and expands aux data processes by:

  • Moving common code out of the aux_data_record_builders into an abstract base class and standardizing external connections
  • Moving common code out of the aux_data_inserters into a runner script
  • Adding aux_data_file_cleaners to handle custom requirements when deleting aux data
    • For example, if you use a FramegrabHTTPAuxDataRecordBuilder to copy an image onto the sealog server before creating an aux data record, you would probably want to use a DeleteFilesAuxDataFileCleaner to delete that image from the sealog server before deleting the corresponding aux data record
  • Changing aux_data_inserters into aux_data_managers and updating event aux data deletion logic to match event aux data creation logic
    • Now, when you delete or update the time of an event through the events API, the API publishes a deleteEvents websocket message instead of deleting aux data straight from the db. The aux_data_managers are subscribed to these messages and will trigger the AuxDataFileCleaners before sending a request to the event_aux_data API to delete the data

OET is using this code in our dev environment (with some other managers/builders/cleaners that I did not include since they are pretty OET-specific) and plan on using it in production once the season starts. I thought I would create a pull request in case it's helpful for anyone else.

…x and Coriolix implementations

Note: initial refactor was done by CoPilot and then edited by me
insert_aux_data_from_ws now runs one connection session and raises exceptions cleanly on disconnect
The outer loop in run_aux_data_inserter is now the sole responsibility for retry logic.
inner loop = "listen for events", outer loop = "reconnect on failure"
Instead of directly interacting with the eventAuxDataTable, the events API endpoints now publish deleteEvents messages, which the aux_data_managers are listening for.
When an aux_data_manager receives a deleteEvents messages, it sends the contents to its aux_data_file_cleaner(s) which do any external clean up required and then send a delete request to the API event_aux_data endpoint

# Conflicts:
#	routes/api/v1/events.js
…en you delete framegrab aux data, it will also delete the images from the sealog files

Note: we do not use framegrab, so I didn't have a great way to test this, but it is very similar to our stillcap_ffmpeg aux data mgr, which I have tested extensively
Lint all files, alphabetize imports, remove unused functions, use built in logger
@webbpinner webbpinner merged commit 116efc0 into OceanDataTools:dev_2.5 Mar 6, 2026
1 check 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.

2 participants