Skip to content

Commit

Permalink
Delete empty directories after pulling ground truth
Browse files Browse the repository at this point in the history
Because object stores don't actually have directories, when we
rsync, looks like sometimes empty directories are left behind. It
makes the zarr a bit weird if 'directories' are renamed.

We could 'fix' this by pulling the entire zarr file each time,
but that's unnecessarily going to slow things down. Instead, we
delete all empty directories
  • Loading branch information
yuvipanda committed Nov 26, 2024
1 parent 8c0cf53 commit 2fa6d43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helm-charts/app/common.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ frx-challenges:
- /bin/sh
- -c
# use printf so we don't interpret the \n in service account keys's private key
# Delete empty directories, since `gcloud storage rsync` with `--delete-unmatched-destination-objects`
# does not seem to actually delete directories created, only the leaf objects (sometimes).
- |
export CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=/tmp/gcloud-auth && \
printf '%s' "$SERVICE_ACCOUNT_JSON_KEY" > $CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE && \
cat $CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE && \
mkdir -p /opt/state/truth/ && \
gcloud storage rsync --recursive --delete-unmatched-destination-objects \
gs://cellmap-challenge-ground-truth-fake/gt.zarr /opt/state/truth/gt.zarr
gs://cellmap-challenge-ground-truth-fake/gt.zarr /opt/state/truth/gt.zarr && \
find /opt/state/truth/ -type d -empty -delete
volumeMounts:
- name: storage
mountPath: /opt/state
Expand Down

0 comments on commit 2fa6d43

Please sign in to comment.