-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Is your feature request related to a problem?
Yes. Currently, simulations in EarthFrame are required to reference a valid machine_id from the machines table (here). However, users may submit simulations that originate from external or unregistered machines (e.g., development clusters, personal workstations, or automated systems). This causes validation or database integrity errors when the referenced machine does not exist.
Describe the solution you'd like
Allow simulations to store machine information flexibly by:
- Keeping the existing
machine_idforeign key for known, registered machines. - Adding an optional
machine_name_fallback(string) field to record the machine name for unknown or external sources. - Updating the POST
/simulationsendpoint logic to:- Attempt to match a submitted machine name to an existing
Machinerecord. - If found, link by
machine_id. - If not found, store the provided name in
machine_name_fallbackand leavemachine_idnull.
- Attempt to match a submitted machine name to an existing
The API response should continue returning the machine object when available, and otherwise include the fallback name.
Describe alternatives you've considered
- Option 1: Require all machines to be pre-registered in the database — too restrictive and interrupts workflows.
- Option 2: Store only a string name for the machine — loses valuable metadata like architecture, scheduler, or site.
- Option 3: Auto-create new
Machineentries on submission — risky without validation and could pollute the registry.
The hybrid approach (foreign key + fallback string) provides structure, flexibility, and maintainability.
Additional context
This feature will support both manual and automated submissions from diverse environments, ensuring that EarthFrame can catalog simulations even when provenance data originates outside officially registered compute sites.
It also lays groundwork for future reconciliation — linking simulations with unregistered machines once those machines are later added to the system.