Skip to content

deploy-sourcegraph: remove CACHE_DIR from frontend

Created by: keegancsmith

We removed the need for frontend to have CACHE_DIR set a long time ago, but we never removed it from our resource definitions.

Here is some output from prod and dogfood clusters proving we don't even create this dir (which we would do on the first use)

# sourcegraph.com
❯ kubectl get po -o name | grep sourcegraph-frontend | xargs -P0 -IPOD kubectl exec -c frontend POD -- sh -c 'du -hs ${CACHE_DIR}'
du: /mnt/cache/sourcegraph-frontend-5c4bd7d959-b2m9t: No such file or directory
command terminated with exit code 1
du: /mnt/cache/sourcegraph-frontend-5c4bd7d959-27hvx: No such file or directory
command terminated with exit code 1
du: /mnt/cache/sourcegraph-frontend-internal-5d5fdc5787-zgvwp: No such file or directory
du: /mnt/cache/sourcegraph-frontend-5c4bd7d959-8x4mt: No such file or directory
command terminated with exit code 1
command terminated with exit code 1
du: /mnt/cache/sourcegraph-frontend-5c4bd7d959-qv4dg: No such file or directory
command terminated with exit code 1
du: /mnt/cache/sourcegraph-frontend-internal-5d5fdc5787-x9dh8: No such file or directory
command terminated with exit code 1
# dogfood
❯ kubectl get po -o name | grep sourcegraph-frontend | xargs -P0 -IPOD kubectl exec -c frontend POD -- sh -c 'du -hs ${CACHE_DIR}'
du: /mnt/cache/sourcegraph-frontend-7cbfcdf749-lhbdx: No such file or directory
du: /mnt/cache/sourcegraph-frontend-7cbfcdf749-v6t6p: No such file or directory
command terminated with exit code 1
command terminated with exit code 1
du: /mnt/cache/sourcegraph-frontend-7cbfcdf749-bw4cd: No such file or directory
command terminated with exit code 1

Note: this will likely require the removal in a lot of deploy- repos. Additionally we still have some references in code for frontend to read CACHE_DIR. However, there are no writers in pratice. That should be removed as well.