Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2024-12-21 12:06:17 -05:00
parent ef214cbfc0
commit 188aef8fa2
No known key found for this signature in database
4 changed files with 8 additions and 9 deletions

View file

@ -293,13 +293,12 @@ class StackBuild(Subcommand):
if template_name:
# copy run.yaml from template to build_dir instead of generating it again
template_path = pkg_resources.resource_filename(
"llama_stack", f"templates/{template_name}/run.yaml"
template_path = (
importlib.resources.files("llama_stack")
/ f"templates/{template_name}/run.yaml"
)
os.makedirs(build_dir, exist_ok=True)
run_config_file = build_dir / f"{build_config.name}-run.yaml"
shutil.copy(template_path, run_config_file)
with importlib.resources.as_file(template_path) as path:
shutil.copy(path, run_config_file)
# Find all ${env.VARIABLE} patterns
cprint("Build Successful!", color="green")
else:

View file

@ -52,6 +52,7 @@ class StackRun(Subcommand):
def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
import importlib.resources
import yaml
from llama_stack.distribution.build import ImageType

View file

@ -4,13 +4,13 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import importlib.resources
import logging
from enum import Enum
from pathlib import Path
from typing import Dict, List
import importlib.resources
from pydantic import BaseModel
from termcolor import cprint

View file

@ -4,13 +4,12 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import importlib.resources
import logging
import os
import re
from pathlib import Path
from typing import Any, Dict, Optional
import importlib.resources
import yaml
from termcolor import colored