Fix bug in llama stack build; SERVER_DEPENDENCIES were dropped

This commit is contained in:
Ashwin Bharambe 2024-11-11 20:12:13 -08:00
parent 506b99242a
commit f4426f6a43
2 changed files with 8 additions and 18 deletions

View file

@ -5,7 +5,7 @@
# the root directory of this source tree.
from enum import Enum
from typing import List, Optional
from typing import List
import pkg_resources
from pydantic import BaseModel
@ -38,11 +38,6 @@ class ImageType(Enum):
conda = "conda"
class Dependencies(BaseModel):
pip_packages: List[str]
docker_image: Optional[str] = None
class ApiInput(BaseModel):
api: Api
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):
package_deps = Dependencies(
docker_image=build_config.distribution_spec.docker_image or "python:3.10-slim",
pip_packages=SERVER_DEPENDENCIES,
)
docker_image = build_config.distribution_spec.docker_image or "python:3.10-slim"
# extend package dependencies based on providers spec
normal_deps, special_deps = get_provider_dependencies(
build_config.distribution_spec.providers
)
package_deps.pip_packages.extend(normal_deps)
package_deps.pip_packages.extend(special_deps)
normal_deps += SERVER_DEPENDENCIES
if build_config.image_type == ImageType.docker.value:
script = pkg_resources.resource_filename(
@ -122,7 +112,7 @@ def build_image(build_config: BuildConfig, build_file_path: Path):
args = [
script,
build_config.name,
package_deps.docker_image,
docker_image,
str(build_file_path),
str(BUILDS_BASE_DIR / ImageType.docker.value),
" ".join(normal_deps),

View file

@ -150,12 +150,12 @@ fi
# Detect platform architecture
ARCH=$(uname -m)
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
PLATFORM="--platform linux/arm64"
PLATFORM="--platform linux/arm64"
elif [ "$ARCH" = "x86_64" ]; then
PLATFORM="--platform linux/amd64"
PLATFORM="--platform linux/amd64"
else
echo "Unsupported architecture: $ARCH"
exit 1
echo "Unsupported architecture: $ARCH"
exit 1
fi
set -x