Skip to content

Commit

Permalink
Clean cache before building
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Oct 15, 2024
1 parent 48ec328 commit 4dfe9a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def build_generation(args: argparse.Namespace, mg: MonoGen) -> None:
def build(args: argparse.Namespace) -> None:
os.makedirs(args.cache, exist_ok=True)

if args.clean_uv_cache:
clean_uv_cache()

gens = []
for mg in sorted(MONOGENS[args.environment], reverse=True):
if mg.id < args.min_gen_id or mg.id > args.max_gen_id:
Expand All @@ -96,8 +99,6 @@ def build(args: argparse.Namespace) -> None:
prune_cuda(args)
if args.prune_uv_cache:
prune_uv_cache()
if args.clean_uv_cache:
clean_uv_cache()

logger.info(f'Calculating disk usage in {args.prefix}...')
cmd = ['du', '-ch', '-d', '1', args.prefix]
Expand Down
6 changes: 0 additions & 6 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ log() {
}

builder() {
if [ -n "${MONOBASE_CLEAN:-}" ]; then
log "Cleaning up $MONOBASE_PREFIX..."
rm -rf "${MONOBASE_PREFIX:?}"/{bin,cuda,monobase,uv}
rm -f "$DONE_FILE"
fi

mkdir -p "$MONOBASE_PREFIX/bin"

# Always install latest uv and pget first
Expand Down

0 comments on commit 4dfe9a4

Please sign in to comment.