From a0d6b165b0e49d6e476a60f75fd1d0d89e7e6c1a Mon Sep 17 00:00:00 2001 From: Reid <61492567+reidliu41@users.noreply.github.com> Date: Thu, 6 Mar 2025 07:40:00 +0800 Subject: [PATCH] chore: remove unused build dir (#1379) # What does this PR do? [Provide a short summary of what this PR does and why. Link to relevant issues if applicable.] - From old PR, it use `BUILDS_BASE_DIR` in `llama_stack/cli/stack/configure.py`(removed). https://github.com/meta-llama/llama-stack/pull/371/files - Based on the current `build` code, it should only use `DISTRIBS_BASE_DIR` to save it. https://github.com/meta-llama/llama-stack/blob/46b0a404e8cb07a8df6df2b89a7bb5b245551553/llama_stack/cli/stack/_build.py#L298 https://github.com/meta-llama/llama-stack/blob/46b0a404e8cb07a8df6df2b89a7bb5b245551553/llama_stack/cli/stack/_build.py#L301 Pls correct me if I am understand incorrectly. So it should no need to use in `run` now. [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan [Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.*] [//]: # (## Documentation) Signed-off-by: reidliu Co-authored-by: reidliu --- llama_stack/cli/stack/run.py | 14 +------------- llama_stack/distribution/utils/config_dirs.py | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/llama_stack/cli/stack/run.py b/llama_stack/cli/stack/run.py index e4337b8d0..d4e679e4b 100644 --- a/llama_stack/cli/stack/run.py +++ b/llama_stack/cli/stack/run.py @@ -79,12 +79,8 @@ class StackRun(Subcommand): def _run_stack_run_cmd(self, args: argparse.Namespace) -> None: import yaml - from llama_stack.distribution.build import ImageType from llama_stack.distribution.configure import parse_and_maybe_upgrade_config - from llama_stack.distribution.utils.config_dirs import ( - BUILDS_BASE_DIR, - DISTRIBS_BASE_DIR, - ) + from llama_stack.distribution.utils.config_dirs import DISTRIBS_BASE_DIR from llama_stack.distribution.utils.exec import formulate_run_args, run_with_pty config_file = Path(args.config) @@ -97,14 +93,6 @@ class StackRun(Subcommand): if config_file.exists(): template_name = args.config - if not config_file.exists() and not has_yaml_suffix: - # check if it's a build config saved to conda dir - config_file = Path(BUILDS_BASE_DIR / ImageType.conda.value / f"{args.config}-run.yaml") - - if not config_file.exists() and not has_yaml_suffix: - # check if it's a build config saved to container dir - config_file = Path(BUILDS_BASE_DIR / ImageType.container.value / f"{args.config}-run.yaml") - if not config_file.exists() and not has_yaml_suffix: # check if it's a build config saved to ~/.llama dir config_file = Path(DISTRIBS_BASE_DIR / f"llamastack-{args.config}" / f"{args.config}-run.yaml") diff --git a/llama_stack/distribution/utils/config_dirs.py b/llama_stack/distribution/utils/config_dirs.py index e512c3576..9b9a7ceb3 100644 --- a/llama_stack/distribution/utils/config_dirs.py +++ b/llama_stack/distribution/utils/config_dirs.py @@ -13,6 +13,4 @@ DISTRIBS_BASE_DIR = LLAMA_STACK_CONFIG_DIR / "distributions" DEFAULT_CHECKPOINT_DIR = LLAMA_STACK_CONFIG_DIR / "checkpoints" -BUILDS_BASE_DIR = LLAMA_STACK_CONFIG_DIR / "builds" - RUNTIME_BASE_DIR = LLAMA_STACK_CONFIG_DIR / "runtime"