Skip to content

More powerful linking of scratch spaces to versions #23

@oxinabox

Description

@oxinabox

I don't think this is important stuff, but just noting them down.

Consider the instructions for making scratch spaces that are keyed to the version.
This is kind of limitted

let's say my package does some data fetching and processing and then exposes it to the user.
It uses the sratch space to hold the processed data, so it doesn't redownload it.

Now lets say different versions of my package does different processing.
So you don't want to use a file that was processed by v1 of the package with v6 because .e.g. we have changed from representing time as a DateTime to using a ZonedDateTime.
So it should redownload the file.
So keying a subfolder to the version gets us some of that.
but there are some problems

Deleting

So this could be quite a lot of data stored in the v1 sub-folder.
and it would be good if it was deleted when uninstalled v1 of the package.
For this we kind of need the package manager to know about the folder

clear_scratchspaces!(pkg) is a decent approximation for a lot of use cases

Compatibility

Consider a more advanced version of the above.
What if while between v1 and v6 the time representation changed, but some files don't actually have any time data, so actaully remain compatiable.

The way we (Invenia) have solved this before is by giving seperate version numbers to the Data and the the Program, and then having the Program declare which versions of the data is is happy to use via semver_spec.
You can see one used of this in JLSO which declared which file versions it can read and which it can write.
We have a more intense version of this for interally with some datadeps.

So if both the scratch (sub)-space and the package have seperate versions, the package just declares which versions it can work with and then goes and find the newest that exists right now meeting that semver_spec it said it could work with.
You can do this at the function level.
(pretty much what our internal project on datadeps does)

But it would be cooler if the package manager was aware of it, so that it could tie in to automatic deleting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions