From dac75a934d9c42f16a5089aa55fad4b11fc90d2a Mon Sep 17 00:00:00 2001 From: Heiru Wu Date: Wed, 27 Mar 2024 17:01:41 +0800 Subject: [PATCH] fix(ray): fix etrypoint module not found --- instill/helpers/Dockerfile | 2 +- instill/helpers/utils.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/instill/helpers/Dockerfile b/instill/helpers/Dockerfile index 5095285..9d487d9 100644 --- a/instill/helpers/Dockerfile +++ b/instill/helpers/Dockerfile @@ -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 . . diff --git a/instill/helpers/utils.py b/instill/helpers/utils.py index a81877d..9ce937e 100644 --- a/instill/helpers/utils.py +++ b/instill/helpers/utils.py @@ -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