Skip to content

[Enhancement]: Add fall-back machine_name field to capture unregistered machines #41

@tomvothecoder

Description

@tomvothecoder

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_id foreign 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 /simulations endpoint logic to:
    1. Attempt to match a submitted machine name to an existing Machine record.
    2. If found, link by machine_id.
    3. If not found, store the provided name in machine_name_fallback and leave machine_id null.

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 Machine entries 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions