-
Notifications
You must be signed in to change notification settings - Fork 81
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
Configure cache dir #1712
Configure cache dir #1712
Conversation
deephaven.console.type=groovy | ||
deephaven.cache.dir=/cache | ||
java.io.tmpdir=/cache/tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a sub-dir of the host's /tmp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Punting - #1714
private static final Path cacheDir; | ||
|
||
static { | ||
final String deephavenCacheDir = System.getProperty(DEEPHAVEN_CACHE_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration.getInstance().getPropertyWithDefault
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ this is not an existing method. But I can use Configuration, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, method is io.deephaven.configuration.PropertyFile#getStringWithDefault
.
@@ -61,7 +60,7 @@ protected AbstractScriptSession(@Nullable Listener changeListener, boolean isDef | |||
this.changeListener = changeListener; | |||
|
|||
final UUID scriptCacheId = UuidCreator.getRandomBased(); | |||
classCacheDirectory = new File(CLASS_CACHE_LOCATION, UuidCreator.toString(scriptCacheId)); | |||
classCacheDirectory = CLASS_CACHE_LOCATION.resolve(UuidCreator.toString(scriptCacheId)).toFile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed introducing props:
INSTANCE_ID (if set, this is the ID)
INSTANCE_ID_FILE (if set and INSTANCE_ID isn't this is the file we load from or generate)
else, we randomly allocate an instance ID and be sure to clean up on exit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Punting - #1713
We should not be writing to a container's
/tmp
directory in docker, unless it's a docker volume.Our docker images declare a
/cache
volume, so we should:-Djava.io.tmpdir=/cache/tmp
so that any java code using temporary files will inherit a docker volume backed tmp space-Ddeephaven.cache.dir
so that those who want more explicit "cache" space (instead of "tmp" space), can take advantage of it. (OnlyAbstractScriptSession
atm, but others could use it in the future.)