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

Export commit hashes for target & base model repos #127

Open
chimaerase opened this issue Apr 3, 2024 · 4 comments
Open

Export commit hashes for target & base model repos #127

chimaerase opened this issue Apr 3, 2024 · 4 comments

Comments

@chimaerase
Copy link

Models exported from N2A seem to be often (always?) derived from git repos, which may be modified over time. If this is a common workflow, it may be useful to also export commit hashes of the target/base git repos to aid traceability for the exported code.

Saving the output of git rev-parse HEAD to file for all required repos for a given model might be useful (though wouldn't capture any uncommitted modifications -- other variants might)

@frothga
Copy link
Collaborator

frothga commented Apr 3, 2024

Export and simulate are similar processes. In both cases, the commit hash would be an almost-sufficient way to make the state of the code reproducible. To be a complete solution, all repos that the model depends on would have to be committed at the moment of export. Otherwise the hashes would not reliably convey the exact state of the code.

To make simulations reproducible, the current solution is to save a snapshot of the models in the job dir. The user can choose (as a application-wide setting) whether to save just the model, or model + dependencies. The default is to save both. There is a function in the app to reconstruct the model from this snapshot as if it were a self-standing repo.

This approach is potentially expensive (though N2A models are notably concise compared to other formats). It may make sense to offer automatic-commit + hashes as an alternate way to reconstruct a model at a given point in time.

@chimaerase
Copy link
Author

That makes sense to me. IMO almost-sufficient commit hashes may still be a useful supplement to snapshotting, e.g. to provide traceability back to the model repos (with appropriate caveats or "dirty" flags)

@frothga
Copy link
Collaborator

frothga commented Apr 4, 2024

We could start by embedding the hashes as metadata in the snapshot file. As for exports, it would depend on the export format. We could dump a separate hash file. Basically, it would list each repo (just by name) and its associated hash.

@chimaerase
Copy link
Author

chimaerase commented Apr 4, 2024

That makes sense to me too, or perhaps a separate hash file named for each repo would make for extremely simple parsing. I rolled my own version of this in documentation as a stopgap for another app. Happy to change / replace that (probably a separate discussion).

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

No branches or pull requests

2 participants