mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 02:53:30 +00:00
Fix bug in llama stack build
; SERVER_DEPENDENCIES were dropped
This commit is contained in:
parent
506b99242a
commit
f4426f6a43
2 changed files with 8 additions and 18 deletions
|
@ -5,7 +5,7 @@
|
||||||
# the root directory of this source tree.
|
# the root directory of this source tree.
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import List, Optional
|
from typing import List
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
@ -38,11 +38,6 @@ class ImageType(Enum):
|
||||||
conda = "conda"
|
conda = "conda"
|
||||||
|
|
||||||
|
|
||||||
class Dependencies(BaseModel):
|
|
||||||
pip_packages: List[str]
|
|
||||||
docker_image: Optional[str] = None
|
|
||||||
|
|
||||||
|
|
||||||
class ApiInput(BaseModel):
|
class ApiInput(BaseModel):
|
||||||
api: Api
|
api: Api
|
||||||
provider: str
|
provider: str
|
||||||
|
@ -103,17 +98,12 @@ def print_pip_install_help(providers: Dict[str, List[Provider]]):
|
||||||
|
|
||||||
|
|
||||||
def build_image(build_config: BuildConfig, build_file_path: Path):
|
def build_image(build_config: BuildConfig, build_file_path: Path):
|
||||||
package_deps = Dependencies(
|
docker_image = build_config.distribution_spec.docker_image or "python:3.10-slim"
|
||||||
docker_image=build_config.distribution_spec.docker_image or "python:3.10-slim",
|
|
||||||
pip_packages=SERVER_DEPENDENCIES,
|
|
||||||
)
|
|
||||||
|
|
||||||
# extend package dependencies based on providers spec
|
|
||||||
normal_deps, special_deps = get_provider_dependencies(
|
normal_deps, special_deps = get_provider_dependencies(
|
||||||
build_config.distribution_spec.providers
|
build_config.distribution_spec.providers
|
||||||
)
|
)
|
||||||
package_deps.pip_packages.extend(normal_deps)
|
normal_deps += SERVER_DEPENDENCIES
|
||||||
package_deps.pip_packages.extend(special_deps)
|
|
||||||
|
|
||||||
if build_config.image_type == ImageType.docker.value:
|
if build_config.image_type == ImageType.docker.value:
|
||||||
script = pkg_resources.resource_filename(
|
script = pkg_resources.resource_filename(
|
||||||
|
@ -122,7 +112,7 @@ def build_image(build_config: BuildConfig, build_file_path: Path):
|
||||||
args = [
|
args = [
|
||||||
script,
|
script,
|
||||||
build_config.name,
|
build_config.name,
|
||||||
package_deps.docker_image,
|
docker_image,
|
||||||
str(build_file_path),
|
str(build_file_path),
|
||||||
str(BUILDS_BASE_DIR / ImageType.docker.value),
|
str(BUILDS_BASE_DIR / ImageType.docker.value),
|
||||||
" ".join(normal_deps),
|
" ".join(normal_deps),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue