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

Override local data directory via env variable #2568

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

itowlson
Copy link
Contributor

Fixes #2563

Note this specifically addresses the data directory. It does not affect the cache directory. If that's needed then I can chuck it into this PR.

cc @jandubois

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson merged commit 22f9f98 into fermyon:main Jun 17, 2024
17 checks passed
@jandubois
Copy link

Note this specifically addresses the data directory.

Thanks a lot; this is exactly what I was hoping for.

It does not affect the cache directory. If that's needed then I can chuck it into this PR.

Sorry for the late response, as this PR has now been merged.

It is not clear to me, what the cache directory is being used for. Does the cached content depend on the version of the spin app that is being used. Can 2 versions of spin share the same cache directory, or would a newer spin executable potentially update the cache with data that is not compatible with the older version?

If there are no possible conflicts (e.g. because content is versioned), then there is less reason to make the cache directory configurable.

The remaining reason would be that doing e.g. a Rancher Desktop "factory reset" or "uninstall" could also clear out the cache directory instead of leaving it behind.

@itowlson
Copy link
Contributor Author

@jandubois The cache directory is used for content-addressed downloads, specifically for components identified by URL or registry reference and for application assets when running from an app from an OCI registry. It should not depend on Spin version. (If we made changes that changed the layout, that could result in re-downloading things, but never in things from other versions "crossing over" if that makes sense.)

@jandubois
Copy link

@itowlson Thanks, that means it is not really necessary to have separate cache directories then.

Out of curiosity: how large does the cache grow, and is there some mechanism to expire old content?

@itowlson
Copy link
Contributor Author

No, at the moment all that is down to the user. It would be good to improve that, but it is not yet a priority. (I'm sure it will become a priority.)

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

Successfully merging this pull request may close these issues.

Support overriding the "Spin data dir" via env var
3 participants