octue / octue-sdk-python

The python SDK for @Octue services and digital twins.
https://octue.com
Other
10 stars 4 forks source link

Saving crash diagnostics does not include file manifests #629

Open thclark opened 9 months ago

thclark commented 9 months ago

Feature request

Use Case

Crash diagnostics is a great feature allowing us to save inputs from questions that went wrong, and recreate their inputs locally to recreate errors quickly and easily.

Current state

Unfortunately, the process doesn't work in cases where an input_manifest is supplied, for multiple reasons:

  1. The manifest that's saved in the cloud as crash diagnostics doesn't include the actual data files. You just get an empty manifest, so can't run questions that require data files.

  2. The load_test_fixture_from_diagnostics function returns an instantiated manifest, which doesn't pass validation because an uninstantiated manifest is required. A workaround for this is to cast the manifest back to primitive as follows:

        (
            configuration_values,
            configuration_manifest,
            input_values,
            input_manifest,
            child_emulators,
        ) = load_test_fixture_from_diagnostics(
            path=f"{self.fixtures_path}/e1df623a-2d0e-47e5-a6e0-160516a03c50"
        )
    
        runner = Runner(
            app_src=self.app_src_path,
            twine=self.twine_path,
        )
    
        analysis = runner.run(
            input_values=input_values,
            input_manifest=input_manifest.to_primitive(),
            save_diagnostics=SAVE_DIAGNOSTICS_OFF,
        )

Proposed Solution