-
Notifications
You must be signed in to change notification settings - Fork 23
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
(aspirational hack project) Auto-generate EFS usage report & Log storage #173
base: main
Are you sure you want to change the base?
Changes from all 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,35 @@ | ||||||
apiVersion: v1 | ||||||
kind: Pod | ||||||
metadata: | ||||||
name: inspect-pvc-pod | ||||||
spec: | ||||||
containers: | ||||||
- name: inspect-pvc-container | ||||||
image: busybox | ||||||
command: | ||||||
- /bin/sh | ||||||
- -c | ||||||
- | | ||||||
#!/bin/sh | ||||||
set -eux | ||||||
|
||||||
# EFS_PERSIST_MNT is the mount point for the PVC | ||||||
EFS_PERSIST_MNT="/mnt/efs-persist" | ||||||
EFS_HOME="$EFS_PERSIST_MNT/home" | ||||||
|
||||||
# Generate the size report | ||||||
du -sh $EFS_HOME/* | awk '{print $1, $2}' > $EFS_HOME/size_report.txt | ||||||
|
||||||
# Display the size report | ||||||
cat "$EFS_HOME/size_report.txt" | ||||||
|
||||||
# Keep the container running | ||||||
sleep 3600 | ||||||
Comment on lines
+26
to
+27
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. needs cleanup
Suggested change
|
||||||
volumeMounts: | ||||||
- name: efs-storage | ||||||
mountPath: /mnt/efs-persist | ||||||
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. ATM we are transferring 10TB but good amount of space is occupied by a few users, e.g. the largest (500G) is by one user having 1 single NWB file. We could/should quickly inspect and reach out asking if could be removed. But ideally we need a simple script which may be prints N largest files per each user and sorts users by the total size or smth like that....
but ran on the original efs here is the pod definition we used for pod to mount target EFS apiVersion: v1
kind: Pod
metadata:
name: sleep-tender
spec:
containers:
- name: inspect-pvc-container
image: busybox
command:
- /bin/sh
- -c
- ls -la /mnt/efs-persist; echo sleeping; sleep 3600; echo exiting
volumeMounts:
- name: efs-storage
mountPath: /mnt/efs-persist
readOnly: true
volumes:
- name: efs-storage
persistentVolumeClaim:
claimName: efs-persist |
||||||
volumes: | ||||||
- name: efs-storage | ||||||
persistentVolumeClaim: | ||||||
claimName: efs-persist | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
# EFS_PERSIST_MNT = "/mnt/efs-persist" | ||
EFS_PERSIST_MNT="/tmp/efs-script-dump" | ||
EFS_HOME="$EFS_PERSIST_MNT/home" | ||
|
||
du -sh $EFS_HOME/* | awk '{print $1, $2}' > $EFS_HOME/size_report.txt | ||
cat $EFS_HOME/size_report.txt |
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.
if you do this way (storing into EFS itself), better to IMHO
then you would avoid having some irrelevant path prefix there.