-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add data retention policy #188
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,57 @@ | ||||||||||||
# Data Retention Policy | ||||||||||||
|
||||||||||||
Dandihub data storage on AWS EFS is expensive, and we suppose that significant portions of the data | ||||||||||||
currently stored are no longer used. Data migration is where the cost becomes extreme. | ||||||||||||
|
||||||||||||
## Persistent Data locations | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
Each user has access to 2 locations: `/home/{user}` and `/shared/` | ||||||||||||
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
||||||||||||
Within jupyterhub `/home/{user}` the user always sees `/home/jovyan`, but is stored in EFS as their GitHub | ||||||||||||
username. | ||||||||||||
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
||||||||||||
## Known cache file cleanup | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
We should be able to safely remove the following: | ||||||||||||
kabilar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
- `/home/{user}/.cache` | ||||||||||||
- `nwb_cache` | ||||||||||||
- Yarn Cache | ||||||||||||
- `__pycache__` | ||||||||||||
- pip cache | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case user is still active -- I think it would be useful to report to the long running users, after reaching some threshold on any of those folders (e.g. 50MB) asking to clean them up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @asmacdo, should we add a separate point here about monitoring and reporting the quotas of cache directories for active users? |
||||||||||||
|
||||||||||||
|
||||||||||||
## Determining Last Access | ||||||||||||
|
||||||||||||
EFS does not store metadata for the last access of the data. (Though they must track somehow to move | ||||||||||||
to `Infrequent Access`) | ||||||||||||
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
||||||||||||
Alternatives: | ||||||||||||
- use the [jupyterhub REST API](https://jupyterhub.readthedocs.io/en/stable/reference/rest-api.html#operation/get-users) check when user last used/logged in to hub. | ||||||||||||
- dandiarchive login information | ||||||||||||
|
||||||||||||
## Automated Data Audit | ||||||||||||
|
||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
At some interval (30 days with no login?): | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
- find files larger than 1 (?) GB and mtime > 30 (?) days -- get total size and count | ||||||||||||
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
- find _pycache_ and nwb-cache folders and pip cache and mtime > 30? days -- total sizes and list of them | ||||||||||||
|
||||||||||||
Notify user if: | ||||||||||||
- total du exceeds some threshold (e.g. 100G) | ||||||||||||
asmacdo marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggested a quota of 1 TB for home directories as many datasets are getting to be quite large. This would provide temporary, high-capacity storage, but hopefully users won't get anywhere near this threshold. This would cost $300/user/month for standard EFS, and $23/user/month if we move to Standard S3. If we implement a scratch directory, then perhaps the home directory can have a much smaller quota. |
||||||||||||
- total outdated caches size exceeds some threshold (e.g. 1G) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
- prior notification was sent more than a week ago | ||||||||||||
|
||||||||||||
Notification information: | ||||||||||||
- large file list | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
- summarized data retention policy | ||||||||||||
- Notice number | ||||||||||||
- request to cleanup | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. meanwhile it might be worth creating a simple data record schema to store those records as well so they could be reused by the tools to assemble higher level stats etc. |
||||||||||||
|
||||||||||||
### Non-response cleanup | ||||||||||||
|
||||||||||||
If a user has not logged in for 60 days (30 days initial + 30 days following audit), send a warning: | ||||||||||||
`In 10 days the following files will be cleaned up` | ||||||||||||
|
||||||||||||
If the user has not logged in for 70 days (30 initial + 30 after audit + 10 warning): | ||||||||||||
`The following files were removed` | ||||||||||||
|
||||||||||||
Reset timer. |
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.
Since S3 buckets can now mount to EC2 instances (reference: August 2023 blog post) and S3 costs are ~10X cheaper than EFS, as part of this data retention work perhaps we should also look into what it would take to move to S3 storage (and discuss any features that would not be available with this migration)?
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.
Filed #198