Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion instill/helpers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ RUN for package in ${PACKAGES}; do \
pip install --default-timeout=1000 --no-cache-dir $package; \
done;

WORKDIR /home/ray/model
WORKDIR /home/ray
COPY . .
20 changes: 20 additions & 0 deletions instill/helpers/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
import os

IGNORE_FILES = {
".bash_logout",
".bashrc",
".profile",
".sudo_as_admin_successful",
"pip-freeze.txt",
"requirements_compiled.txt",
}

IGNORE_FOLDERS = {
".cache",
".conda",
".whl",
"anaconda3",
}


def get_dir_size(path):
total = 0
with os.scandir(path) as it:
for entry in it:
if entry.is_file():
if entry.name in IGNORE_FILES:
continue
total += entry.stat().st_size
elif entry.is_dir():
if entry.name in IGNORE_FOLDERS:
continue
total += get_dir_size(entry.path)
return total