Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
5.4.1
4 changes: 2 additions & 2 deletions lib/api-base/fastApiContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export class FastApiContainer extends Construct {
};

// Add build config overrides if provided
if (config.restApiConfig.buildConfig?.NODEENV_CACHE_DIR) {
buildArgs.NODEENV_CACHE_DIR = config.restApiConfig.buildConfig.NODEENV_CACHE_DIR;
if (config.restApiConfig.buildConfig?.PRISMA_CACHE_DIR) {
buildArgs.PRISMA_CACHE_DIR = config.restApiConfig.buildConfig.PRISMA_CACHE_DIR;
}

// Add MCP Workbench build config overrides if provided
Expand Down
31 changes: 26 additions & 5 deletions lib/docs/admin/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ npmConfig:
# Use ADC-accessible base images for LISA-Serve and Batch Ingestion
baseImage: <adc-registry>/python:3.11

# Configure offline build dependencies for REST API (nodeenv for prisma-client-py)
# Configure offline build dependencies for REST API (prisma-client-py dependencies)
restApiConfig:
buildConfig:
NODEENV_CACHE_DIR: "./nodeenv-cache" # Path relative to lib/serve/rest-api/
PRISMA_CACHE_DIR: "./PRISMA_CACHE" # Path relative to lib/serve/rest-api/

# Configure offline build dependencies for MCP Workbench (S6 Overlay and rclone)
mcpWorkbenchBuildConfig:
Expand All @@ -311,12 +311,33 @@ You'll also want any model hosting base containers available, e.g. vllm/vllm-ope

For environments without internet access during Docker builds, you can pre-cache required dependencies:

**REST API nodeenv cache** (required by prisma-client-py):
**REST API Prisma cache** (required by prisma-client-py):

The `prisma-client-py` package requires platform-specific binaries and a Node.js environment to function. When Prisma runs for the first time, it downloads these dependencies to `~/.cache/prisma/` and `~/.cache/prisma-python/`. For offline deployments, you need to pre-populate this cache.

Below is an example workflow using an Amazon Linux 2023 instance with Python 3.12:

```bash
# Create the cache directory in the REST API build context
python -m nodeenv lib/serve/rest-api/nodeenv-cache
# Ensure Pip is up-to-date
pip3 install --upgrade pip

# Install Prisma Python package
pip3 install prisma

# Trigger Prisma to download all required binaries and create its Node.js environment
# This populates ~/.cache/prisma/ and ~/.cache/prisma-python/
prisma version

# Copy the complete Prisma cache to your build context
# The wildcard captures both 'prisma' and 'prisma-python' directories
cp -r ~/.cache/prisma* lib/serve/rest-api/PRISMA_CACHE/
```

**Important Notes:**
- The cache is platform-specific. Generate it on a system matching your Docker base image (e.g., for `python:3.13-slim` which is Debian-based, so you may want to use a Debian-based system)
- The `prisma version` command downloads binaries for your current platform
- Both `prisma/` and `prisma-python/` directories are required for offline operation

**MCP Workbench dependencies** (S6 Overlay and rclone):
```bash
# Download S6 Overlay files
Expand Down
2 changes: 1 addition & 1 deletion lib/schema/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ const FastApiContainerConfigSchema = z.object({
sslCertIamArn: z.string().nullish().default(null).describe('ARN of the self-signed cert to be used throughout the system'),
imageConfig: ImageAssetSchema.optional().describe('Override image configuration for ECS FastAPI Containers'),
buildConfig: z.object({
NODEENV_CACHE_DIR: z.string().optional().describe('Override with a path relative to the build directory for a pre-cached nodeenv directory. Defaults to NODEENV_CACHE. For offline environments, populate using: python -m nodeenv PATH')
PRISMA_CACHE_DIR: z.string().optional().describe('Override with a path relative to the build directory for a pre-cached prisma directory. Defaults to PRISMA_CACHE.')
}).default({}),
rdsConfig: RdsInstanceConfig
.default({
Expand Down
24 changes: 12 additions & 12 deletions lib/serve/rest-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BASE_IMAGE=python:3.11
FROM ${BASE_IMAGE}

ARG NODEENV_CACHE_DIR=NODEENV_CACHE
ENV NODEENV_CACHE_DIR=$NODEENV_CACHE_DIR
ARG PRISMA_CACHE_DIR=PRISMA_CACHE
ENV PRISMA_CACHE_DIR=$PRISMA_CACHE_DIR

# Install build dependencies for madoka package
RUN apt-get update && apt-get install -y \
Expand All @@ -28,20 +28,20 @@ WORKDIR /app
COPY src/requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy nodeenv cache directory (always exists, may be empty or populated)
COPY ${NODEENV_CACHE_DIR} /tmp/nodeenv-cache/
# Copy prisma cache directory (always exists, may be empty or populated)
COPY ${PRISMA_CACHE_DIR} /tmp/prisma-cache/

# Pre-cache nodeenv for prisma-client-py
# Pre-cache prisma for prisma-client-py
# If the copied directory has content, use it (for offline environments)
# Otherwise, download it during build (requires internet)
RUN mkdir -p /root/.cache/prisma-python && \
if [ -d "/tmp/nodeenv-cache" ] && [ -n "$(ls /tmp/nodeenv-cache 2>/dev/null)" ]; then \
echo "Using pre-cached nodeenv from host" && \
cp -r /tmp/nodeenv-cache /root/.cache/prisma-python/nodeenv && \
rm -rf /tmp/nodeenv-cache; \
RUN mkdir -p /root/.cache && \
if [ -d "/tmp/prisma-cache" ] && [ -n "$(ls /tmp/prisma-cache 2>/dev/null)" ]; then \
echo "Using pre-cached Prisma dependencies from host" && \
cp -r /tmp/prisma-cache/prisma* /root/.cache && \
rm -rf /tmp/prisma-cache; \
else \
echo "Downloading nodeenv (requires internet)" && \
python -m nodeenv /root/.cache/prisma-python/nodeenv; \
echo "Fetching Prisma Dependencies (requires internet)" && \
prisma version; \
fi

# Copy the source code into the container
Expand Down
2 changes: 0 additions & 2 deletions lib/serve/rest-api/NODEENV_CACHE/.gitkeep

This file was deleted.

5 changes: 5 additions & 0 deletions lib/serve/rest-api/PRISMA_CACHE/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Placeholder to ensure PRISMA_CACHE directory exists in build context
# For offline builds, populate this directory by copying the complete Prisma cache:
# 1. Install prisma: pip3 install prisma
# 2. Generate cache: prisma version
# 3. Copy cache: cp -r ~/.cache/prisma* lib/serve/rest-api/PRISMA_CACHE/
2 changes: 1 addition & 1 deletion lib/user-interface/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lisa-web",
"private": true,
"version": "5.4.0",
"version": "5.4.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const configurationApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['configuration'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
getConfiguration: builder.query<IConfiguration[], string>({
query: (configScope) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const mcpServerApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['mcpServers'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
createMcpServer: builder.mutation<McpServer, NewMcpServer>({
query: (mcpServer) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const mcpToolsApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['mcpTools'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
listMcpTools: builder.query<IMcpTool[], void>({
query: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const modelManagementApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['models'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
getAllModels: builder.query<IModelListResponse['models'], void>({
query: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const promptTemplateApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['promptTemplates'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
createPromptTemplate: builder.mutation<PromptTemplate, NewPromptTemplate>({
query: (promptTemplate) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const ragApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['repositories', 'docs', 'repository-status', 'jobs'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
listRagRepositories: builder.query<RagRepositoryConfig[], void>({
query: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const sessionApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['sessions'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
getSessionById: builder.query<LisaChatSession, string>({
query: (sessionId: string) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const userPreferencesApi = createApi({
baseQuery: lisaBaseQuery(),
tagTypes: ['user-preferences'],
refetchOnFocus: true,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
endpoints: (builder) => ({
updateUserPreferences: builder.mutation<UserPreferences, UserPreferences>({
query: (userPreferences) => ({
Expand Down
4 changes: 2 additions & 2 deletions lisa-sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lisapy"
version = "5.4.0"
version = "5.4.1"
description = "A simple SDK to help you interact with LISA. LISA is an LLM hosting solution for AWS dedicated clouds or ADCs."
readme = "README.md"
requires-python = ">=3.11"
Expand All @@ -15,7 +15,7 @@ dependencies = [

[tool.poetry]
name = "lisapy"
version = "5.4.0"
version = "5.4.1"
description = "A simple SDK to help you interact with LISA. LISA is an LLM hosting solution for AWS dedicated clouds or ADCs."
authors = ["Steve Goley <sgoley@amazon.com>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awslabs/lisa",
"version": "5.4.0",
"version": "5.4.1",
"description": "A scalable infrastructure-as-code solution for self-hosting and orchestrating LLM inference with RAG capabilities, providing low-latency access to generative AI and embedding models across multiple providers.",
"homepage": "https://awslabs.github.io/LISA/",
"license": "Apache-2.0",
Expand Down
Loading