From 470e5bcea87918c55a89248e67021be62d7a2f5c Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 16:58:03 -0400 Subject: [PATCH 01/51] add docker uds zarf helm lints --- .github/workflows/docker-lint.yaml | 48 +++++++++++++++++++++++ .github/workflows/uds-lint.yaml | 54 ++++++++++++++++++++++++++ .github/workflows/zarf-lint.yaml | 54 ++++++++++++++++++++++++++ .gitignore | 1 + .hadolint.yaml | 8 ++++ .pre-commit-config.yaml | 62 ++++++++++++++++++++++++++++-- 6 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docker-lint.yaml create mode 100644 .github/workflows/uds-lint.yaml create mode 100644 .github/workflows/zarf-lint.yaml create mode 100644 .hadolint.yaml diff --git a/.github/workflows/docker-lint.yaml b/.github/workflows/docker-lint.yaml new file mode 100644 index 000000000..2e0936067 --- /dev/null +++ b/.github/workflows/docker-lint.yaml @@ -0,0 +1,48 @@ +name: Docker Lint + +on: + push: + branches: + - "main" + paths: + - "packages" + - "Dockerfile.migrations" + - ".dockerignore" + - ".github/workflows/docker-lint.yaml" + pull_request: + branches: + - "main" + paths: + - "packages" + - "Dockerfile.migrations" + - ".dockerignore" + - ".github/workflows/docker-lint.yaml" + +concurrency: + group: docker-lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + docker-lint: + runs-on: ubuntu-latest + name: Lint Docker Manifest + + permissions: + contents: write + + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0 + with: + dockerfile: "*Dockerfile*" + recursive: true + config: .hadolint.yaml diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml new file mode 100644 index 000000000..c43dd646f --- /dev/null +++ b/.github/workflows/uds-lint.yaml @@ -0,0 +1,54 @@ +name: UDS Lint + +on: + push: + branches: + - "main" + paths: + - "bundles" + - "tasks" + - "task.yaml" + - ".github/workflows/uds-lint.yaml" + + pull_request: + branches: + - "main" + paths: + - "bundles" + - "tasks" + - "task.yaml" + - ".github/workflows/uds-lint.yaml" + +concurrency: + group: uds-lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + uds-lint: + runs-on: ubuntu-latest + name: Lint UDS Manifest + + permissions: + contents: read + + steps: + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up Python + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version-file: "pyproject.toml" + + - name: Install jsonschema + run: pip install check-jsonschema==0.28.0 + + - name: Download UDS Bundle Schema + run: curl -o uds.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json + + - name: Validate uds-bundle.yaml + run: | + check-jsonschema bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json diff --git a/.github/workflows/zarf-lint.yaml b/.github/workflows/zarf-lint.yaml new file mode 100644 index 000000000..d6f6fa202 --- /dev/null +++ b/.github/workflows/zarf-lint.yaml @@ -0,0 +1,54 @@ +name: Zarf Lint + +on: + push: + branches: + - "main" + paths: + - "packages" + - ".github/workflows/zarf-lint.yaml" + pull_request: + branches: + - "main" + paths: + - "packages" + - ".github/workflows/zarf-lint.yaml" + +concurrency: + group: zarf-lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + zarf-lint: + runs-on: ubuntu-latest + name: Lint Zarf Manifest + + permissions: + contents: read + + steps: + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up Python + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version-file: 'pyproject.toml' + + - name: Download Zarf Package Schema + # TODO: renovate setup + run: curl -o zarf.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json + + - name: Install jsonschema + run: pip install check-jsonschema==0.28.0 + + - name: Validate zarf.yaml + run: | + check-jsonschema packages/api/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/llama-cpp-python/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/repeater/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/supabase/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/text-embeddings/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/ui/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/vllm/zarf.yaml --schemafile zarf.schema.json + check-jsonschema packages/whisper/zarf.yaml --schemafile zarf.schema.json diff --git a/.gitignore b/.gitignore index bcefc6ea7..d93596fc3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ src/leapfrogai_api/config.yaml node_modules package.json package-lock.json +**/*.schema.json # local model and tokenizer files *.bin diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 000000000..0501bfd88 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,8 @@ +failure-threshold: error +# ignore: use of latest, --no-cache-dir, shell usage warning, apt-get list, --no-install-recommends +ignored: + - "DL3007" + - "DL3042" + - "DL4006" + - "DL3009" + - "DL3015" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24785cab5..cbba0d5c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,6 @@ repos: name: Large Files Check args: ["--maxkb=1024"] - - id: check-merge-conflict - name: Check for Upstream Merge Conflicts - - id: detect-aws-credentials name: Check AWS Credentials args: @@ -59,7 +56,14 @@ repos: rev: v0.12.1 hooks: - id: markdownlint-cli2 - name: Markdown Lint + name: Markdown Linti + + - repo: https://github.com/hadolint/hadolint + rev: v2.12.0 + hooks: + - id: hadolint-docker + name: Dockerfile Lint + args: ["--config", ".hadolint.yaml"] - repo: local hooks: @@ -76,3 +80,53 @@ repos: name: Ruff Lint - id: ruff-format # Run the formatter. name: Ruff Format + + - repo: https://github.com/gruntwork-io/pre-commit + rev: v0.1.23 + hooks: + - id: helmlint + name: Helm Lint + + ############# + # UDS v0.14.0 + ############# + + # ZARF PACKAGE CHECK + - repo: local + hooks: + - id: download-schema + name: "Download Zarf Schema" + entry: | + bash -c 'if [! -f zarf-v0.14.0.schema.json ]; \ + then curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json; \ + else exit 0; fi' + language: system + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.14.0 + hooks: + - id: check-jsonschema + name: "Validate Zarf Configs Against Schema" + files: "zarf.yaml" + types: [yaml] + args: ["--schemafile", "zarf-v0.14.0.schema.json"] + + # UDS BUNDLE CHECK + - repo: local + hooks: + - id: download-schema + name: "Download UDS Bundle Schema" + entry: | + bash -c 'if [! -f uds-v0.14.0.schema.json ]; \ + then curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json; \ + else exit 0; fi' + language: system + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.14.0 + hooks: + - id: check-jsonschema + name: "Validate UDS Bundles Against Schema" + files: "uds-bundle.yaml" + types: [yaml] + args: ["--schemafile", "uds-v0.14.0.schema.json"] From 95e87f828371052180447e14d8cbcea65fb7dd1d Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 17:11:54 -0400 Subject: [PATCH 02/51] fix uds lint dir --- .github/workflows/uds-lint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml index c43dd646f..b0abcb48e 100644 --- a/.github/workflows/uds-lint.yaml +++ b/.github/workflows/uds-lint.yaml @@ -48,7 +48,7 @@ jobs: - name: Validate uds-bundle.yaml run: | - check-jsonschema bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json - check-jsonschema bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json - check-jsonschema bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json - check-jsonschema bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema uds-bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema uds-bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema uds-bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema uds-bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json From 717f22ee9ee43c51059ea333cb8db5deeb3c69dd Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 17:15:49 -0400 Subject: [PATCH 03/51] wip --- .dockerignore | 9 ++++++++- Dockerfile.migrations | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.dockerignore b/.dockerignore index 729e30e3f..70b6549c1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,11 @@ **/*.tar.zst +**/*.log* +**/__pycache__ +**/.ruff_cache **/Dockerfile* **/.gitignore -**/Makefile \ No newline at end of file +**/Makefile +**/node_modules +**/.svelte-kit +**/zarf-sbom/ +**/zarf-*.tar.zst diff --git a/Dockerfile.migrations b/Dockerfile.migrations index cab24416f..f79bebc03 100644 --- a/Dockerfile.migrations +++ b/Dockerfile.migrations @@ -1,16 +1,17 @@ -FROM --platform=$TARGETPLATFORM cgr.dev/chainguard/bash:latest -ARG TARGETPLATFORM -ARG version="1.169.8" -ARG MIGRATIONS_DIR +FROM cgr.dev/chainguard/bash:latest -RUN test -n "$MIGRATIONS_DIR" || (echo "MIGRATIONS_PATH is required" && false) +ARG TARGETPLATFORM \ + version="1.169.8" \ + MIGRATIONS_DIR + +RUN test -n "$MIGRATIONS_DIR" || (echo "MIGRATIONS_DIR is required" && false) # Download the supabase cli -RUN mkdir -p /usr/local/bin -RUN ARCH=$(echo $TARGETPLATFORM | cut -d '/' -f2) \ - && curl -LO https://github.com/supabase/cli/releases/download/v${version}/supabase_linux_${ARCH}.tar.gz \ - && tar -xzf supabase_linux_${ARCH}.tar.gz -C /usr/local/bin/ \ - && rm supabase_linux_${ARCH}.tar.gz +RUN mkdir -p /usr/local/bin && \ + ARCH=$(echo $TARGETPLATFORM | cut -d "/" -f2) && \ + curl -LO https://github.com/supabase/cli/releases/download/v${version}/supabase_linux_${ARCH}.tar.gz && \ + tar -xzf supabase_linux_${ARCH}.tar.gz -C /usr/local/bin/ && \ + rm supabase_linux_${ARCH}.tar.gz # 65532 is the UID of the `nonroot` user in chainguard/static. See: https://edu.chainguard.dev/chainguard/chainguard-images/reference/static/overview/#users USER 65532:65532 From f30fd167cd0779889dbc7a79558f9d30235dd22f Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 17:33:27 -0400 Subject: [PATCH 04/51] Dockerfile edits --- packages/api/Dockerfile | 13 +++++++++---- packages/k3d-gpu/Dockerfile | 21 +++++++++++--------- packages/llama-cpp-python/Dockerfile | 6 +++--- packages/repeater/Dockerfile | 11 +++++++---- packages/text-embeddings/Dockerfile | 10 +++++----- packages/whisper/Dockerfile | 14 +++++++------- src/leapfrogai_sdk/Dockerfile | 7 +++++-- src/leapfrogai_ui/Dockerfile | 29 +++++++++++++--------------- 8 files changed, 61 insertions(+), 50 deletions(-) diff --git a/packages/api/Dockerfile b/packages/api/Dockerfile index 4bd36c4ad..151e44b0f 100644 --- a/packages/api/Dockerfile +++ b/packages/api/Dockerfile @@ -2,8 +2,11 @@ ARG LOCAL_VERSION FROM ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} AS sdk FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11-dev AS builder + ARG SDK_DEST=src/leapfrogai_sdk/build + USER root + WORKDIR /leapfrogai # copy the api dependencies over @@ -13,14 +16,16 @@ COPY src/leapfrogai_api src/leapfrogai_api RUN python -m venv .venv ENV PATH="/leapfrogai/.venv/bin:$PATH" -RUN rm -f packages/api/build/*.whl -RUN python -m pip wheel src/leapfrogai_api -w packages/api/build --find-links=${SDK_DEST} -RUN pip install packages/api/build/leapfrogai_api*.whl --no-index --find-links=packages/api/build/ +RUN rm -f packages/api/build/*.whl && \ + python -m pip wheel src/leapfrogai_api -w packages/api/build --find-links=${SDK_DEST} && \ + pip install packages/api/build/leapfrogai_api*.whl --no-index --find-links=packages/api/build/ FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11 -ENV PATH="/leapfrogai/.venv/bin:$PATH" + WORKDIR /leapfrogai +ENV PATH="/leapfrogai/.venv/bin:$PATH" + COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ EXPOSE 8080 diff --git a/packages/k3d-gpu/Dockerfile b/packages/k3d-gpu/Dockerfile index e2d14614a..509b15ebb 100644 --- a/packages/k3d-gpu/Dockerfile +++ b/packages/k3d-gpu/Dockerfile @@ -2,16 +2,19 @@ ARG K3S_TAG=v1.28.8-k3s1 ARG CUDA_TAG=12.4.1-base-ubuntu22.04 FROM rancher/k3s:$K3S_TAG AS k3s + FROM nvidia/cuda:$CUDA_TAG # Install the NVIDIA container toolkit -RUN apt-get update && apt-get install -y curl \ - && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ - && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ - sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ - tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ - && apt-get update && apt-get install -y nvidia-container-toolkit-base nvidia-container-toolkit nvidia-container-runtime util-linux \ - && nvidia-ctk runtime configure --runtime=containerd +RUN apt-get update && \ + apt-get install -y curl && \ + curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \ + curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ + sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ + tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ + apt-get update && \ + apt-get install -y nvidia-container-toolkit-base nvidia-container-toolkit nvidia-container-runtime util-linux && \ + nvidia-ctk runtime configure --runtime=containerd COPY --from=k3s / / --exclude=/bin/ COPY --from=k3s /bin /bin @@ -25,8 +28,8 @@ VOLUME /var/lib/cni VOLUME /var/log # DIFF: resolve fsnotify issues -RUN sysctl -w fs.inotify.max_user_watches=100000 -RUN sysctl -w fs.inotify.max_user_instances=100000 +RUN sysctl -w fs.inotify.max_user_watches=100000 && \ + sysctl -w fs.inotify.max_user_instances=100000 ENV PATH="$PATH:/bin/aux" diff --git a/packages/llama-cpp-python/Dockerfile b/packages/llama-cpp-python/Dockerfile index b7041bed9..2400aa2db 100644 --- a/packages/llama-cpp-python/Dockerfile +++ b/packages/llama-cpp-python/Dockerfile @@ -16,8 +16,8 @@ ENV PATH="/leapfrogai/.venv/bin:$PATH" COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST} COPY packages/llama-cpp-python packages/llama-cpp-python -RUN rm -f packages/llama-cpp-python/build/*.whl -RUN python -m pip wheel packages/llama-cpp-python -w packages/llama-cpp-python/build --find-links=${SDK_DEST} +RUN rm -f packages/llama-cpp-python/build/*.whl && \ + python -m pip wheel packages/llama-cpp-python -w packages/llama-cpp-python/build --find-links=${SDK_DEST} RUN pip install packages/llama-cpp-python/build/lfai_llama_cpp_python*.whl --no-index --find-links=packages/llama-cpp-python/build/ @@ -33,6 +33,6 @@ COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ COPY packages/llama-cpp-python/main.py . COPY packages/llama-cpp-python/config.yaml . -EXPOSE 50051:50051 +EXPOSE 50051 ENTRYPOINT ["python", "-m", "leapfrogai_sdk.cli", "--app-dir=.", "main:Model"] diff --git a/packages/repeater/Dockerfile b/packages/repeater/Dockerfile index 4d58f46a6..5e58c26b6 100644 --- a/packages/repeater/Dockerfile +++ b/packages/repeater/Dockerfile @@ -3,8 +3,11 @@ FROM ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} AS sdk # hardened and slim python w/ developer tools image FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11-dev AS builder + ARG SDK_DEST=src/leapfrogai_sdk/build + USER root + WORKDIR /leapfrogai COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST} @@ -14,9 +17,9 @@ COPY packages/repeater packages/repeater RUN python -m venv .venv ENV PATH="/leapfrogai/.venv/bin:$PATH" -RUN rm -f packages/repeater/build/*.whl -RUN python -m pip wheel packages/repeater -w packages/repeater/build --find-links=${SDK_DEST} -RUN pip install packages/repeater/build/lfai_repeater*.whl --no-index --find-links=packages/repeater/build/ +RUN rm -f packages/repeater/build/*.whl && \ + python -m pip wheel packages/repeater -w packages/repeater/build --find-links=${SDK_DEST} && \ + pip install packages/repeater/build/lfai_repeater*.whl --no-index --find-links=packages/repeater/build/ # hardened and slim python image FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11 @@ -30,7 +33,7 @@ COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ COPY packages/repeater/repeater.py . # Publish port -EXPOSE 50051:50051 +EXPOSE 50051 # Run the repeater model ENTRYPOINT ["python", "-u", "repeater.py"] diff --git a/packages/text-embeddings/Dockerfile b/packages/text-embeddings/Dockerfile index 96becc0de..68652fdb7 100644 --- a/packages/text-embeddings/Dockerfile +++ b/packages/text-embeddings/Dockerfile @@ -12,14 +12,14 @@ RUN python3.11 -m venv .venv ENV PATH="/leapfrogai/.venv/bin:$PATH" # copy and install all python dependencies -# NOTE: We are copying the leapfrogai whl to this filename because installing 'optional extras' from +# NOTE: We are copying the leapfrog whl to this filename because installing 'optional extras' from # a wheel requires the absolute path to the wheel file (instead of a wildcard whl) COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST} COPY packages/text-embeddings packages/text-embeddings -RUN rm -f packages/text-embeddings/build/*.whl -RUN python -m pip wheel packages/text-embeddings -w packages/text-embeddings/build --find-links=${SDK_DEST} -RUN pip install packages/text-embeddings/build/lfai_text_embeddings*.whl --no-index --find-links=packages/text-embeddings/build/ +RUN rm -f packages/text-embeddings/build/*.whl && \ + python -m pip wheel packages/text-embeddings -w packages/text-embeddings/build --find-links=${SDK_DEST} && \ + pip install packages/text-embeddings/build/lfai_text_embeddings*.whl --no-index --find-links=packages/text-embeddings/build/ # hardened and slim python image FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11 @@ -32,6 +32,6 @@ COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ COPY packages/text-embeddings/main.py . -EXPOSE 50051:50051 +EXPOSE 50051 ENTRYPOINT ["python", "-u", "main.py"] diff --git a/packages/whisper/Dockerfile b/packages/whisper/Dockerfile index e7568da48..b3bed054a 100644 --- a/packages/whisper/Dockerfile +++ b/packages/whisper/Dockerfile @@ -2,6 +2,7 @@ ARG LOCAL_VERSION FROM ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} AS sdk FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11-dev AS builder + USER root ARG SDK_DEST=src/leapfrogai_sdk/build @@ -14,10 +15,9 @@ ENV PATH="/leapfrogai/.venv/bin:$PATH" COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST} COPY packages/whisper packages/whisper -RUN rm -f packages/whisper/build/*.whl -RUN python -m pip wheel "packages/whisper[dev]" -w packages/whisper/build --find-links=${SDK_DEST} - -RUN pip install packages/whisper/build/lfai_whisper*.whl --no-index --find-links=packages/whisper/build/ +RUN rm -f packages/whisper/build/*.whl &&\ + python -m pip wheel "packages/whisper[dev]" -w packages/whisper/build --find-links=${SDK_DEST} &&\ + pip install packages/whisper/build/lfai_whisper*.whl --no-index --find-links=packages/whisper/build/ # Use hardened ffmpeg image to get compiled binaries FROM cgr.dev/chainguard/ffmpeg:latest AS ffmpeg @@ -37,11 +37,11 @@ COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ # set the path to the cuda 11.8 dependencies ENV LD_LIBRARY_PATH \ -/leapfrogai/.venv/lib64/python3.11/site-packages/nvidia/cublas/lib:\ -/leapfrogai/.venv/lib64/python3.11/site-packages/nvidia/cudnn/lib + /leapfrogai/.venv/lib64/python3.11/site-packages/nvidia/cublas/lib:\ + /leapfrogai/.venv/lib64/python3.11/site-packages/nvidia/cudnn/lib COPY packages/whisper/main.py . -EXPOSE 50051:50051 +EXPOSE 50051 ENTRYPOINT ["python", "-u", "main.py"] diff --git a/src/leapfrogai_sdk/Dockerfile b/src/leapfrogai_sdk/Dockerfile index 5fa4b6346..856b80bf2 100644 --- a/src/leapfrogai_sdk/Dockerfile +++ b/src/leapfrogai_sdk/Dockerfile @@ -1,12 +1,15 @@ FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11-dev AS builder ARG SDK_DEST=src/leapfrogai_sdk/build + USER root + WORKDIR /leapfrogai COPY ./src/leapfrogai_sdk /leapfrogai/src/leapfrogai_sdk RUN python -m venv .venv ENV PATH="/leapfrogai/.venv/bin:$PATH" -RUN rm -f ${SDK_DEST}/*.whl -RUN python -m pip wheel src/leapfrogai_sdk -w ${SDK_DEST} + +RUN rm -f ${SDK_DEST}/*.whl && \ + python -m pip wheel src/leapfrogai_sdk -w ${SDK_DEST} diff --git a/src/leapfrogai_ui/Dockerfile b/src/leapfrogai_ui/Dockerfile index 16cc97b20..55796a108 100644 --- a/src/leapfrogai_ui/Dockerfile +++ b/src/leapfrogai_ui/Dockerfile @@ -1,10 +1,7 @@ -FROM node:18-alpine AS builder -RUN apk update && apk upgrade && apk add --no-cache libreoffice openjdk11-jre +FROM node:18-alpine -# Add fonts for converting docs to pdfs -RUN apk add --no-cache \ - fontconfig \ - msttcorefonts-installer \ +RUN apk update && apk upgrade && \ + apk add --no-cache libreoffice openjdk11-jre fontconfig msttcorefonts-installer \ && update-ms-fonts \ && fc-cache -f @@ -12,19 +9,19 @@ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk ENV PATH=${JAVA_HOME}/bin:$PATH WORKDIR /app -COPY package.json ./ -COPY package-lock.json ./ -RUN npm ci + COPY . . -ENV NODE_ENV=production -RUN npm run build -RUN npm prune ENV NODE_ENV=production +RUN npm ci && \ + npm run build && \ + npm prune + # Disable request size limit -ENV BODY_SIZE_LIMIT=Infinity -ENV PROTOCOL_HEADER=x-forwarded-proto -ENV HOST_HEADER=x-forwarded-host +ENV BODY_SIZE_LIMIT=Infinity \ + PROTOCOL_HEADER=x-forwarded-proto \ + HOST_HEADER=x-forwarded-host + EXPOSE 3000 -CMD ["build"] \ No newline at end of file +CMD ["build"] From 7d627d95cbb96511d8ac491819b9e8a88f3d74a6 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 18:40:22 -0400 Subject: [PATCH 05/51] paths for Dockerfile --- .github/workflows/docker-lint.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-lint.yaml b/.github/workflows/docker-lint.yaml index 2e0936067..8891d7732 100644 --- a/.github/workflows/docker-lint.yaml +++ b/.github/workflows/docker-lint.yaml @@ -5,17 +5,17 @@ on: branches: - "main" paths: - - "packages" - - "Dockerfile.migrations" - - ".dockerignore" + - "**/Dockerfile" + - "**/Dockerfile.migrations" + - "**/.dockerignore" - ".github/workflows/docker-lint.yaml" pull_request: branches: - "main" paths: - - "packages" - - "Dockerfile.migrations" - - ".dockerignore" + - "**/Dockerfile" + - "**/Dockerfile.migrations" + - "**/.dockerignore" - ".github/workflows/docker-lint.yaml" concurrency: From 9bd87a1e5a426219ec5c4c4e31430540e327bebd Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 18:41:20 -0400 Subject: [PATCH 06/51] paths for UDS and Zarf --- .github/workflows/uds-lint.yaml | 9 ++------- .github/workflows/zarf-lint.yaml | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml index b0abcb48e..b4e450ea1 100644 --- a/.github/workflows/uds-lint.yaml +++ b/.github/workflows/uds-lint.yaml @@ -5,18 +5,13 @@ on: branches: - "main" paths: - - "bundles" - - "tasks" - - "task.yaml" + - "bundles/**" - ".github/workflows/uds-lint.yaml" - pull_request: branches: - "main" paths: - - "bundles" - - "tasks" - - "task.yaml" + - "bundles/**" - ".github/workflows/uds-lint.yaml" concurrency: diff --git a/.github/workflows/zarf-lint.yaml b/.github/workflows/zarf-lint.yaml index d6f6fa202..5b6e65a01 100644 --- a/.github/workflows/zarf-lint.yaml +++ b/.github/workflows/zarf-lint.yaml @@ -5,13 +5,13 @@ on: branches: - "main" paths: - - "packages" + - "**/zarf.yaml" - ".github/workflows/zarf-lint.yaml" pull_request: branches: - "main" paths: - - "packages" + - "**/zarf.yaml" - ".github/workflows/zarf-lint.yaml" concurrency: From 21ae1a43b2ab95ad531458881c594935e9f06a57 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 18:49:27 -0400 Subject: [PATCH 07/51] hadolint config changes --- .hadolint.yaml | 17 ++++++++++------- Dockerfile.migrations | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 0501bfd88..8c87dd8b5 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,8 +1,11 @@ failure-threshold: error -# ignore: use of latest, --no-cache-dir, shell usage warning, apt-get list, --no-install-recommends -ignored: - - "DL3007" - - "DL3042" - - "DL4006" - - "DL3009" - - "DL3015" +override: + warning: + - "DL3007" # use of latest image + - "DL3042" # pip --no-cache-dir + - "DL4006" # shell usage warning + - "DL3009" # apt-get list + - "DL3015" # --no-install-recommends + - "DL3008" # pinning distro package versions + - "DL3045" # usage of relative COPY + - "DL3002" # last user as root diff --git a/Dockerfile.migrations b/Dockerfile.migrations index f79bebc03..a4ee62405 100644 --- a/Dockerfile.migrations +++ b/Dockerfile.migrations @@ -16,5 +16,7 @@ RUN mkdir -p /usr/local/bin && \ # 65532 is the UID of the `nonroot` user in chainguard/static. See: https://edu.chainguard.dev/chainguard/chainguard-images/reference/static/overview/#users USER 65532:65532 +WORKDIR /supabase/migrations/ + # Download the migration scripts -COPY --chown=65532:65532 ${MIGRATIONS_DIR}/*.sql supabase/migrations/ +COPY --chown=65532:65532 ${MIGRATIONS_DIR}/*.sql /supabase/migrations/ From 291de3b46f7872441cc461e0a789b530a1b6c08e Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 18:54:16 -0400 Subject: [PATCH 08/51] hadolint config changes, pt.2 --- .hadolint.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 8c87dd8b5..0078e63ca 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,11 +1,11 @@ failure-threshold: error override: warning: - - "DL3007" # use of latest image - - "DL3042" # pip --no-cache-dir - - "DL4006" # shell usage warning - - "DL3009" # apt-get list - - "DL3015" # --no-install-recommends - - "DL3008" # pinning distro package versions - - "DL3045" # usage of relative COPY - - "DL3002" # last user as root + - DL3007 # use of latest image + - DL3042 # pip --no-cache-dir + - DL4006 # shell usage warning + - DL3009 # apt-get list + - DL3015 # --no-install-recommends + - DL3008 # pinning distro package versions + - DL3045 # usage of relative COPY + - DL3002 # last user as root From e5f4558bbb62e3effe70f8d4a33032ae78248fd9 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 20 Aug 2024 18:57:10 -0400 Subject: [PATCH 09/51] hadolint config changes, pt.3 --- .hadolint.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 0078e63ca..d35038bce 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,11 +1,10 @@ failure-threshold: error -override: - warning: - - DL3007 # use of latest image - - DL3042 # pip --no-cache-dir - - DL4006 # shell usage warning - - DL3009 # apt-get list - - DL3015 # --no-install-recommends - - DL3008 # pinning distro package versions - - DL3045 # usage of relative COPY - - DL3002 # last user as root +ignored: + - DL3007 # use of latest image + - DL3042 # pip --no-cache-dir + - DL4006 # shell usage warning + - DL3009 # apt-get list + - DL3015 # --no-install-recommends + - DL3008 # pinning distro package versions + - DL3045 # usage of relative COPY + - DL3002 # last user as root From a2b09208f092336fe525a5c8c2b16327ec885411 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 30 Aug 2024 12:40:33 -0400 Subject: [PATCH 10/51] hadolint, docker lint configs and helm lint --- .github/workflows/helm-lint.yaml | 82 ++++++++++++++++++++++++++++++++ .hadolint.yaml | 3 ++ packages/vllm/Dockerfile | 2 +- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/helm-lint.yaml diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml new file mode 100644 index 000000000..849d7664b --- /dev/null +++ b/.github/workflows/helm-lint.yaml @@ -0,0 +1,82 @@ +name: Helm Lint + +on: + push: + branches: + - "main" + paths: + - "**/chart" + - "**/values" + - "**/*values.yaml" + - ".github/workflows/helm-lint.yaml" + pull_request: + branches: + - "main" + paths: + - "**/chart" + - "**/values" + - "**/*values.yaml" + - ".github/workflows/helm-lint.yaml" + +concurrency: + group: helm-lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + helm-lint: + runs-on: ubuntu-latest + name: Lint Helm Charts + + permissions: + contents: read + + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Helm + uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 + with: + version: "v3.13.3" + + - name: Lint API Charts + if: always() + run: | + helm lint packages/api/chart --quiet + + - name: Lint llama-cpp-python Charts + if: always() + run: | + helm lint packages/llama-cpp-python/chart --quiet + + - name: Lint Supabase Charts + if: always() + run: | + helm lint packages/supabase/chart --quiet --with-subcharts packages/supabase/migrationChart --with-subcharts packages/supabase/manifests + + - name: Lint text-embeddings Charts + if: always() + run: | + helm lint packages/text-embeddings/chart --quiet + + - name: Lint UI Charts + if: always() + run: | + helm lint packages/ui/chart --quiet + + - name: Lint vllm Charts + if: always() + run: | + helm lint packages/vllm/chart --quiet + + - name: Lint whisper Charts + if: always() + run: | + helm lint packages/whisper/chart --quiet diff --git a/.hadolint.yaml b/.hadolint.yaml index d35038bce..fafcf3056 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,10 +1,13 @@ failure-threshold: error +# TODO: slowly burn down these lower priority container issues ignored: - DL3007 # use of latest image - DL3042 # pip --no-cache-dir - DL4006 # shell usage warning - DL3009 # apt-get list - DL3015 # --no-install-recommends + - DL3018 # pinning distro package versions - DL3008 # pinning distro package versions - DL3045 # usage of relative COPY - DL3002 # last user as root + - SC2086 # double quote vs single quote usage diff --git a/packages/vllm/Dockerfile b/packages/vllm/Dockerfile index 859582c0e..16503c65b 100755 --- a/packages/vllm/Dockerfile +++ b/packages/vllm/Dockerfile @@ -121,6 +121,6 @@ ENV LAI_PROMPT_FORMAT_CHAT_USER=${PROMPT_FORMAT_CHAT_USER} ENV LAI_PROMPT_FORMAT_DEFAULTS_TOP_P=${PROMPT_FORMAT_DEFAULTS_TOP_P} ENV LAI_PROMPT_FORMAT_DEFAULTS_TOP_K=${PROMPT_FORMAT_DEFAULTS_TOP_K} -EXPOSE 50051:50051 +EXPOSE 50051 ENTRYPOINT ["python", "-m", "leapfrogai_sdk.cli", "--app-dir=packages/vllm/src/", "main:Model"] From 3f2f808dcd710bed12b3773b776ed12c910a1e21 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 30 Aug 2024 15:26:42 -0400 Subject: [PATCH 11/51] text-embeddings fixes --- .pre-commit-config.yaml | 2 +- packages/text-embeddings/chart/Chart.yaml | 4 +++- packages/text-embeddings/chart/templates/deployment.yaml | 4 ++-- packages/text-embeddings/chart/templates/pvc.yaml | 4 ++-- packages/text-embeddings/chart/values.yaml | 9 ++++++++- .../upstream-values.yaml} | 5 +++-- packages/text-embeddings/zarf.yaml | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) rename packages/text-embeddings/{embedding-values.yaml => values/upstream-values.yaml} (59%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cbba0d5c8..5eb86af91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: rev: v0.12.1 hooks: - id: markdownlint-cli2 - name: Markdown Linti + name: Markdown Lint - repo: https://github.com/hadolint/hadolint rev: v2.12.0 diff --git a/packages/text-embeddings/chart/Chart.yaml b/packages/text-embeddings/chart/Chart.yaml index a48619d5f..cd60e68c9 100644 --- a/packages/text-embeddings/chart/Chart.yaml +++ b/packages/text-embeddings/chart/Chart.yaml @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.2" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 77d7d5e0b..5837068ca 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - app: lfai-text-embeddings + app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: {{- if gt (index .Values.resources.limits "nvidia.com/gpu") 0.0 }} @@ -59,7 +59,7 @@ spec: volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: - claimName: lfai-text-embeddings-pv-claim + claimName: lfai-{{ .Values.nameOverride }}-pv-claim securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/packages/text-embeddings/chart/templates/pvc.yaml b/packages/text-embeddings/chart/templates/pvc.yaml index 3ce063f32..acbe46e84 100644 --- a/packages/text-embeddings/chart/templates/pvc.yaml +++ b/packages/text-embeddings/chart/templates/pvc.yaml @@ -1,8 +1,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: lfai-text-embeddings-pv-claim - namespace: leapfrogai + name: lfai-{{ .Values.nameOverride }}-pv-claim + namespace: {{ .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 7e62b3ffd..057e2c890 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -19,11 +19,15 @@ podAnnotations: {} podSecurityContext: runAsNonRoot: true + fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - fsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP @@ -58,3 +62,6 @@ persistence: size: 15Gi accessModes: ReadWriteOnce storageClass: "local-path" + +gpu: + runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" diff --git a/packages/text-embeddings/embedding-values.yaml b/packages/text-embeddings/values/upstream-values.yaml similarity index 59% rename from packages/text-embeddings/embedding-values.yaml rename to packages/text-embeddings/values/upstream-values.yaml index 864fc0a73..b313f1286 100644 --- a/packages/text-embeddings/embedding-values.yaml +++ b/packages/text-embeddings/values/upstream-values.yaml @@ -1,8 +1,9 @@ image: - tag: "###ZARF_CONST_IMAGE_VERSION###" + repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings + tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" + runtimeClassName: ###ZARF_VAR_GPU_CLASS_NAME### resources: limits: diff --git a/packages/text-embeddings/zarf.yaml b/packages/text-embeddings/zarf.yaml index bff729139..09ddc41e0 100644 --- a/packages/text-embeddings/zarf.yaml +++ b/packages/text-embeddings/zarf.yaml @@ -44,7 +44,7 @@ components: version: 0.11.0 # x-release-please-end valuesFiles: - - "embedding-values.yaml" + - "values/upstream-values.yaml" images: - ghcr.io/defenseunicorns/leapfrogai/text-embeddings:###ZARF_PKG_TMPL_IMAGE_VERSION### - cgr.dev/chainguard/bash:latest From 54855030bca95edc13d3b8f0f7a379dfc3fd040e Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 30 Aug 2024 15:30:04 -0400 Subject: [PATCH 12/51] pre-commit fixes --- .pre-commit-config.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5eb86af91..88b6459c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,9 +97,7 @@ repos: - id: download-schema name: "Download Zarf Schema" entry: | - bash -c 'if [! -f zarf-v0.14.0.schema.json ]; \ - then curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json; \ - else exit 0; fi' + bash -c 'if [! -f zarf-v0.14.0.schema.json ]; then curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json; else exit 0; fi' language: system - repo: https://github.com/python-jsonschema/check-jsonschema @@ -117,9 +115,7 @@ repos: - id: download-schema name: "Download UDS Bundle Schema" entry: | - bash -c 'if [! -f uds-v0.14.0.schema.json ]; \ - then curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json; \ - else exit 0; fi' + bash -c 'if [! -f uds-v0.14.0.schema.json ]; then curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json; else exit 0; fi' language: system - repo: https://github.com/python-jsonschema/check-jsonschema From 8d7be635bf83c5ce5cee8f1084d8ef6a172ce6c3 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 30 Aug 2024 16:57:57 -0400 Subject: [PATCH 13/51] llama-cpp-python fixes --- .pre-commit-config.yaml | 4 ++-- packages/llama-cpp-python/chart/templates/deployment.yaml | 4 ++-- packages/llama-cpp-python/chart/templates/pvc.yaml | 2 +- packages/llama-cpp-python/chart/values.yaml | 8 ++++++-- .../upstream-values.yaml} | 3 ++- packages/llama-cpp-python/zarf.yaml | 2 +- packages/text-embeddings/chart/values.yaml | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) rename packages/llama-cpp-python/{llama-cpp-python-values.yaml => values/upstream-values.yaml} (58%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88b6459c7..15942d376 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,7 +97,7 @@ repos: - id: download-schema name: "Download Zarf Schema" entry: | - bash -c 'if [! -f zarf-v0.14.0.schema.json ]; then curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json; else exit 0; fi' + bash -c 'curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json' language: system - repo: https://github.com/python-jsonschema/check-jsonschema @@ -115,7 +115,7 @@ repos: - id: download-schema name: "Download UDS Bundle Schema" entry: | - bash -c 'if [! -f uds-v0.14.0.schema.json ]; then curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json; else exit 0; fi' + bash -c 'curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json' language: system - repo: https://github.com/python-jsonschema/check-jsonschema diff --git a/packages/llama-cpp-python/chart/templates/deployment.yaml b/packages/llama-cpp-python/chart/templates/deployment.yaml index 67082c4f4..b4aa011f3 100644 --- a/packages/llama-cpp-python/chart/templates/deployment.yaml +++ b/packages/llama-cpp-python/chart/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - app: lfai-llama + app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: # It's necessary to include the ###ZARF_DATA_INJECTION_MARKER### somewhere in the podspec, otherwise data injections will not occur. @@ -54,7 +54,7 @@ spec: volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: - claimName: lfai-llama-pv-claim + claimName: lfai-{{ .Values.nameOverride }}-pv-claim securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/packages/llama-cpp-python/chart/templates/pvc.yaml b/packages/llama-cpp-python/chart/templates/pvc.yaml index 2b161cffc..687cb7282 100644 --- a/packages/llama-cpp-python/chart/templates/pvc.yaml +++ b/packages/llama-cpp-python/chart/templates/pvc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: lfai-llama-pv-claim + name: lfai-{{ .Values.nameOverride }}-pv-claim namespace: leapfrogai spec: {{- if .Values.persistence.storageClass }} diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index b022021d4..abd685841 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: "ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python" + repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version @@ -19,11 +19,15 @@ podAnnotations: {} podSecurityContext: runAsNonRoot: true + fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - fsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP diff --git a/packages/llama-cpp-python/llama-cpp-python-values.yaml b/packages/llama-cpp-python/values/upstream-values.yaml similarity index 58% rename from packages/llama-cpp-python/llama-cpp-python-values.yaml rename to packages/llama-cpp-python/values/upstream-values.yaml index f2acd8b4b..33c9a6d40 100644 --- a/packages/llama-cpp-python/llama-cpp-python-values.yaml +++ b/packages/llama-cpp-python/values/upstream-values.yaml @@ -1,5 +1,6 @@ image: - tag: "###ZARF_CONST_IMAGE_VERSION###" + repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python + tag: ###ZARF_CONST_IMAGE_VERSION### persistence: size: ###ZARF_VAR_PVC_SIZE### diff --git a/packages/llama-cpp-python/zarf.yaml b/packages/llama-cpp-python/zarf.yaml index 054f09130..3c1dacb5f 100644 --- a/packages/llama-cpp-python/zarf.yaml +++ b/packages/llama-cpp-python/zarf.yaml @@ -36,7 +36,7 @@ components: version: 0.11.0 # x-release-please-end valuesFiles: - - "llama-cpp-python-values.yaml" + - "values/upstream-values.yaml" images: - ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python:###ZARF_PKG_TMPL_IMAGE_VERSION### - cgr.dev/chainguard/bash:latest diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 057e2c890..805d7eeb0 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: "ghcr.io/defenseunicorns/leapfrogai/text-embeddings" + repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version From c5dbaa0799b8cf5f86d75c972763c38de5ee5337 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 30 Aug 2024 17:03:41 -0400 Subject: [PATCH 14/51] whisper and other fixes --- packages/llama-cpp-python/chart/Chart.yaml | 4 +++- packages/llama-cpp-python/chart/templates/pvc.yaml | 2 +- packages/whisper/chart/Chart.yaml | 4 +++- packages/whisper/chart/templates/deployment.yaml | 4 ++-- packages/whisper/chart/templates/pvc.yaml | 4 ++-- packages/whisper/chart/values.yaml | 11 +++++++++-- .../upstream-values.yaml} | 5 +++-- packages/whisper/zarf.yaml | 2 +- 8 files changed, 24 insertions(+), 12 deletions(-) rename packages/whisper/{whisper-values.yaml => values/upstream-values.yaml} (60%) diff --git a/packages/llama-cpp-python/chart/Chart.yaml b/packages/llama-cpp-python/chart/Chart.yaml index a48619d5f..cd60e68c9 100644 --- a/packages/llama-cpp-python/chart/Chart.yaml +++ b/packages/llama-cpp-python/chart/Chart.yaml @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.2" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/llama-cpp-python/chart/templates/pvc.yaml b/packages/llama-cpp-python/chart/templates/pvc.yaml index 687cb7282..acbe46e84 100644 --- a/packages/llama-cpp-python/chart/templates/pvc.yaml +++ b/packages/llama-cpp-python/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: leapfrogai + namespace: {{ .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/whisper/chart/Chart.yaml b/packages/whisper/chart/Chart.yaml index a48619d5f..cd60e68c9 100644 --- a/packages/whisper/chart/Chart.yaml +++ b/packages/whisper/chart/Chart.yaml @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.2" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 40139d946..95b773492 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - app: lfai-whisper + app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: {{- if gt (index .Values.resources.limits "nvidia.com/gpu") 0.0 }} @@ -59,7 +59,7 @@ spec: volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: - claimName: lfai-whisper-pv-claim + claimName: lfai-{{ .Values.nameOverride }}-pv-claim securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/packages/whisper/chart/templates/pvc.yaml b/packages/whisper/chart/templates/pvc.yaml index 02e81eec0..acbe46e84 100644 --- a/packages/whisper/chart/templates/pvc.yaml +++ b/packages/whisper/chart/templates/pvc.yaml @@ -1,8 +1,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: lfai-whisper-pv-claim - namespace: leapfrogai + name: lfai-{{ .Values.nameOverride }}-pv-claim + namespace: {{ .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index e9285c0c2..a157e0b3a 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: "ghcr.io/defenseunicorns/leapfrogai/whisper" + repository: ghcr.io/defenseunicorns/leapfrogai/whisper pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version @@ -19,11 +19,15 @@ podAnnotations: {} podSecurityContext: runAsNonRoot: true + fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - fsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP @@ -58,3 +62,6 @@ persistence: size: 15Gi accessModes: ReadWriteOnce storageClass: "local-path" + +gpu: + runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" diff --git a/packages/whisper/whisper-values.yaml b/packages/whisper/values/upstream-values.yaml similarity index 60% rename from packages/whisper/whisper-values.yaml rename to packages/whisper/values/upstream-values.yaml index 864fc0a73..3be17bff6 100644 --- a/packages/whisper/whisper-values.yaml +++ b/packages/whisper/values/upstream-values.yaml @@ -1,8 +1,9 @@ image: - tag: "###ZARF_CONST_IMAGE_VERSION###" + repository: ghcr.io/defenseunicorns/leapfrogai/whisper + tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" + runtimeClassName: ###ZARF_VAR_GPU_CLASS_NAME### resources: limits: diff --git a/packages/whisper/zarf.yaml b/packages/whisper/zarf.yaml index e34e8f458..7a6ed5910 100644 --- a/packages/whisper/zarf.yaml +++ b/packages/whisper/zarf.yaml @@ -45,7 +45,7 @@ components: version: 0.11.0 # x-release-please-end valuesFiles: - - "whisper-values.yaml" + - "values/upstream-values.yaml" images: - ghcr.io/defenseunicorns/leapfrogai/whisper:###ZARF_PKG_TMPL_IMAGE_VERSION### - cgr.dev/chainguard/bash:latest From 2ab73277409d5cbbecab82e1a5e5e93960ba464c Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 11:35:51 -0400 Subject: [PATCH 15/51] whisper, vllm, repeater, many fixes --- .github/workflows/helm-lint.yaml | 5 +++ .pre-commit-config.yaml | 14 ++++++-- Makefile | 4 +-- packages/llama-cpp-python/chart/Chart.yaml | 2 +- .../chart/templates/deployment.yaml | 14 ++------ packages/llama-cpp-python/chart/values.yaml | 23 +++++++++++- packages/repeater/chart/Chart.yaml | 6 ++-- .../repeater/chart/templates/deployment.yaml | 2 +- packages/repeater/chart/values.yaml | 34 ++++++++++++++++-- packages/repeater/repeater-values.yaml | 2 -- .../values/upstream-values.yaml} | 6 ++-- packages/repeater/zarf-config.yaml | 17 --------- packages/repeater/zarf.yaml | 4 +-- packages/text-embeddings/chart/Chart.yaml | 2 +- .../chart/templates/deployment.yaml | 14 ++------ packages/text-embeddings/chart/values.yaml | 23 +++++++++++- .../values/upstream-values.yaml | 2 +- packages/text-embeddings/zarf.yaml | 2 +- packages/vllm/chart/Chart.yaml | 6 ++-- packages/vllm/chart/templates/deployment.yaml | 18 +++------- packages/vllm/chart/templates/pvc.yaml | 4 +-- packages/vllm/chart/values.yaml | 35 ++++++++++++++++--- packages/vllm/values/upstream-values.yaml | 15 ++++++++ packages/vllm/zarf.yaml | 10 +++++- packages/whisper/chart/Chart.yaml | 2 +- .../whisper/chart/templates/deployment.yaml | 14 ++------ packages/whisper/chart/values.yaml | 23 +++++++++++- packages/whisper/values/upstream-values.yaml | 2 +- packages/whisper/zarf.yaml | 4 +-- uds-bundles/dev/cpu/uds-config.yaml | 4 +-- uds-bundles/dev/gpu/uds-config.yaml | 4 +-- uds-bundles/latest/cpu/uds-config.yaml | 4 +-- uds-bundles/latest/gpu/uds-config.yaml | 4 +-- 33 files changed, 217 insertions(+), 108 deletions(-) delete mode 100644 packages/repeater/repeater-values.yaml rename packages/{vllm/vllm-values.yaml => repeater/values/upstream-values.yaml} (60%) delete mode 100644 packages/repeater/zarf-config.yaml create mode 100644 packages/vllm/values/upstream-values.yaml diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 849d7664b..7ec94f636 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -80,3 +80,8 @@ jobs: if: always() run: | helm lint packages/whisper/chart --quiet + + - name: Lint repeater Charts + if: always() + run: | + helm lint packages/repeater/chart --quiet diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15942d376..999c82c8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,7 +97,12 @@ repos: - id: download-schema name: "Download Zarf Schema" entry: | - bash -c 'curl -o zarf-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json' + bash -c 'FILE="zarf-v0.14.0.schema.json" + if [ -f "$(git rev-parse --show-toplevel)/$FILE" ]; then + echo "$FILE already exists in the root of the git project, skipping download." + else + curl -o "$FILE" https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json + fi' language: system - repo: https://github.com/python-jsonschema/check-jsonschema @@ -115,7 +120,12 @@ repos: - id: download-schema name: "Download UDS Bundle Schema" entry: | - bash -c 'curl -o uds-v0.14.0.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json' + bash -c 'FILE="uds-v0.14.0.schema.json" + if [ -f "$(git rev-parse --show-toplevel)/$FILE" ]; then + echo "$FILE already exists in the root of the git project, skipping download." + else + curl -o "$FILE" https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json + fi' language: system - repo: https://github.com/python-jsonschema/check-jsonschema diff --git a/Makefile b/Makefile index 3515ff30a..ba5c3b817 100644 --- a/Makefile +++ b/Makefile @@ -297,8 +297,8 @@ silent-deploy-gpu: @$(MAKE) -j${MAX_JOBS} \ silent-deploy-api-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS}" \ silent-deploy-vllm-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS}" \ - silent-deploy-text-embeddings-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_CLASS_NAME='nvidia'" \ - silent-deploy-whisper-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_CLASS_NAME='nvidia'" + silent-deploy-text-embeddings-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME_NAME='nvidia'" \ + silent-deploy-whisper-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME_NAME='nvidia'" @echo "Deploying UI..." @$(MAKE) silent-deploy-ui-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=MODEL='vllm'" @echo "All deployments completed" diff --git a/packages/llama-cpp-python/chart/Chart.yaml b/packages/llama-cpp-python/chart/Chart.yaml index cd60e68c9..4371db0ab 100644 --- a/packages/llama-cpp-python/chart/Chart.yaml +++ b/packages/llama-cpp-python/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-model -description: A Helm chart for Kubernetes +description: "A LeapfrogAI compatible inferencing backend, llama-cpp-python" # A chart can be either an 'application' or a 'library' chart. # diff --git a/packages/llama-cpp-python/chart/templates/deployment.yaml b/packages/llama-cpp-python/chart/templates/deployment.yaml index b4aa011f3..d2fef3ebd 100644 --- a/packages/llama-cpp-python/chart/templates/deployment.yaml +++ b/packages/llama-cpp-python/chart/templates/deployment.yaml @@ -31,9 +31,7 @@ spec: - name: data-loader image: cgr.dev/chainguard/bash:latest securityContext: - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 + {{- toYaml .Values.modelInjectionContainer.securityContext | nindent 12 }} # This command looks for the Zarf "data injection marker" which is a timestamped file that is injected after everything else and marks the injection as complete. command: [ @@ -42,15 +40,9 @@ spec: 'while [ ! -f /data/.model/###ZARF_DATA_INJECTION_MARKER### ]; do echo "waiting for zarf data sync" && sleep 1; done; echo "we are done waiting!"', ] resources: - requests: - memory: "64Mi" - cpu: "200m" - limits: - memory: "128Mi" - cpu: "500m" + {{- toYaml .Values.modelInjectionContainer.resources | nindent 12 }} volumeMounts: - - name: leapfrogai-pv-storage - mountPath: /data + {{- toYaml .Values.modelInjectionContainer.volumeMounts | nindent 12 }} volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index abd685841..86da26755 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -27,7 +27,7 @@ securityContext: runAsNonRoot: true capabilities: drop: - - ALL + - ALL service: type: ClusterIP @@ -63,3 +63,24 @@ persistence: size: 15Gi accessModes: ReadWriteOnce storageClass: "local-path" + +modelInjectionContainer: + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + + resources: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "64Mi" + cpu: "200m" + + volumeMounts: + - name: leapfrogai-pv-storage + mountPath: /data diff --git a/packages/repeater/chart/Chart.yaml b/packages/repeater/chart/Chart.yaml index 4df008634..3ef011f1a 100644 --- a/packages/repeater/chart/Chart.yaml +++ b/packages/repeater/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-repeater -description: A Helm chart for Kubernetes +description: "A LeapfrogAI compatible inferencing backend for testing-only, repeater" # A chart can be either an 'application' or a 'library' chart. # @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.2" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/repeater/chart/templates/deployment.yaml b/packages/repeater/chart/templates/deployment.yaml index 8d014f1c7..1c51aae0b 100644 --- a/packages/repeater/chart/templates/deployment.yaml +++ b/packages/repeater/chart/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "chart.selectorLabels" . | nindent 8 }} + app: lfai-{{ .Values.nameOverride }} spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index cba606240..39e2a8e5c 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: "ghcr.io/defenseunicorns/leapfrogai/repeater" + repository: ghcr.io/defenseunicorns/leapfrogai/repeater pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version @@ -19,11 +19,15 @@ podAnnotations: {} podSecurityContext: runAsNonRoot: true + fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - fsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP @@ -54,3 +58,29 @@ nodeSelector: {} tolerations: [] affinity: {} + +persistence: + size: 15Gi + accessModes: ReadWriteOnce + storageClass: "local-path" + +modelInjectionContainer: + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + + resources: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "64Mi" + cpu: "200m" + + volumeMounts: + - name: leapfrogai-pv-storage + mountPath: /data diff --git a/packages/repeater/repeater-values.yaml b/packages/repeater/repeater-values.yaml deleted file mode 100644 index 3e3c22379..000000000 --- a/packages/repeater/repeater-values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -image: - tag: "###ZARF_CONST_IMAGE_VERSION###" diff --git a/packages/vllm/vllm-values.yaml b/packages/repeater/values/upstream-values.yaml similarity index 60% rename from packages/vllm/vllm-values.yaml rename to packages/repeater/values/upstream-values.yaml index 90631193e..b182458a9 100644 --- a/packages/vllm/vllm-values.yaml +++ b/packages/repeater/values/upstream-values.yaml @@ -1,8 +1,6 @@ image: - tag: "###ZARF_CONST_IMAGE_VERSION###" - -gpu: - runtimeClassName: nvidia + repository: ghcr.io/defenseunicorns/leapfrogai/repeater + tag: ###ZARF_CONST_IMAGE_VERSION### persistence: size: ###ZARF_VAR_PVC_SIZE### diff --git a/packages/repeater/zarf-config.yaml b/packages/repeater/zarf-config.yaml deleted file mode 100644 index 8a9034d1e..000000000 --- a/packages/repeater/zarf-config.yaml +++ /dev/null @@ -1,17 +0,0 @@ -package: - create: - set: - image_repository: "ghcr.io/defenseunicorns/leapfrogai/repeater" - # x-release-please-start-version - image_version: 0.11.0 - # x-release-please-end - name: repeater - max_package_size: "1000000000" - deploy: - set: - limits_cpu: 1 - limits_memory: 4Gi - limits_gpu: 0 - requests_cpu: 1 - requests_memory: 4Gi - requests_gpu: 0 diff --git a/packages/repeater/zarf.yaml b/packages/repeater/zarf.yaml index 19fb7b665..d5bf15fce 100644 --- a/packages/repeater/zarf.yaml +++ b/packages/repeater/zarf.yaml @@ -3,7 +3,7 @@ metadata: name: repeater version: "###ZARF_PKG_TMPL_IMAGE_VERSION###" description: > - repeater + repeater model constants: - name: IMAGE_VERSION @@ -21,6 +21,6 @@ components: version: 0.11.0 # x-release-please-end valuesFiles: - - "repeater-values.yaml" + - "values/upstream-values.yaml" images: - ghcr.io/defenseunicorns/leapfrogai/repeater:###ZARF_PKG_TMPL_IMAGE_VERSION### diff --git a/packages/text-embeddings/chart/Chart.yaml b/packages/text-embeddings/chart/Chart.yaml index cd60e68c9..ea44c1ba6 100644 --- a/packages/text-embeddings/chart/Chart.yaml +++ b/packages/text-embeddings/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-model -description: A Helm chart for Kubernetes +description: "A LeapfrogAI compatible inferencing backend, text-embeddings" # A chart can be either an 'application' or a 'library' chart. # diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 5837068ca..1bb376b42 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -36,9 +36,7 @@ spec: - name: data-loader image: cgr.dev/chainguard/bash:latest securityContext: - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 + {{- toYaml .Values.modelInjectionContainer.securityContext | nindent 12 }} # This command looks for the Zarf "data injection marker" which is a timestamped file that is injected after everything else and marks the injection as complete. command: [ @@ -47,15 +45,9 @@ spec: 'while [ ! -f /data/.model/###ZARF_DATA_INJECTION_MARKER### ]; do echo "waiting for zarf data sync" && sleep 1; done; echo "we are done waiting!"', ] resources: - requests: - memory: "64Mi" - cpu: "200m" - limits: - memory: "128Mi" - cpu: "500m" + {{- toYaml .Values.modelInjectionContainer.resources | nindent 12 }} volumeMounts: - - name: leapfrogai-pv-storage - mountPath: /data + {{- toYaml .Values.modelInjectionContainer.volumeMounts | nindent 12 }} volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 805d7eeb0..9f17f28cf 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -64,4 +64,25 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + +modelInjectionContainer: + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + + resources: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "64Mi" + cpu: "200m" + + volumeMounts: + - name: leapfrogai-pv-storage + mountPath: /data diff --git a/packages/text-embeddings/values/upstream-values.yaml b/packages/text-embeddings/values/upstream-values.yaml index b313f1286..e70bee519 100644 --- a/packages/text-embeddings/values/upstream-values.yaml +++ b/packages/text-embeddings/values/upstream-values.yaml @@ -3,7 +3,7 @@ image: tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: ###ZARF_VAR_GPU_CLASS_NAME### + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### resources: limits: diff --git a/packages/text-embeddings/zarf.yaml b/packages/text-embeddings/zarf.yaml index 09ddc41e0..f4181b9ab 100644 --- a/packages/text-embeddings/zarf.yaml +++ b/packages/text-embeddings/zarf.yaml @@ -16,7 +16,7 @@ variables: description: The GPU limit for the model inferencing. default: "0" pattern: "^[0-9]+$" - - name: GPU_CLASS_NAME + - name: GPU_RUNTIME_NAME description: The GPU class name for the model inferencing. Leave blank for CPU-only. default: "" pattern: "^(nvidia)?$" diff --git a/packages/vllm/chart/Chart.yaml b/packages/vllm/chart/Chart.yaml index a48619d5f..667d8c476 100644 --- a/packages/vllm/chart/Chart.yaml +++ b/packages/vllm/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-model -description: A Helm chart for Kubernetes +description: "A LeapfrogAI compatible inferencing backend, vllm" # A chart can be either an 'application' or a 'library' chart. # @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.2" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/vllm/chart/templates/deployment.yaml b/packages/vllm/chart/templates/deployment.yaml index fcd927246..5fa3d3822 100644 --- a/packages/vllm/chart/templates/deployment.yaml +++ b/packages/vllm/chart/templates/deployment.yaml @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - app: lfai-vllm + app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: runtimeClassName: {{ .Values.gpu.runtimeClassName }} @@ -32,9 +32,7 @@ spec: - name: data-loader image: cgr.dev/chainguard/bash:latest securityContext: - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 + {{- toYaml .Values.modelInjectionContainer.securityContext | nindent 12 }} # This command looks for the Zarf "data injection marker" which is a timestamped file that is injected after everything else and marks the injection as complete. command: [ @@ -43,19 +41,13 @@ spec: 'while [ ! -f /data/.model/###ZARF_DATA_INJECTION_MARKER### ]; do echo "waiting for zarf data sync" && sleep 1; done; echo "we are done waiting!"', ] resources: - requests: - memory: "64Mi" - cpu: "200m" - limits: - memory: "128Mi" - cpu: "500m" + {{- toYaml .Values.modelInjectionContainer.resources | nindent 12 }} volumeMounts: - - name: leapfrogai-pv-storage - mountPath: /data + {{- toYaml .Values.modelInjectionContainer.volumeMounts | nindent 12 }} volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: - claimName: lfai-vllm-pv-claim + claimName: lfai-{{ .Values.nameOverride }}-pv-claim securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/packages/vllm/chart/templates/pvc.yaml b/packages/vllm/chart/templates/pvc.yaml index 81c617f70..acbe46e84 100644 --- a/packages/vllm/chart/templates/pvc.yaml +++ b/packages/vllm/chart/templates/pvc.yaml @@ -1,8 +1,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: lfai-vllm-pv-claim - namespace: leapfrogai + name: lfai-{{ .Values.nameOverride }}-pv-claim + namespace: {{ .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index 1ccd965b5..270239142 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: "ghcr.io/defenseunicorns/leapfrogai/vllm" + repository: ghcr.io/defenseunicorns/leapfrogai/vllm pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version @@ -19,11 +19,15 @@ podAnnotations: {} podSecurityContext: runAsNonRoot: true + fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - fsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP @@ -37,11 +41,10 @@ resources: limits: cpu: 0 memory: 0 - nvidia.com/gpu: 1 + nvidia.com/gpu: 0 requests: cpu: 0 memory: 0 - nvidia.com/gpu: 1 autoscaling: enabled: false @@ -59,3 +62,27 @@ persistence: size: 15Gi accessModes: ReadWriteOnce storageClass: "local-path" + +gpu: + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + +modelInjectionContainer: + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + + resources: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "64Mi" + cpu: "200m" + + volumeMounts: + - name: leapfrogai-pv-storage + mountPath: /data diff --git a/packages/vllm/values/upstream-values.yaml b/packages/vllm/values/upstream-values.yaml new file mode 100644 index 000000000..bab154e71 --- /dev/null +++ b/packages/vllm/values/upstream-values.yaml @@ -0,0 +1,15 @@ +image: + repository: ghcr.io/defenseunicorns/leapfrogai/vllm + tag: ###ZARF_CONST_IMAGE_VERSION### + +gpu: + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### + +resources: + limits: + nvidia.com/gpu: ###ZARF_VAR_GPU_LIMIT### + +persistence: + size: ###ZARF_VAR_PVC_SIZE### + accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### + storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### diff --git a/packages/vllm/zarf.yaml b/packages/vllm/zarf.yaml index c48f9914f..1c47fe8f1 100644 --- a/packages/vllm/zarf.yaml +++ b/packages/vllm/zarf.yaml @@ -11,6 +11,14 @@ constants: value: "###ZARF_PKG_TMPL_IMAGE_VERSION###" variables: + - name: GPU_LIMIT + description: The GPU limit for the model inferencing. Must be 1 or more. + default: "1" + pattern: "^[1-9][0-9]*$" + - name: GPU_RUNTIME_NAME + description: The GPU runtime name for the model inferencing. + default: "nvidia" + pattern: "^(nvidia)?$" - name: PVC_SIZE description: Size of the PVC used for model storage. default: "15Gi" @@ -35,7 +43,7 @@ components: version: 0.11.0 # x-release-please-end valuesFiles: - - "vllm-values.yaml" + - "values/upstream-values.yaml" images: - ghcr.io/defenseunicorns/leapfrogai/vllm:###ZARF_PKG_TMPL_IMAGE_VERSION### - cgr.dev/chainguard/bash:latest diff --git a/packages/whisper/chart/Chart.yaml b/packages/whisper/chart/Chart.yaml index cd60e68c9..b209a92fb 100644 --- a/packages/whisper/chart/Chart.yaml +++ b/packages/whisper/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-model -description: A Helm chart for Kubernetes +description: "A LeapfrogAI compatible inferencing backend, whisper" # A chart can be either an 'application' or a 'library' chart. # diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 95b773492..196f2c4f3 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -36,9 +36,7 @@ spec: - name: data-loader image: cgr.dev/chainguard/bash:latest securityContext: - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 + {{- toYaml .Values.modelInjectionContainer.securityContext | nindent 12 }} # This command looks for the Zarf "data injection marker" which is a timestamped file that is injected after everything else and marks the injection as complete. command: [ @@ -47,15 +45,9 @@ spec: 'while [ ! -f /data/.model/###ZARF_DATA_INJECTION_MARKER### ]; do echo "waiting for zarf data sync" && sleep 1; done; echo "we are done waiting!"', ] resources: - requests: - memory: "64Mi" - cpu: "200m" - limits: - memory: "128Mi" - cpu: "500m" + {{- toYaml .Values.modelInjectionContainer.resources | nindent 12 }} volumeMounts: - - name: leapfrogai-pv-storage - mountPath: /data + {{- toYaml .Values.modelInjectionContainer.volumeMounts | nindent 12 }} volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index a157e0b3a..a02002133 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -64,4 +64,25 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_CLASS_NAME###" + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + +modelInjectionContainer: + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + + resources: + limits: + memory: "128Mi" + cpu: "500m" + requests: + memory: "64Mi" + cpu: "200m" + + volumeMounts: + - name: leapfrogai-pv-storage + mountPath: /data diff --git a/packages/whisper/values/upstream-values.yaml b/packages/whisper/values/upstream-values.yaml index 3be17bff6..53b01515e 100644 --- a/packages/whisper/values/upstream-values.yaml +++ b/packages/whisper/values/upstream-values.yaml @@ -3,7 +3,7 @@ image: tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: ###ZARF_VAR_GPU_CLASS_NAME### + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### resources: limits: diff --git a/packages/whisper/zarf.yaml b/packages/whisper/zarf.yaml index 7a6ed5910..bd532ad8b 100644 --- a/packages/whisper/zarf.yaml +++ b/packages/whisper/zarf.yaml @@ -16,8 +16,8 @@ variables: description: The GPU limit for the model inferencing. default: "0" pattern: "^[0-9]+$" - - name: GPU_CLASS_NAME - description: The GPU class name for the model inferencing. Leave blank for CPU-only. + - name: GPU_RUNTIME_NAME + description: The GPU runtime name for the model inferencing. Leave blank for CPU-only. default: "" pattern: "^(nvidia)?$" - name: PVC_SIZE diff --git a/uds-bundles/dev/cpu/uds-config.yaml b/uds-bundles/dev/cpu/uds-config.yaml index 85e8e3e74..2c2dfbd9d 100644 --- a/uds-bundles/dev/cpu/uds-config.yaml +++ b/uds-bundles/dev/cpu/uds-config.yaml @@ -1,10 +1,10 @@ variables: text-embeddings: - gpu_class_name: "" # Leave blank if nvidia runtimeClass is not present in cluster + GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 whisper: - gpu_class_name: "" # Leave blank if nvidia runtimeClass is not present in cluster + GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 supabase: diff --git a/uds-bundles/dev/gpu/uds-config.yaml b/uds-bundles/dev/gpu/uds-config.yaml index 4f331e1dc..0d39b2632 100644 --- a/uds-bundles/dev/gpu/uds-config.yaml +++ b/uds-bundles/dev/gpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - gpu_class_name: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased whisper: - gpu_class_name: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased vllm: diff --git a/uds-bundles/latest/cpu/uds-config.yaml b/uds-bundles/latest/cpu/uds-config.yaml index 99e4fb49b..3e0ccb54a 100644 --- a/uds-bundles/latest/cpu/uds-config.yaml +++ b/uds-bundles/latest/cpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - gpu_class_name: "" # Leave blank if nvidia runtimeClass is not present in cluster + GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 whisper: - gpu_class_name: "" # Leave blank if nvidia runtimeClass is not present in cluster + GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 supabase: diff --git a/uds-bundles/latest/gpu/uds-config.yaml b/uds-bundles/latest/gpu/uds-config.yaml index 4f331e1dc..0d39b2632 100644 --- a/uds-bundles/latest/gpu/uds-config.yaml +++ b/uds-bundles/latest/gpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - gpu_class_name: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased whisper: - gpu_class_name: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased vllm: From 9b6dbdd3bd70a03e5ebae0b396071a44e771a5da Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 13:01:34 -0400 Subject: [PATCH 16/51] fix vllm Dockerfile lint warnings --- .github/workflows/helm-lint.yaml | 35 +------ packages/vllm/Dockerfile | 173 +++++++++++++++---------------- 2 files changed, 88 insertions(+), 120 deletions(-) diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 7ec94f636..ce02beca0 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -46,42 +46,13 @@ jobs: with: version: "v3.13.3" - - name: Lint API Charts - if: always() + - name: Lint Helm Charts run: | helm lint packages/api/chart --quiet - - - name: Lint llama-cpp-python Charts - if: always() - run: | helm lint packages/llama-cpp-python/chart --quiet - - - name: Lint Supabase Charts - if: always() - run: | - helm lint packages/supabase/chart --quiet --with-subcharts packages/supabase/migrationChart --with-subcharts packages/supabase/manifests - - - name: Lint text-embeddings Charts - if: always() - run: | helm lint packages/text-embeddings/chart --quiet - - - name: Lint UI Charts - if: always() - run: | - helm lint packages/ui/chart --quiet - - - name: Lint vllm Charts - if: always() - run: | helm lint packages/vllm/chart --quiet - - - name: Lint whisper Charts - if: always() - run: | helm lint packages/whisper/chart --quiet - - - name: Lint repeater Charts - if: always() - run: | helm lint packages/repeater/chart --quiet + helm lint packages/ui/chart --quiet + helm lint packages/supabase/chart --quiet --with-subcharts packages/supabase/migrationChart --with-subcharts packages/supabase/manifests diff --git a/packages/vllm/Dockerfile b/packages/vllm/Dockerfile index 16503c65b..50a44636c 100755 --- a/packages/vllm/Dockerfile +++ b/packages/vllm/Dockerfile @@ -2,125 +2,122 @@ ARG LOCAL_VERSION FROM ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} AS sdk FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 AS builder -ARG SDK_DEST=src/leapfrogai_sdk/build - -# Set the config file defaults -ARG PYTHON_VERSION=3.11.6 -ARG HF_HUB_ENABLE_HF_TRANSFER="1" -ARG REPO_ID="TheBloke/Synthia-7B-v2.0-GPTQ" -ARG REVISION="gptq-4bit-32g-actorder_True" -ARG QUANTIZATION="gptq" -ARG MODEL_SOURCE="/data/.model/" -ARG MAX_CONTEXT_LENGTH=32768 -ARG STOP_TOKENS='["","<|endoftext|>","<|im_end|>"]' -ARG PROMPT_FORMAT_CHAT_SYSTEM="SYSTEM: {}\n" -ARG PROMPT_FORMAT_CHAT_ASSISTANT="ASSISTANT: {}\n" -ARG PROMPT_FORMAT_CHAT_USER="USER: {}\n" -ARG PROMPT_FORMAT_DEFAULTS_TOP_P=1.0 -ARG PROMPT_FORMAT_DEFAULTS_TOP_K=0 -ARG TENSOR_PARALLEL_SIZE=1 -ENV DEBIAN_FRONTEND=noninteractive +# set SDK location +# set the pyenv and Python versions +ARG SDK_DEST=src/leapfrogai_sdk/build \ + PYTHON_VERSION=3.11.6 \ + PYENV_GIT_TAG=v2.4.8 +# use root user for deps installation and nonroot user creation USER root - +# get deps for vllm compilation, pyenv, python and model downloading +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get -y install \ + git \ + make \ + build-essential \ + libssl-dev \ + zlib1g-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + wget \ + curl \ + llvm \ + libncurses5-dev \ + libncursesw5-dev \ + tk-dev \ + libffi-dev \ + liblzma-dev + +# setup nonroot user and permissions RUN groupadd -g 65532 vglusers && \ useradd -ms /bin/bash nonroot -u 65532 -g 65532 && \ usermod -a -G video,sudo nonroot - -# grab necesary python dependencies -# TODO @JPERRY: Get context as to why we are doing this for this Dockerfile but not our other ones -RUN apt-get -y update \ - && apt-get install -y software-properties-common \ - && add-apt-repository universe \ - && add-apt-repository ppa:deadsnakes/ppa \ - && apt-get -y update - -# get deps for vllm compilation, model download, and pyenv -RUN apt-get -y install git python3-venv make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev tk-dev libffi-dev - USER nonroot -WORKDIR /home/leapfrogai +# copy-in SDK from sdk stage and vllm source code from host +WORKDIR /home/leapfrogai COPY --from=sdk --chown=nonroot:nonroot /leapfrogai/${SDK_DEST} ./${SDK_DEST} COPY --chown=nonroot:nonroot packages/vllm packages/vllm -# # create virtual environment for light-weight portability and minimal libraries -RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv -ENV PYENV_ROOT="/home/leapfrogai/.pyenv" -ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" -RUN pyenv install ${PYTHON_VERSION} -RUN pyenv global ${PYTHON_VERSION} -RUN python3 -m venv .venv +# create virtual environment for light-weight portability and minimal libraries +RUN curl https://pyenv.run | bash && \ + echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \ + echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \ + echo 'eval "$(pyenv init -)"' >> ~/.bashrc && \ + echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc + +# Set environment variables +ENV PYENV_ROOT="/home/nonroot/.pyenv" \ + PATH="/home/nonroot/.pyenv/bin:$PATH" + +# Install Python 3.11.6, set it as global, and create a venv +RUN . ~/.bashrc && \ + PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11.6 && \ + pyenv global 3.11.6 && \ + pyenv exec python -m venv .venv + +# set path to venv python ENV PATH="/home/leapfrogai/.venv/bin:$PATH" -RUN rm -f packages/vllm/build/*.whl -RUN python -m pip wheel packages/vllm -w packages/vllm/build --find-links=${SDK_DEST} -RUN pip install packages/vllm/build/lfai_vllm*.whl --no-index --find-links=packages/vllm/build/ +RUN rm -f packages/vllm/build/*.whl && \ + python -m pip wheel packages/vllm -w packages/vllm/build --find-links=${SDK_DEST} && \ + pip install packages/vllm/build/lfai_vllm*.whl --no-index --find-links=packages/vllm/build/ FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 -## COPIED FROM ABOVE ## -ARG SDK_DEST=src/leapfrogai_sdk/build -# Set the config file defaults -ARG PYTHON_VERSION=3.11.6 -ARG HF_HUB_ENABLE_HF_TRANSFER="1" -ARG REPO_ID="TheBloke/Synthia-7B-v2.0-GPTQ" -ARG REVISION="gptq-4bit-32g-actorder_True" -ARG QUANTIZATION="gptq" -ARG MODEL_SOURCE="/data/.model/" -ARG MAX_CONTEXT_LENGTH=32768 -ARG STOP_TOKENS='["","<|endoftext|>","<|im_end|>"]' -ARG PROMPT_FORMAT_CHAT_SYSTEM="SYSTEM: {}\n" -ARG PROMPT_FORMAT_CHAT_ASSISTANT="ASSISTANT: {}\n" -ARG PROMPT_FORMAT_CHAT_USER="USER: {}\n" -ARG PROMPT_FORMAT_DEFAULTS_TOP_P=1.0 -ARG PROMPT_FORMAT_DEFAULTS_TOP_K=0 -ARG TENSOR_PARALLEL_SIZE=1 -ENV DEBIAN_FRONTEND=noninteractive +# set SDK location +ARG SDK_DEST=src/leapfrogai_sdk/build +# model-specific arguments +ARG TRUST_REMOTE_CODE="True" \ + MODEL_PATH="/data/.model/" \ + MAX_CONTEXT_LENGTH=32768 \ + STOP_TOKENS='[""]' \ + PROMPT_FORMAT_CHAT_SYSTEM="<|im_start|>system\n{}<|im_end|>\n" \ + PROMPT_FORMAT_CHAT_USER="<|im_start|>user\n{}<|im_end|>\n" \ + PROMPT_FORMAT_CHAT_ASSISTANT="<|im_start|>assistant\n{}<|im_end|>\n" \ + PROMPT_FORMAT_DEFAULTS_TOP_P=1.0 \ + PROMPT_FORMAT_DEFAULTS_TOP_K=0 \ + TENSOR_PARALLEL_SIZE=1 \ + QUANTIZATION="None" + +# setup nonroot user and permissions USER root - RUN groupadd -g 65532 vglusers && \ useradd -ms /bin/bash nonroot -u 65532 -g 65532 && \ usermod -a -G video,sudo nonroot - -RUN apt-get -y update -RUN apt-get -y install git wget build-essential libssl-dev zlib1g-dev libffi-dev - USER nonroot WORKDIR /home/leapfrogai +# copy-in SDK from sdk stagem model and vllm source code from builder COPY --from=sdk --chown=nonroot:nonroot /leapfrogai/${SDK_DEST} ./${SDK_DEST} COPY --from=builder --chown=nonroot:nonroot /home/leapfrogai/.venv /home/leapfrogai/.venv COPY --from=builder --chown=nonroot:nonroot /home/leapfrogai/packages/vllm/src /home/leapfrogai/packages/vllm/src +# copy-in python binaries +COPY --from=builder --chown=nonroot:nonroot /home/nonroot/.pyenv/versions/3.11.6/ /home/nonroot/.pyenv/versions/3.11.6/ + +# load ARG values into env variables for pickup by confz +ENV LAI_TRUST_REMOTE_CODE=${TRUST_REMOTE_CODE} \ + LAI_MODEL_PATH=${MODEL_PATH} \ + LAI_MAX_CONTEXT_LENGTH=${MAX_CONTEXT_LENGTH} \ + LAI_STOP_TOKENS=${STOP_TOKENS} \ + LAI_PROMPT_FORMAT_CHAT_SYSTEM=${PROMPT_FORMAT_CHAT_SYSTEM} \ + LAI_PROMPT_FORMAT_CHAT_USER=${PROMPT_FORMAT_CHAT_USER} \ + LAI_PROMPT_FORMAT_CHAT_ASSISTANT=${PROMPT_FORMAT_CHAT_ASSISTANT} \ + LAI_PROMPT_FORMAT_DEFAULTS_TOP_P=${PROMPT_FORMAT_DEFAULTS_TOP_P} \ + LAI_PROMPT_FORMAT_DEFAULTS_TOP_K=${PROMPT_FORMAT_DEFAULTS_TOP_K} \ + LAI_TENSOR_PARALLEL_SIZE=${TENSOR_PARALLEL_SIZE} \ + LAI_QUANTIZATION=${QUANTIZATION} \ + # remove vLLM callback to stats server + VLLM_NO_USAGE_STATS=1 -# # create virtual environment for light-weight portability and minimal libraries -RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv -ENV PYENV_ROOT="/home/leapfrogai/.pyenv" -ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" -RUN pyenv install ${PYTHON_VERSION} ENV PATH="/home/leapfrogai/.venv/bin:$PATH" -# download model -ENV HF_HOME=/home/leapfrogai/.cache/huggingface - -# Load ARG values into env variables for pickup by confz -ENV LAI_HF_HUB_ENABLE_HF_TRANSFER=${HF_HUB_ENABLE_HF_TRANSFER} -ENV LAI_REPO_ID=${REPO_ID} -ENV LAI_REVISION=${REVISION} -ENV LAI_QUANTIZATION=${QUANTIZATION} -ENV LAI_TENSOR_PARALLEL_SIZE=${TENSOR_PARALLEL_SIZE} -ENV LAI_MODEL_SOURCE=${MODEL_SOURCE} -ENV LAI_MAX_CONTEXT_LENGTH=${MAX_CONTEXT_LENGTH} -ENV LAI_STOP_TOKENS=${STOP_TOKENS} -ENV LAI_PROMPT_FORMAT_CHAT_SYSTEM=${PROMPT_FORMAT_CHAT_SYSTEM} -ENV LAI_PROMPT_FORMAT_CHAT_ASSISTANT=${PROMPT_FORMAT_CHAT_ASSISTANT} -ENV LAI_PROMPT_FORMAT_CHAT_USER=${PROMPT_FORMAT_CHAT_USER} -ENV LAI_PROMPT_FORMAT_DEFAULTS_TOP_P=${PROMPT_FORMAT_DEFAULTS_TOP_P} -ENV LAI_PROMPT_FORMAT_DEFAULTS_TOP_K=${PROMPT_FORMAT_DEFAULTS_TOP_K} - EXPOSE 50051 ENTRYPOINT ["python", "-m", "leapfrogai_sdk.cli", "--app-dir=packages/vllm/src/", "main:Model"] From 27ca92de5b2d2de5fe65c2f6f2c1bc95ac08a1ad Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 13:15:29 -0400 Subject: [PATCH 17/51] add and run all lints separately --- .github/workflows/helm-lint.yaml | 31 ++++++++++- .github/workflows/uds-lint.yaml | 7 ++- .github/workflows/zarf-lint.yaml | 91 +++++++++++++++++++++----------- 3 files changed, 96 insertions(+), 33 deletions(-) diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index ce02beca0..e2e1fc3c5 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -46,13 +46,42 @@ jobs: with: version: "v3.13.3" - - name: Lint Helm Charts + - name: Lint API Helm Charts + if: always() run: | helm lint packages/api/chart --quiet + + - name: Lint llama-cpp-python Helm Charts + if: always() + run: | helm lint packages/llama-cpp-python/chart --quiet + + - name: Lint text-embeddings Helm Charts + if: always() + run: | helm lint packages/text-embeddings/chart --quiet + + - name: Lint vllm Helm Charts + if: always() + run: | helm lint packages/vllm/chart --quiet + + - name: Lint whisper Helm Charts + if: always() + run: | helm lint packages/whisper/chart --quiet + + - name: Lint repeater Helm Charts + if: always() + run: | helm lint packages/repeater/chart --quiet + + - name: Lint UI Helm Charts + if: always() + run: | helm lint packages/ui/chart --quiet + + - name: Lint supabase Helm Charts + if: always() + run: | helm lint packages/supabase/chart --quiet --with-subcharts packages/supabase/migrationChart --with-subcharts packages/supabase/manifests diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml index b4e450ea1..c7d640594 100644 --- a/.github/workflows/uds-lint.yaml +++ b/.github/workflows/uds-lint.yaml @@ -41,9 +41,14 @@ jobs: - name: Download UDS Bundle Schema run: curl -o uds.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json - - name: Validate uds-bundle.yaml + - name: Validate uds-bundle.yaml (dev) + if: always() run: | check-jsonschema uds-bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json check-jsonschema uds-bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json + + - name: Validate uds-bundle.yaml (latest) + if: always() + run: | check-jsonschema uds-bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json check-jsonschema uds-bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json diff --git a/.github/workflows/zarf-lint.yaml b/.github/workflows/zarf-lint.yaml index 5b6e65a01..4c0271a12 100644 --- a/.github/workflows/zarf-lint.yaml +++ b/.github/workflows/zarf-lint.yaml @@ -3,16 +3,16 @@ name: Zarf Lint on: push: branches: - - "main" + - "main" paths: - - "**/zarf.yaml" - - ".github/workflows/zarf-lint.yaml" + - "**/zarf.yaml" + - ".github/workflows/zarf-lint.yaml" pull_request: branches: - - "main" + - "main" paths: - - "**/zarf.yaml" - - ".github/workflows/zarf-lint.yaml" + - "**/zarf.yaml" + - ".github/workflows/zarf-lint.yaml" concurrency: group: zarf-lint-${{ github.ref }} @@ -27,28 +27,57 @@ jobs: contents: read steps: - - name: Checkout Repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Set up Python - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 - with: - python-version-file: 'pyproject.toml' - - - name: Download Zarf Package Schema - # TODO: renovate setup - run: curl -o zarf.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json - - - name: Install jsonschema - run: pip install check-jsonschema==0.28.0 - - - name: Validate zarf.yaml - run: | - check-jsonschema packages/api/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/llama-cpp-python/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/repeater/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/supabase/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/text-embeddings/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/ui/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/vllm/zarf.yaml --schemafile zarf.schema.json - check-jsonschema packages/whisper/zarf.yaml --schemafile zarf.schema.json + - name: Checkout Repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up Python + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version-file: "pyproject.toml" + + - name: Download Zarf Package Schema + # TODO: renovate setup + run: curl -o zarf.schema.json https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json + + - name: Install jsonschema + run: pip install check-jsonschema==0.28.0 + + - name: Validate API zarf.yaml + if: always() + run: | + check-jsonschema packages/api/zarf.yaml --schemafile zarf.schema.json + + - name: Validate llama-cpp-python zarf.yaml + if: always() + run: | + check-jsonschema packages/llama-cpp-python/zarf.yaml --schemafile zarf.schema.json + + - name: Validate repeater zarf.yaml + if: always() + run: | + check-jsonschema packages/repeater/zarf.yaml --schemafile zarf.schema.json + + - name: Validate supabase zarf.yaml + if: always() + run: | + check-jsonschema packages/supabase/zarf.yaml --schemafile zarf.schema.json + + - name: Validate text-embeddings zarf.yaml + if: always() + run: | + check-jsonschema packages/text-embeddings/zarf.yaml --schemafile zarf.schema.json + + - name: Validate UI zarf.yaml + if: always() + run: | + check-jsonschema packages/ui/zarf.yaml --schemafile zarf.schema.json + + - name: Validate vllm zarf.yaml + if: always() + run: | + check-jsonschema packages/vllm/zarf.yaml --schemafile zarf.schema.json + + - name: Validate whisper zarf.yaml + if: always() + run: | + check-jsonschema packages/whisper/zarf.yaml --schemafile zarf.schema.json From 45aa1d3cfe366f6948e8bf118e78551a91eff9cf Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 13:18:29 -0400 Subject: [PATCH 18/51] vllm double quotes expansion --- packages/vllm/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vllm/Dockerfile b/packages/vllm/Dockerfile index 50a44636c..077ccc754 100755 --- a/packages/vllm/Dockerfile +++ b/packages/vllm/Dockerfile @@ -45,10 +45,10 @@ COPY --chown=nonroot:nonroot packages/vllm packages/vllm # create virtual environment for light-weight portability and minimal libraries RUN curl https://pyenv.run | bash && \ - echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \ - echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \ - echo 'eval "$(pyenv init -)"' >> ~/.bashrc && \ - echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc + echo "export PYENV_ROOT='$HOME/.pyenv'" >> ~/.bashrc && \ + echo "export PATH='$PYENV_ROOT/bin:$PATH'" >> ~/.bashrc && \ + echo "eval '$(pyenv init -)'" >> ~/.bashrc && \ + echo "eval '$(pyenv virtualenv-init -)'" >> ~/.bashrc # Set environment variables ENV PYENV_ROOT="/home/nonroot/.pyenv" \ From 3bc117fce8fc80deaa58306b8f93e01f9b878b33 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 14:23:37 -0400 Subject: [PATCH 19/51] minor UI fixes --- packages/ui/zarf.yaml | 2 +- src/leapfrogai_ui/Dockerfile | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 93ae95896..c85d5bfa8 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -12,7 +12,7 @@ constants: variables: - name: LEAPFROGAI_API_BASE_URL #LEAPFROGAI_API_BASE_URL description: The base URL for the LeapfrogAI API - default: http://api.leapfrogai.svc.cluster.local:8080 + default: http://leapfrogai-api.leapfrogai.svc.cluster.local:8080 prompt: true sensitive: true - name: OPENAI_API_KEY diff --git a/src/leapfrogai_ui/Dockerfile b/src/leapfrogai_ui/Dockerfile index 55796a108..2ca352e3f 100644 --- a/src/leapfrogai_ui/Dockerfile +++ b/src/leapfrogai_ui/Dockerfile @@ -10,12 +10,14 @@ ENV PATH=${JAVA_HOME}/bin:$PATH WORKDIR /app +WORKDIR /app + COPY . . +RUN npm ci + ENV NODE_ENV=production -RUN npm ci && \ - npm run build && \ - npm prune +RUN npm run build && npm prune # Disable request size limit ENV BODY_SIZE_LIMIT=Infinity \ From 619aab37de777cea184b8534b62a4b63bc2cf8c1 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 3 Sep 2024 14:30:02 -0400 Subject: [PATCH 20/51] rollback extraneous securityContext --- packages/llama-cpp-python/chart/values.yaml | 5 ----- packages/repeater/chart/values.yaml | 5 ----- packages/text-embeddings/chart/values.yaml | 5 ----- packages/vllm/chart/values.yaml | 5 ----- packages/whisper/chart/values.yaml | 5 ----- 5 files changed, 25 deletions(-) diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index 9c4b25fc7..75606d349 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -18,16 +18,11 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: - runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL service: type: ClusterIP diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index f7696243c..c9189e8e0 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -18,16 +18,11 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: - runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL service: type: ClusterIP diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 5c24dabdb..ecd0b0d8e 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -18,16 +18,11 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: - runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL service: type: ClusterIP diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index cceb8b70b..462275342 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -18,16 +18,11 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: - runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL service: type: ClusterIP diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index 4f10821f7..6d93381cc 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -18,16 +18,11 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: - runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL service: type: ClusterIP From bd7e7baea30e478bfc1f8f1ec218a2dd8f36e6c9 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 10:54:54 -0400 Subject: [PATCH 21/51] minor migrations and UI fixes --- Dockerfile.migrations | 4 +- packages/llama-cpp-python/chart/values.yaml | 5 ++ packages/repeater/chart/values.yaml | 5 ++ packages/text-embeddings/chart/values.yaml | 5 ++ .../ui/chart/templates/ui/migration-job.yaml | 6 +-- packages/ui/chart/ui-values.yaml | 23 --------- packages/ui/chart/values.yaml | 47 +++++++++++++++++++ packages/ui/values/upstream-values.yaml | 20 ++++++++ packages/ui/zarf.yaml | 16 +++---- packages/vllm/chart/values.yaml | 5 ++ .../whisper/chart/templates/deployment.yaml | 3 +- packages/whisper/chart/values.yaml | 13 ++--- 12 files changed, 109 insertions(+), 43 deletions(-) delete mode 100644 packages/ui/chart/ui-values.yaml create mode 100644 packages/ui/chart/values.yaml create mode 100644 packages/ui/values/upstream-values.yaml diff --git a/Dockerfile.migrations b/Dockerfile.migrations index a4ee62405..8c415db66 100644 --- a/Dockerfile.migrations +++ b/Dockerfile.migrations @@ -1,7 +1,7 @@ FROM cgr.dev/chainguard/bash:latest ARG TARGETPLATFORM \ - version="1.169.8" \ + SUPABASE_CLI_VERSION="1.169.8" \ MIGRATIONS_DIR RUN test -n "$MIGRATIONS_DIR" || (echo "MIGRATIONS_DIR is required" && false) @@ -9,7 +9,7 @@ RUN test -n "$MIGRATIONS_DIR" || (echo "MIGRATIONS_DIR is required" && false) # Download the supabase cli RUN mkdir -p /usr/local/bin && \ ARCH=$(echo $TARGETPLATFORM | cut -d "/" -f2) && \ - curl -LO https://github.com/supabase/cli/releases/download/v${version}/supabase_linux_${ARCH}.tar.gz && \ + curl -LO https://github.com/supabase/cli/releases/download/v${SUPABASE_CLI_VERSION}/supabase_linux_${ARCH}.tar.gz && \ tar -xzf supabase_linux_${ARCH}.tar.gz -C /usr/local/bin/ && \ rm supabase_linux_${ARCH}.tar.gz diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index 75606d349..9c4b25fc7 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -18,11 +18,16 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: + runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index c9189e8e0..f7696243c 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -18,11 +18,16 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: + runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index ecd0b0d8e..70c1d3098 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -18,11 +18,16 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: + runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP diff --git a/packages/ui/chart/templates/ui/migration-job.yaml b/packages/ui/chart/templates/ui/migration-job.yaml index e908d0125..c5904863a 100644 --- a/packages/ui/chart/templates/ui/migration-job.yaml +++ b/packages/ui/chart/templates/ui/migration-job.yaml @@ -29,9 +29,9 @@ spec: supabase migration fetch --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --debug || true && supabase db push --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --include-all --debug securityContext: - runAsUser: {{ .Values.image.securityContext.runAsUser }} - runAsGroup: {{ .Values.image.securityContext.runAsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + runAsGroup: {{ .Values.securityContext.runAsGroup }} securityContext: - fsGroup: {{ .Values.image.securityContext.fsGroup }} + fsGroup: {{ .Values.securityContext.fsGroup }} restartPolicy: Never backoffLimit: 4 diff --git a/packages/ui/chart/ui-values.yaml b/packages/ui/chart/ui-values.yaml deleted file mode 100644 index ab3d95103..000000000 --- a/packages/ui/chart/ui-values.yaml +++ /dev/null @@ -1,23 +0,0 @@ -image: - repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui" - pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: '###ZARF_CONST_IMAGE_VERSION###' - - securityContext: - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 - -package: - name: leapfrogai-ui - subdomain: '###ZARF_VAR_SUBDOMAIN###' - domain: '###ZARF_VAR_DOMAIN###' - supabase_url: 'https://supabase-kong.###ZARF_VAR_DOMAIN###' - supabase_anon_key: '###ZARF_VAR_SUPABASE_ANON_KEY###' - message_length_limit: '###ZARF_VAR_MESSAGE_LENGTH_LIMIT###' - -migration: - namespace: "leapfrogai" - serviceName: "supabase-postgresql" - servicePort: "5432" diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml new file mode 100644 index 000000000..81da8b35d --- /dev/null +++ b/packages/ui/chart/values.yaml @@ -0,0 +1,47 @@ +image: + repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui" + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "###ZARF_CONST_IMAGE_VERSION###" + +podSecurityContext: + runAsNonRoot: true + fsGroup: 65532 + +securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL + +package: + subdomain: "###ZARF_VAR_SUBDOMAIN###" + domain: "###ZARF_VAR_DOMAIN###" + supabaseUrl: "https://supabase-kong.###ZARF_VAR_DOMAIN###" + supabaseAnonKey: "###ZARF_VAR_SUPABASE_ANON_KEY###" + messageLengthLimit: "###ZARF_VAR_MESSAGE_LENGTH_LIMIT###" + publicDisableKeyCloak: "###ZARF_VAR_DISABLE_KEYCLOAK###" + leapfrogaiApiBaseUrl: "###ZARF_VAR_LEAPFROGAI_API_BASE_URL###" + defaultModel: "###ZARF_VAR_MODEL###" + defaultSystemPrompt: "###ZARF_VAR_SYSTEM_PROMPT###" + defaultTemperature: "###ZARF_VAR_TEMPERATURE###" + openaiApiKey: "###ZARF_VAR_OPENAI_API_KEY###" + +migration: + namespace: "leapfrogai" + serviceName: "supabase-postgresql" + servicePort: "5432" + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after "resources:". + limits: + cpu: 0 + memory: 0 + requests: + cpu: 0 + memory: 0 diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml new file mode 100644 index 000000000..06465d42f --- /dev/null +++ b/packages/ui/values/upstream-values.yaml @@ -0,0 +1,20 @@ +image: + repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui + tag: ###ZARF_CONST_IMAGE_VERSION### + +securityContext: + runAsUser: 65532 + runAsGroup: 65532 + +package: + name: leapfrogai-ui + subdomain: "###ZARF_VAR_SUBDOMAIN###" + domain: "###ZARF_VAR_DOMAIN###" + supabase_url: https://supabase-kong.###ZARF_VAR_DOMAIN### + supabase_anon_key: "###ZARF_VAR_SUPABASE_ANON_KEY###" + message_length_limit: "###ZARF_VAR_MESSAGE_LENGTH_LIMIT###" + +migration: + namespace: leapfrogai + serviceName: supabase-postgresql + servicePort: 5432 diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index c43a35ed3..ed5679d00 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -1,13 +1,13 @@ kind: ZarfPackageConfig metadata: name: leapfrogai-ui - version: '###ZARF_PKG_TMPL_IMAGE_VERSION###' + version: "###ZARF_PKG_TMPL_IMAGE_VERSION###" description: > A UI for LeapfrogAI constants: - name: IMAGE_VERSION - value: '###ZARF_PKG_TMPL_IMAGE_VERSION###' + value: "###ZARF_PKG_TMPL_IMAGE_VERSION###" variables: - name: LEAPFROGAI_API_BASE_URL #LEAPFROGAI_API_BASE_URL @@ -35,27 +35,27 @@ variables: sensitive: false - name: SYSTEM_PROMPT description: The default system prompt to use for the LLM - default: 'You may be provided with a list of files and their content in the following structure: [{"filename": "test.pdf","text": "some fake text"}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response.' + default: "You are a helpful AI assistant created by Defense Unicorns." prompt: true sensitive: false - name: TEMPERATURE description: The default temperature for the LLM - default: '0.1' + default: "0.1" prompt: true sensitive: false - name: SUPABASE_ANON_KEY - default: '' + default: "" description: Public key for Supabase prompt: true sensitive: false - name: DISABLE_KEYCLOAK description: Disable keycloak true or false - default: 'true' + default: "true" prompt: true sensitive: false - name: MESSAGE_LENGTH_LIMIT description: The maximum length of a message to allow from the user to the backend - default: '10000' + default: "10000" prompt: true sensitive: false @@ -69,7 +69,7 @@ components: namespace: leapfrogai localPath: chart valuesFiles: - - 'chart/ui-values.yaml' + - "values/upstream-values.yaml" # x-release-please-start-version version: 0.11.0 # x-release-please-end diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index 462275342..cceb8b70b 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -18,11 +18,16 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: + runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 196f2c4f3..64d2ac9bb 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -47,7 +47,8 @@ spec: resources: {{- toYaml .Values.modelInjectionContainer.resources | nindent 12 }} volumeMounts: - {{- toYaml .Values.modelInjectionContainer.volumeMounts | nindent 12 }} + - name: leapfrogai-pv-storage + mountPath: "/data" volumes: - name: leapfrogai-pv-storage persistentVolumeClaim: diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index 6d93381cc..747d9bc02 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -18,11 +18,16 @@ fullnameOverride: "" podAnnotations: {} podSecurityContext: + runAsNonRoot: true fsGroup: 65532 securityContext: runAsUser: 65532 runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL service: type: ClusterIP @@ -63,8 +68,8 @@ gpu: modelInjectionContainer: securityContext: - runAsUser: 65532 - runAsGroup: 65532 + runAsUser: 65532 + runAsGroup: 65532 resources: limits: @@ -73,7 +78,3 @@ modelInjectionContainer: requests: memory: "64Mi" cpu: "200m" - - volumeMounts: - - name: leapfrogai-pv-storage - mountPath: /data From 0723794f287ce71f2e66d125b163b5085689bded Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 15:27:20 -0400 Subject: [PATCH 22/51] many values and manifest fixes --- .github/workflows/helm-lint.yaml | 5 +- docs/DEVELOPMENT.md | 33 ++++++ .../api/chart/templates/api/deployment.yaml | 60 +++++----- packages/api/chart/templates/api/service.yaml | 4 +- .../api/chart/templates/migration-job.yaml | 10 +- packages/api/chart/templates/uds-package.yaml | 4 +- packages/api/chart/values.yaml | 72 ++++++++++-- .../chart/templates/deployment.yaml | 10 +- packages/llama-cpp-python/chart/values.yaml | 19 ++-- packages/llama-cpp-python/main.py | 6 +- .../repeater/chart/templates/deployment.yaml | 8 +- packages/repeater/chart/values.yaml | 17 ++- .../chart/templates/deployment.yaml | 10 +- packages/text-embeddings/chart/values.yaml | 19 ++-- packages/ui/chart/Chart.yaml | 6 +- packages/ui/chart/templates/_helpers.tpl | 63 +++++++++++ packages/ui/chart/templates/namespace.yaml | 4 +- packages/ui/chart/templates/uds-package.yaml | 14 ++- .../ui/chart/templates/ui/deployment.yaml | 87 +++++++------- .../ui/chart/templates/ui/migration-job.yaml | 49 ++++---- packages/ui/chart/templates/ui/service.yaml | 21 ++-- packages/ui/chart/values.yaml | 106 ++++++++++++++---- packages/ui/values/upstream-values.yaml | 49 +++++--- packages/ui/zarf.yaml | 4 +- packages/vllm/Dockerfile | 4 +- packages/vllm/chart/templates/deployment.yaml | 10 +- packages/vllm/chart/values.yaml | 19 ++-- .../whisper/chart/templates/deployment.yaml | 10 +- packages/whisper/chart/values.yaml | 15 ++- 29 files changed, 477 insertions(+), 261 deletions(-) create mode 100644 packages/ui/chart/templates/_helpers.tpl diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index e2e1fc3c5..7e6d6e2e1 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -81,7 +81,4 @@ jobs: run: | helm lint packages/ui/chart --quiet - - name: Lint supabase Helm Charts - if: always() - run: | - helm lint packages/supabase/chart --quiet --with-subcharts packages/supabase/migrationChart --with-subcharts packages/supabase/manifests + # TODO: we will not be linting or refactoring Supabase charts until GitHub issue #968 is resolved and a path forward is provided diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index a75275760..9e2500873 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -143,6 +143,39 @@ uds zarf package deploy zarf-package-*.tar.zst --confirm uds deploy --confirm ``` +### Bundle Overrides + +Although not provided in the example UDS bundle manifests found in this repository's `bundles/`, the `uds-bundle.yaml` and `uds-config.yaml` can be modified to override values files of a component's deployment. For example, when using UDS CLI to deploy the `bundles/latest/gpu/uds-bundle.yaml` you can add the following lines to the following files to influence a value that is not accessible by any other means (e.g., setting a Zarf variable): + +#### _uds-bundle.yaml_ + +```yaml + # OpenAI-like API + - name: leapfrogai-api + repository: ghcr.io/defenseunicorns/packages/leapfrogai/leapfrogai-api + # x-release-please-start-version + ref: 0.11.0 + # x-release-please-end + + # THE BELOW LINES WERE ADDED FOR DEMONSTRATION PURPOSES + overrides: + leapfrogai-api: + leapfrogai: + variables: + name: API_REPLICAS + description: "Default number of API replicas to deploy" + path: api.replicas # the path to the value you want to override in packages/api/chart/values.yaml +``` + +#### _uds-config.yaml_ + +```yaml +variables: + # THE BELOW LINES WERE ADDED FOR DEMONSTRATION PURPOSES + leapfrogai-api: + api_replicas: 2 # overriding the default value of 1 in the packages/api/chart/values.yaml +``` + ### MacOS Specifics To run the same commands in MacOS, you will need to prepend your command with a couple of env vars like so: diff --git a/packages/api/chart/templates/api/deployment.yaml b/packages/api/chart/templates/api/deployment.yaml index 64e7dbccf..d83195e91 100644 --- a/packages/api/chart/templates/api/deployment.yaml +++ b/packages/api/chart/templates/api/deployment.yaml @@ -6,16 +6,20 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - replicas: {{ .Values.api.replicas }} + replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate + {{- toYaml . | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "chart.selectorLabels" . | nindent 6 }} template: metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} labels: {{- include "chart.selectorLabels" . | nindent 8 }} spec: @@ -30,50 +34,26 @@ spec: - name: api-model mountPath: /config/ env: - - name: LABEL - value: "leapfrogai" - - name: FOLDER - value: /config/ - - name: RESOURCE - value: both - - name: UNIQUE_FILENAMES - value: "true" - - name: NAMESPACE - value: leapfrogai + {{- toYaml .Values.kiwigrid.env | nindent 12 }} securityContext: {{- toYaml .Values.kiwigrid.securityContext | nindent 12 }} - - name: api-container + - name: {{ include "chart.fullname" . }}-container image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.api.image.imagePullPolicy }} env: - - name: LFAI_CONFIG_PATH - value: /config/ - - name: LFAI_CONFIG_FILENAME - value: "*.toml" - - name: DEFAULT_EMBEDDINGS_MODEL - value: "{{ .Values.api.env.defaultEmbeddingsModel }}" - - name: PORT - value: "{{ .Values.api.port }}" - - name: SUPABASE_URL - value: "{{ .Values.supabase.env.url }}" - - name: SUPABASE_ANON_KEY - valueFrom: - secretKeyRef: - name: supabase-bootstrap-jwt - key: anon-key - optional: true + {{- toYaml .Values.api.env | nindent 12 }} ports: - - containerPort: {{ .Values.api.port }} + - containerPort: {{ .Values.api.service.port }} livenessProbe: httpGet: path: /healthz - port: {{ .Values.api.port }} + port: {{ .Values.api.service.port }} initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: httpGet: path: /healthz - port: {{ .Values.api.port }} + port: {{ .Values.api.service.port }} initialDelaySeconds: 10 periodSeconds: 10 securityContext: @@ -84,3 +64,15 @@ spec: volumes: - name: api-model emptyDir: {} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/packages/api/chart/templates/api/service.yaml b/packages/api/chart/templates/api/service.yaml index 33ea860f6..3380507e2 100644 --- a/packages/api/chart/templates/api/service.yaml +++ b/packages/api/chart/templates/api/service.yaml @@ -15,6 +15,6 @@ spec: ports: - name: http protocol: TCP - port: {{ .Values.api.port }} - targetPort: {{ .Values.api.port }} + port: {{ .Values.api.service.port }} + targetPort: {{ .Values.api.service.port }} type: ClusterIP diff --git a/packages/api/chart/templates/migration-job.yaml b/packages/api/chart/templates/migration-job.yaml index 6b511d7f5..faec6bc56 100644 --- a/packages/api/chart/templates/migration-job.yaml +++ b/packages/api/chart/templates/migration-job.yaml @@ -17,17 +17,9 @@ spec: - name: supabase-cli image: "{{ .Values.api.migration.image.repository }}:{{ .Values.api.migration.image.tag | default .Chart.AppVersion }}" env: - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: supabase-postgresql - key: postgres-password + {{- toYaml .Values.api.migration.env | nindent 12 }} - name: MIGRATION_NAMESPACE value: "{{ .Release.Namespace }}" - - name: MIGRATION_SERVICE_NAME - value: "{{ .Values.api.migration.env.serviceName }}" - - name: MIGRATION_SERVICE_PORT - value: "{{ .Values.api.migration.env.servicePort }}" command: ["/bin/sh"] args: - -c diff --git a/packages/api/chart/templates/uds-package.yaml b/packages/api/chart/templates/uds-package.yaml index e10dccc89..69d18bbc7 100644 --- a/packages/api/chart/templates/uds-package.yaml +++ b/packages/api/chart/templates/uds-package.yaml @@ -1,4 +1,4 @@ -{{- if .Values.api.env.exposeAPI }} +{{- if .Values.api.expose }} apiVersion: uds.dev/v1alpha1 kind: Package metadata: @@ -14,7 +14,7 @@ spec: {{- include "chart.selectorLabels" . | nindent 10 }} host: {{ include "chart.fullname" . }} gateway: tenant - port: {{ .Values.api.port }} + port: {{ .Values.api.service.port }} allow: - direction: Ingress diff --git a/packages/api/chart/values.yaml b/packages/api/chart/values.yaml index 8e1e5ac20..623d9c1a1 100644 --- a/packages/api/chart/values.yaml +++ b/packages/api/chart/values.yaml @@ -2,7 +2,24 @@ podSecurityContext: runAsNonRoot: true fsGroup: 65532 +replicaCount: 1 + +podAnnotations: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + api: + expose: true + image: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api # x-release-please-start-version @@ -10,8 +27,6 @@ api: # x-release-please-end imagePullPolicy: Always - replicas: 1 - securityContext: runAsUser: 65532 runAsGroup: 65532 @@ -20,11 +35,28 @@ api: drop: - ALL - port: 8080 - env: - exposeAPI: "true" - defaultEmbeddingsModel: "text-embeddings" + - name: LFAI_LOG_LEVEL + value: "20" # equivalent to logging.INFO + - name: LFAI_CONFIG_PATH + value: /config/ + - name: LFAI_CONFIG_FILENAME + value: "*.toml" + - name: DEFAULT_EMBEDDINGS_MODEL + value: "text-embeddings" + - name: PORT + value: "8080" + - name: SUPABASE_URL + value: "http://supabase-kong.leapfrogai.svc.cluster.local:80" + - name: SUPABASE_ANON_KEY + valueFrom: + secretKeyRef: + name: supabase-bootstrap-jwt + key: anon-key + optional: true + + service: + port: 8080 serviceAccount: name: leapfrogai-api @@ -37,6 +69,7 @@ api: tag: 0.11.0 # x-release-please-end imagePullPolicy: Always + securityContext: runAsUser: 65532 runAsGroup: 65532 @@ -46,12 +79,15 @@ api: - ALL env: - serviceName: "supabase-postgresql" - servicePort: 5432 - -supabase: - env: - url: "http://supabase-kong.leapfrogai.svc.cluster.local:80" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: supabase-postgresql + key: postgres-password + - name: MIGRATION_SERVICE_NAME + value: "supabase-postgresql" + - name: MIGRATION_SERVICE_PORT + value: "5432" kiwigrid: image: @@ -66,3 +102,15 @@ kiwigrid: capabilities: drop: - ALL + + env: + - name: LABEL + value: "leapfrogai" + - name: FOLDER + value: /config/ + - name: RESOURCE + value: both + - name: UNIQUE_FILENAMES + value: "true" + - name: NAMESPACE + value: leapfrogai diff --git a/packages/llama-cpp-python/chart/templates/deployment.yaml b/packages/llama-cpp-python/chart/templates/deployment.yaml index d2fef3ebd..7fcf732af 100644 --- a/packages/llama-cpp-python/chart/templates/deployment.yaml +++ b/packages/llama-cpp-python/chart/templates/deployment.yaml @@ -6,12 +6,10 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: @@ -55,6 +53,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- toYaml .Values.env | nindent 12 }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index 9c4b25fc7..605694964 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python pullPolicy: Always @@ -15,7 +13,9 @@ image: nameOverride: llama-cpp-python fullnameOverride: "" -podAnnotations: {} +env: + - name: LFAI_LOG_LEVEL + value: "20" # equivalent to logging.INFO podSecurityContext: runAsNonRoot: true @@ -47,11 +47,9 @@ resources: memory: 0 nvidia.com/gpu: 0 -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 +replicaCount: 1 + +podAnnotations: {} nodeSelector: {} @@ -59,6 +57,11 @@ tolerations: [] affinity: {} +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + persistence: size: 15Gi accessModes: ReadWriteOnce diff --git a/packages/llama-cpp-python/main.py b/packages/llama-cpp-python/main.py index dd5d52f02..61951074c 100644 --- a/packages/llama-cpp-python/main.py +++ b/packages/llama-cpp-python/main.py @@ -7,10 +7,6 @@ from leapfrogai_sdk import BackendConfig from leapfrogai_sdk.llm import LLM, GenerationConfig -GPU_ENABLED = ( - False if os.environ.get("GPU_ENABLED", "False").lower() != "true" else True -) - logging.basicConfig( level=os.getenv("LFAI_LOG_LEVEL", logging.INFO), format="%(name)s: %(asctime)s | %(levelname)s | %(filename)s:%(lineno)s >>> %(message)s", @@ -28,7 +24,7 @@ class Model: llm = Llama( model_path=backend_config.model.source, n_ctx=backend_config.max_context_length, - n_gpu_layers=-1 if GPU_ENABLED is True else 0, + n_gpu_layers=0, ) async def generate( diff --git a/packages/repeater/chart/templates/deployment.yaml b/packages/repeater/chart/templates/deployment.yaml index 1c51aae0b..60f11dabb 100644 --- a/packages/repeater/chart/templates/deployment.yaml +++ b/packages/repeater/chart/templates/deployment.yaml @@ -6,12 +6,10 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index f7696243c..d1312da1b 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: ghcr.io/defenseunicorns/leapfrogai/repeater pullPolicy: Always @@ -15,8 +13,6 @@ image: nameOverride: repeater fullnameOverride: "" -podAnnotations: {} - podSecurityContext: runAsNonRoot: true fsGroup: 65532 @@ -47,11 +43,9 @@ resources: memory: 0 nvidia.com/gpu: 0 -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 +replicaCount: 1 + +podAnnotations: {} nodeSelector: {} @@ -59,6 +53,11 @@ tolerations: [] affinity: {} +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + persistence: size: 15Gi accessModes: ReadWriteOnce diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 1bb376b42..5762925dd 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -6,12 +6,10 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: @@ -60,6 +58,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- toYaml .Values.env | nindent 12 }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 70c1d3098..0e6bfb843 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings pullPolicy: Always @@ -15,7 +13,9 @@ image: nameOverride: text-embeddings fullnameOverride: "" -podAnnotations: {} +env: + - name: LFAI_LOG_LEVEL + value: "20" # equivalent to logging.INFO podSecurityContext: runAsNonRoot: true @@ -46,11 +46,9 @@ resources: cpu: 0 memory: 0 -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 +replicaCount: 1 + +podAnnotations: {} nodeSelector: {} @@ -58,6 +56,11 @@ tolerations: [] affinity: {} +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + persistence: size: 15Gi accessModes: ReadWriteOnce diff --git a/packages/ui/chart/Chart.yaml b/packages/ui/chart/Chart.yaml index 544e9b174..ceb0d5236 100644 --- a/packages/ui/chart/Chart.yaml +++ b/packages/ui/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: leapfrogai-ui -description: UI to interact with LFAI tools +description: "A Svelte UI to interact with the LeapfrogAI stack" # A chart can be either an 'application' or a 'library' chart. # @@ -23,4 +23,6 @@ version: 0.11.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.1.8" +# x-release-please-start-version +appVersion: 0.11.0 +# x-release-please-end diff --git a/packages/ui/chart/templates/_helpers.tpl b/packages/ui/chart/templates/_helpers.tpl new file mode 100644 index 000000000..f16219e25 --- /dev/null +++ b/packages/ui/chart/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "chart.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "chart.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "chart.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "chart.labels" -}} +helm.sh/chart: {{ include "chart.chart" . }} +{{ include "chart.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} +app: {{ include "chart.fullname" . }} + +{{/* +Selector labels +*/}} +{{- define "chart.selectorLabels" -}} +app.kubernetes.io/name: {{ include "chart.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "chart.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "chart.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/packages/ui/chart/templates/namespace.yaml b/packages/ui/chart/templates/namespace.yaml index 0172d6405..8044650e6 100644 --- a/packages/ui/chart/templates/namespace.yaml +++ b/packages/ui/chart/templates/namespace.yaml @@ -1,4 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - name: leapfrogai + name: {{ .Release.Namespace | default "leapfrogai" }} + labels: + {{- include "chart.labels" . | nindent 4 }} diff --git a/packages/ui/chart/templates/uds-package.yaml b/packages/ui/chart/templates/uds-package.yaml index cb475570b..d6721404e 100644 --- a/packages/ui/chart/templates/uds-package.yaml +++ b/packages/ui/chart/templates/uds-package.yaml @@ -1,17 +1,19 @@ apiVersion: uds.dev/v1alpha1 kind: Package metadata: - name: {{ .Values.package.name }} + name: {{ include "chart.fullname" . }} namespace: {{ .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} spec: network: expose: - - service: {{ .Values.package.name }} + - service: {{ include "chart.fullname" . }} podLabels: - app: {{ .Values.package.name }} - host: {{ .Values.package.subdomain }} + {{- include "chart.selectorLabels" . | nindent 10 }} + host: {{ include "chart.fullname" . }} gateway: tenant - port: 3000 + port: {{ .Values.port }} allow: - direction: Ingress @@ -22,5 +24,5 @@ spec: - direction: Egress podLabels: - app: {{ .Values.package.name }} + {{- include "chart.selectorLabels" . | nindent 10 }} remoteGenerated: Anywhere diff --git a/packages/ui/chart/templates/ui/deployment.yaml b/packages/ui/chart/templates/ui/deployment.yaml index 8015d2345..49b06915c 100644 --- a/packages/ui/chart/templates/ui/deployment.yaml +++ b/packages/ui/chart/templates/ui/deployment.yaml @@ -1,42 +1,40 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Values.package.name }} - namespace: leapfrogai + name: {{ include "chart.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} spec: + replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} + {{- end }} selector: matchLabels: - app: {{ .Values.package.name }} - replicas: 1 + {{- include "chart.selectorLabels" . | nindent 6 }} template: metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} labels: - app: {{ .Values.package.name }} + {{- include "chart.selectorLabels" . | nindent 8 }} spec: + serviceAccountName: {{ include "chart.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Values.package.name }} + - name: {{ include "chart.fullname" . }}-container image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: 3000 + imagePullPolicy: {{ .Values.image.imagePullPolicy }} env: - - name: LEAPFROGAI_API_BASE_URL - value: '###ZARF_VAR_LEAPFROGAI_API_BASE_URL###' - - name: ORIGIN - value: "https://{{ .Values.package.subdomain }}.{{ .Values.package.domain }}" - - name: DEFAULT_MODEL - value: '###ZARF_VAR_MODEL###' - - name: DEFAULT_SYSTEM_PROMPT - value: '###ZARF_VAR_SYSTEM_PROMPT###' - - name: DEFAULT_TEMPERATURE - value: '###ZARF_VAR_TEMPERATURE###' - - name: OPENAI_API_KEY - value: '###ZARF_VAR_OPENAI_API_KEY###' - - name: PUBLIC_SUPABASE_URL - value: {{ .Values.package.supabase_url }} + {{- toYaml .Values.env | nindent 12 }} - name: PUBLIC_SUPABASE_ANON_KEY - {{ if .Values.package.supabase_anon_key }} - value: {{ .Values.package.supabase_anon_key }} + {{ if .Values.extraEnv.supabaseAnonKey }} + value: {{ .Values.extraEnv.supabaseAnonKey }} {{ else }} valueFrom: secretKeyRef: @@ -44,26 +42,19 @@ spec: key: anon-key optional: true {{ end }} - - name: PUBLIC_DISABLE_KEYCLOAK - value: '###ZARF_VAR_DISABLE_KEYCLOAK###' - - name: PUBLIC_MESSAGE_LENGTH_LIMIT - value: '###ZARF_VAR_MESSAGE_LENGTH_LIMIT###' - - name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL - value: "https://sso.{{ .Values.package.domain }}/realms/uds" - - name: SUPABASE_AUTH_KEYCLOAK_CLIENT_ID - valueFrom: - secretKeyRef: - name: sso-client-uds-supabase - key: clientId - - name: SUPABASE_AUTH_KEYCLOAK_SECRET - valueFrom: - secretKeyRef: - name: sso-client-uds-supabase - key: secret - resources: - requests: - memory: '0' - cpu: '0' - limits: - memory: '0' - cpu: '0' + ports: + - containerPort: {{ .Values.service.port }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/packages/ui/chart/templates/ui/migration-job.yaml b/packages/ui/chart/templates/ui/migration-job.yaml index c5904863a..40334f725 100644 --- a/packages/ui/chart/templates/ui/migration-job.yaml +++ b/packages/ui/chart/templates/ui/migration-job.yaml @@ -1,37 +1,32 @@ apiVersion: batch/v1 kind: Job metadata: - name: ui-migrations-{{ .Values.image.tag }} + name: {{ include "chart.fullname" . }}-migrations-{{ .Values.migration.image.tag | default .Chart.AppVersion }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} spec: template: + metadata: + labels: + {{- include "chart.selectorLabels" . | nindent 8 }} spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: supabase-cli - image: "ghcr.io/defenseunicorns/leapfrogai/ui-migrations:{{ .Values.image.tag }}" - env: - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: supabase-postgresql - key: postgres-password + - name: supabase-cli + image: "{{ .Values.migration.image.repository }}:{{ .Values.migration.image.tag | default .Chart.AppVersion }}" + env: + {{- toYaml .Values.migration.env | nindent 12 }} - name: MIGRATION_NAMESPACE - value: "{{ .Values.migration.namespace }}" - - name: MIGRATION_SERVICE_NAME - value: "{{ .Values.migration.serviceName }}" - - name: MIGRATION_SERVICE_PORT - value: "{{ .Values.migration.servicePort }}" - - # NOTE: This command is assuming the default username. - command: ["/bin/sh"] - args: - - -c - - >- - supabase migration fetch --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --debug || true && - supabase db push --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --include-all --debug - securityContext: - runAsUser: {{ .Values.securityContext.runAsUser }} - runAsGroup: {{ .Values.securityContext.runAsGroup }} - securityContext: - fsGroup: {{ .Values.securityContext.fsGroup }} + value: "{{ .Release.Namespace }}" + command: ["/bin/sh"] + args: + - -c + - >- + supabase migration fetch --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --debug || true && + supabase db push --db-url="postgresql://postgres:$POSTGRES_PASSWORD@$MIGRATION_SERVICE_NAME.$MIGRATION_NAMESPACE.svc.cluster.local:$MIGRATION_SERVICE_PORT/postgres" --include-all --debug + securityContext: + {{- toYaml .Values.migration.securityContext | nindent 12 }} restartPolicy: Never backoffLimit: 4 diff --git a/packages/ui/chart/templates/ui/service.yaml b/packages/ui/chart/templates/ui/service.yaml index a0c8c93b1..8f4d17207 100644 --- a/packages/ui/chart/templates/ui/service.yaml +++ b/packages/ui/chart/templates/ui/service.yaml @@ -1,19 +1,20 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.package.name }} - namespace: leapfrogai - labels: - app: {{ .Values.package.name }} - service: {{ .Values.package.name }} - zarf.dev/connect-name: {{ .Values.package.name }} + name: {{ include "chart.fullname" . }} + namespace: {{ .Release.Namespace }} annotations: - zarf.dev/connect-description: 'The LeapfrogAI UI' + zarf.dev/connect-description: "Load the LeapfrogAI UI" + zarf.dev/connect-url: "/chat" + labels: + {{- include "chart.labels" . | nindent 4 }} + zarf.dev/connect-name: {{ include "chart.fullname" . }} spec: selector: - app: {{ .Values.package.name }} + {{- include "chart.selectorLabels" . | nindent 4 }} ports: - name: http - port: 3000 - targetPort: 3000 protocol: TCP + port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + type: ClusterIP diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml index 81da8b35d..fbbf8f9f6 100644 --- a/packages/ui/chart/values.yaml +++ b/packages/ui/chart/values.yaml @@ -1,8 +1,16 @@ image: repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui" pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: "###ZARF_CONST_IMAGE_VERSION###" + # x-release-please-start-version + tag: 0.11.0 + # x-release-please-end + +service: + port: 3000 + +serviceAccount: + name: leapfrogai-ui + create: true podSecurityContext: runAsNonRoot: true @@ -14,25 +22,70 @@ securityContext: runAsNonRoot: true capabilities: drop: - - ALL - -package: - subdomain: "###ZARF_VAR_SUBDOMAIN###" - domain: "###ZARF_VAR_DOMAIN###" - supabaseUrl: "https://supabase-kong.###ZARF_VAR_DOMAIN###" - supabaseAnonKey: "###ZARF_VAR_SUPABASE_ANON_KEY###" - messageLengthLimit: "###ZARF_VAR_MESSAGE_LENGTH_LIMIT###" - publicDisableKeyCloak: "###ZARF_VAR_DISABLE_KEYCLOAK###" - leapfrogaiApiBaseUrl: "###ZARF_VAR_LEAPFROGAI_API_BASE_URL###" - defaultModel: "###ZARF_VAR_MODEL###" - defaultSystemPrompt: "###ZARF_VAR_SYSTEM_PROMPT###" - defaultTemperature: "###ZARF_VAR_TEMPERATURE###" - openaiApiKey: "###ZARF_VAR_OPENAI_API_KEY###" + - ALL + +env: + - name: LEAPFROGAI_API_BASE_URL + value: "ai" + - name: ORIGIN + value: "https://ai.uds.dev" + - name: DEFAULT_MODEL + value: "llama-cpp-python" + - name: DEFAULT_SYSTEM_PROMPT + value: 'You may be provided with a list of files and their content in the following structure: [{"filename": "test.pdf","text": "some fake text"}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response.' + - name: DEFAULT_TEMPERATURE + value: "0.1" + - name: OPENAI_API_KEY + value: "" + - name: PUBLIC_SUPABASE_URL + value: "https://supabase-kong.uds.dev" + - name: PUBLIC_DISABLE_KEYCLOAK + value: "true" + - name: PUBLIC_MESSAGE_LENGTH_LIMIT + value: "10000" + - name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL + value: "https://sso.uds.dev/realms/uds" + - name: SUPABASE_AUTH_KEYCLOAK_CLIENT_ID + valueFrom: + secretKeyRef: + name: sso-client-uds-supabase + key: clientId + - name: SUPABASE_AUTH_KEYCLOAK_SECRET + valueFrom: + secretKeyRef: + name: sso-client-uds-supabase + key: secret + +# Only required when Supabase is hosted via PaaS outside of the cluster +extraEnv: + supabaseAnonKey: "" migration: - namespace: "leapfrogai" - serviceName: "supabase-postgresql" - servicePort: "5432" + image: + repository: ghcr.io/defenseunicorns/leapfrogai/ui-migrations + # x-release-please-start-version + tag: 0.11.0 + # x-release-please-end + imagePullPolicy: Always + + env: + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: supabase-postgresql + key: postgres-password + - name: MIGRATION_SERVICE_NAME + value: "supabase-postgresql" + - name: MIGRATION_SERVICE_PORT + value: "5432" + + securityContext: + runAsUser: 65532 + runAsGroup: 65532 + runAsNonRoot: true + capabilities: + drop: + - ALL resources: # We usually recommend not to specify default resources and to leave this as a conscious @@ -45,3 +98,18 @@ resources: requests: cpu: 0 memory: 0 + +replicaCount: 1 + +podAnnotations: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index 06465d42f..13610a1a0 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -2,19 +2,38 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui tag: ###ZARF_CONST_IMAGE_VERSION### -securityContext: - runAsUser: 65532 - runAsGroup: 65532 +env: + - name: LEAPFROGAI_API_BASE_URL + value: "###ZARF_VAR_LEAPFROGAI_API_BASE_URL###" + - name: ORIGIN + value: "https://###ZARF_VAR_DOMAIN###.###ZARF_VAR_SUBDOMAIN###" + - name: DEFAULT_MODEL + value: "###ZARF_VAR_MODEL###" + - name: DEFAULT_SYSTEM_PROMPT + value: "###ZARF_VAR_SYSTEM_PROMPT###" + - name: DEFAULT_TEMPERATURE + value: "###ZARF_VAR_TEMPERATURE###" + - name: OPENAI_API_KEY + value: "###ZARF_VAR_OPENAI_API_KEY###" + - name: PUBLIC_SUPABASE_URL + value: "https://supabase-kong.###ZARF_VAR_DOMAIN###" + - name: PUBLIC_DISABLE_KEYCLOAK + value: "true" + - name: PUBLIC_MESSAGE_LENGTH_LIMIT + value: "10000" + - name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL + value: "https://sso.uds.dev/realms/uds" + - name: SUPABASE_AUTH_KEYCLOAK_CLIENT_ID + valueFrom: + secretKeyRef: + name: sso-client-uds-supabase + key: clientId + - name: SUPABASE_AUTH_KEYCLOAK_SECRET + valueFrom: + secretKeyRef: + name: sso-client-uds-supabase + key: secret -package: - name: leapfrogai-ui - subdomain: "###ZARF_VAR_SUBDOMAIN###" - domain: "###ZARF_VAR_DOMAIN###" - supabase_url: https://supabase-kong.###ZARF_VAR_DOMAIN### - supabase_anon_key: "###ZARF_VAR_SUPABASE_ANON_KEY###" - message_length_limit: "###ZARF_VAR_MESSAGE_LENGTH_LIMIT###" - -migration: - namespace: leapfrogai - serviceName: supabase-postgresql - servicePort: 5432 +# Only required when Supabase is hosted via PaaS outside of the cluster +extraEnv: + supabaseAnonKey: "###ZARF_VAR_SUPABASE_ANON_KEY###" diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index ed5679d00..2c57c6bc1 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -35,7 +35,7 @@ variables: sensitive: false - name: SYSTEM_PROMPT description: The default system prompt to use for the LLM - default: "You are a helpful AI assistant created by Defense Unicorns." + default: 'You may be provided with a list of files and their content in the following structure: [{"filename": "test.pdf","text": "some fake text"}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response.' prompt: true sensitive: false - name: TEMPERATURE @@ -45,7 +45,7 @@ variables: sensitive: false - name: SUPABASE_ANON_KEY default: "" - description: Public key for Supabase + description: Public key for Supabase when hosted outside of the cluster on PaaS prompt: true sensitive: false - name: DISABLE_KEYCLOAK diff --git a/packages/vllm/Dockerfile b/packages/vllm/Dockerfile index 077ccc754..053ff73b6 100755 --- a/packages/vllm/Dockerfile +++ b/packages/vllm/Dockerfile @@ -74,7 +74,7 @@ ARG SDK_DEST=src/leapfrogai_sdk/build # model-specific arguments ARG TRUST_REMOTE_CODE="True" \ - MODEL_PATH="/data/.model/" \ + MODEL_SOURCE="/data/.model/" \ MAX_CONTEXT_LENGTH=32768 \ STOP_TOKENS='[""]' \ PROMPT_FORMAT_CHAT_SYSTEM="<|im_start|>system\n{}<|im_end|>\n" \ @@ -103,7 +103,7 @@ COPY --from=builder --chown=nonroot:nonroot /home/nonroot/.pyenv/versions/3.11.6 # load ARG values into env variables for pickup by confz ENV LAI_TRUST_REMOTE_CODE=${TRUST_REMOTE_CODE} \ - LAI_MODEL_PATH=${MODEL_PATH} \ + LAI_MODEL_SOURCE=${MODEL_SOURCE} \ LAI_MAX_CONTEXT_LENGTH=${MAX_CONTEXT_LENGTH} \ LAI_STOP_TOKENS=${STOP_TOKENS} \ LAI_PROMPT_FORMAT_CHAT_SYSTEM=${PROMPT_FORMAT_CHAT_SYSTEM} \ diff --git a/packages/vllm/chart/templates/deployment.yaml b/packages/vllm/chart/templates/deployment.yaml index 5fa3d3822..c49b953fe 100644 --- a/packages/vllm/chart/templates/deployment.yaml +++ b/packages/vllm/chart/templates/deployment.yaml @@ -6,12 +6,10 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: @@ -56,6 +54,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- toYaml .Values.env | nindent 12 }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index cceb8b70b..a08210c3a 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: ghcr.io/defenseunicorns/leapfrogai/vllm pullPolicy: Always @@ -15,7 +13,9 @@ image: nameOverride: vllm fullnameOverride: "" -podAnnotations: {} +env: + - name: LFAI_LOG_LEVEL + value: "20" # equivalent to logging.INFO podSecurityContext: runAsNonRoot: true @@ -46,11 +46,9 @@ resources: cpu: 0 memory: 0 -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 +replicaCount: 1 + +podAnnotations: {} nodeSelector: {} @@ -58,6 +56,11 @@ tolerations: [] affinity: {} +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + persistence: size: 15Gi accessModes: ReadWriteOnce diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 64d2ac9bb..80f279d5f 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -6,12 +6,10 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} spec: - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: @@ -61,6 +59,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- toYaml .Values.env | nindent 12 }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index 747d9bc02..fdee5eac7 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: ghcr.io/defenseunicorns/leapfrogai/whisper pullPolicy: Always @@ -15,7 +13,9 @@ image: nameOverride: whisper fullnameOverride: "" -podAnnotations: {} +env: + - name: LFAI_LOG_LEVEL + value: "20" # equivalent to logging.INFO podSecurityContext: runAsNonRoot: true @@ -52,12 +52,21 @@ autoscaling: maxReplicas: 100 targetCPUUtilizationPercentage: 80 +replicaCount: 1 + +podAnnotations: {} + nodeSelector: {} tolerations: [] affinity: {} +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + persistence: size: 15Gi accessModes: ReadWriteOnce From f7fcaad8f855709f9380c5b10d1d8f78461dfdb6 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 15:34:49 -0400 Subject: [PATCH 23/51] remove supabase from pre-commit hook --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 999c82c8b..6caadd6c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,6 +86,7 @@ repos: hooks: - id: helmlint name: Helm Lint + exclude: "packages/supabase" ############# # UDS v0.14.0 From 263399c0a65383276c14ac80b4e6a6d9cec3e678 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 15:36:38 -0400 Subject: [PATCH 24/51] fix uds-lint --- .github/workflows/uds-lint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml index c7d640594..ebca3247e 100644 --- a/.github/workflows/uds-lint.yaml +++ b/.github/workflows/uds-lint.yaml @@ -44,11 +44,11 @@ jobs: - name: Validate uds-bundle.yaml (dev) if: always() run: | - check-jsonschema uds-bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json - check-jsonschema uds-bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/dev/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/dev/cpu/uds-bundle.yaml --schemafile uds.schema.json - name: Validate uds-bundle.yaml (latest) if: always() run: | - check-jsonschema uds-bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json - check-jsonschema uds-bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/latest/gpu/uds-bundle.yaml --schemafile uds.schema.json + check-jsonschema bundles/latest/cpu/uds-bundle.yaml --schemafile uds.schema.json From 87b9ebb5a4f65d735afbcf2fc908b0535a7ad9d8 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 16:13:08 -0400 Subject: [PATCH 25/51] namespace default, global context --- packages/api/chart/templates/api/deployment.yaml | 16 ++++++++++------ .../api/chart/templates/api/permissions.yaml | 6 +++--- packages/api/chart/templates/api/service.yaml | 2 +- packages/api/chart/templates/migration-job.yaml | 8 +++++--- packages/api/chart/templates/uds-package.yaml | 2 +- packages/api/zarf.yaml | 2 ++ .../chart/templates/configmap.yaml | 2 +- .../chart/templates/deployment.yaml | 6 ++++-- .../llama-cpp-python/chart/templates/pvc.yaml | 2 +- .../chart/templates/service.yaml | 2 +- packages/repeater/chart/templates/configmap.yaml | 2 +- .../repeater/chart/templates/deployment.yaml | 2 +- packages/repeater/chart/templates/service.yaml | 2 +- .../templates/supabase-dashboard-secret.yaml | 6 +++--- .../templates/supabase-realtime-secret.yaml | 4 ++-- .../chart/templates/configmap.yaml | 2 +- .../chart/templates/deployment.yaml | 6 ++++-- .../text-embeddings/chart/templates/pvc.yaml | 2 +- .../text-embeddings/chart/templates/service.yaml | 2 +- .../chart/templates/{ui => }/migration-job.yaml | 8 +++++--- packages/ui/chart/templates/uds-package.yaml | 2 +- packages/ui/chart/templates/ui/deployment.yaml | 10 ++++++---- packages/ui/chart/templates/ui/service.yaml | 2 +- packages/vllm/chart/templates/configmap.yaml | 2 +- packages/vllm/chart/templates/deployment.yaml | 6 ++++-- packages/vllm/chart/templates/pvc.yaml | 2 +- packages/vllm/chart/templates/service.yaml | 2 +- packages/whisper/chart/templates/configmap.yaml | 2 +- packages/whisper/chart/templates/deployment.yaml | 6 ++++-- packages/whisper/chart/templates/pvc.yaml | 2 +- packages/whisper/chart/templates/service.yaml | 2 +- 31 files changed, 71 insertions(+), 51 deletions(-) rename packages/ui/chart/templates/{ui => }/migration-job.yaml (84%) diff --git a/packages/api/chart/templates/api/deployment.yaml b/packages/api/chart/templates/api/deployment.yaml index d83195e91..f2edaf765 100644 --- a/packages/api/chart/templates/api/deployment.yaml +++ b/packages/api/chart/templates/api/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -31,17 +31,21 @@ spec: image: "{{ .Values.kiwigrid.image.repository }}:{{ .Values.kiwigrid.image.tag }}" imagePullPolicy: {{ .Values.kiwigrid.image.imagePullPolicy }} volumeMounts: - - name: api-model + - name: {{ include "chart.fullname" . }}-model mountPath: /config/ + {{- with .Values.kiwigrid.env }} env: - {{- toYaml .Values.kiwigrid.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} securityContext: {{- toYaml .Values.kiwigrid.securityContext | nindent 12 }} - name: {{ include "chart.fullname" . }}-container image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.api.image.imagePullPolicy }} + {{- with .Values.api.env }} env: - {{- toYaml .Values.api.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - containerPort: {{ .Values.api.service.port }} livenessProbe: @@ -59,10 +63,10 @@ spec: securityContext: {{- toYaml .Values.api.securityContext | nindent 12 }} volumeMounts: - - name: api-model + - name: {{ include "chart.fullname" . }}-model mountPath: /config volumes: - - name: api-model + - name: {{ include "chart.fullname" . }}-model emptyDir: {} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/packages/api/chart/templates/api/permissions.yaml b/packages/api/chart/templates/api/permissions.yaml index 3ca06df4b..fcef3c2cb 100644 --- a/packages/api/chart/templates/api/permissions.yaml +++ b/packages/api/chart/templates/api/permissions.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "chart.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} --- @@ -10,7 +10,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "chart.fullname" . }}-read-configmaps - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} rules: @@ -28,7 +28,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "chart.fullname" . }}-read-configmaps - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} roleRef: diff --git a/packages/api/chart/templates/api/service.yaml b/packages/api/chart/templates/api/service.yaml index 3380507e2..1f16d42fc 100644 --- a/packages/api/chart/templates/api/service.yaml +++ b/packages/api/chart/templates/api/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "Load the OpenAPI specification for the LeapfrogAI API" zarf.dev/connect-url: "/docs" diff --git a/packages/api/chart/templates/migration-job.yaml b/packages/api/chart/templates/migration-job.yaml index faec6bc56..be271cf22 100644 --- a/packages/api/chart/templates/migration-job.yaml +++ b/packages/api/chart/templates/migration-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "chart.fullname" . }}-migrations-{{ .Values.api.migration.image.tag | default .Chart.AppVersion }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -16,10 +16,12 @@ spec: containers: - name: supabase-cli image: "{{ .Values.api.migration.image.repository }}:{{ .Values.api.migration.image.tag | default .Chart.AppVersion }}" + {{- with .Values.api.migration.env }} env: - {{- toYaml .Values.api.migration.env | nindent 12 }} + {{- toYaml . | nindent 12 }} - name: MIGRATION_NAMESPACE - value: "{{ .Release.Namespace }}" + value: "{{ default "leapfrogai" $.Release.Namespace }}" + {{- end }} command: ["/bin/sh"] args: - -c diff --git a/packages/api/chart/templates/uds-package.yaml b/packages/api/chart/templates/uds-package.yaml index 69d18bbc7..526106213 100644 --- a/packages/api/chart/templates/uds-package.yaml +++ b/packages/api/chart/templates/uds-package.yaml @@ -3,7 +3,7 @@ apiVersion: uds.dev/v1alpha1 kind: Package metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/api/zarf.yaml b/packages/api/zarf.yaml index fb3e6a089..fc1770ffa 100644 --- a/packages/api/zarf.yaml +++ b/packages/api/zarf.yaml @@ -27,6 +27,7 @@ components: path: common charts: - name: leapfrogai + namespace: leapfrogai valuesFiles: - "values/upstream-values.yaml" images: @@ -42,6 +43,7 @@ components: path: common charts: - name: leapfrogai + namespace: leapfrogai valuesFiles: - "values/registry1-values.yaml" images: diff --git a/packages/llama-cpp-python/chart/templates/configmap.yaml b/packages/llama-cpp-python/chart/templates/configmap.yaml index d402270b8..414c352ed 100644 --- a/packages/llama-cpp-python/chart/templates/configmap.yaml +++ b/packages/llama-cpp-python/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: leapfrogai: sparkle data: diff --git a/packages/llama-cpp-python/chart/templates/deployment.yaml b/packages/llama-cpp-python/chart/templates/deployment.yaml index 7fcf732af..1c4cd27bf 100644 --- a/packages/llama-cpp-python/chart/templates/deployment.yaml +++ b/packages/llama-cpp-python/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -53,8 +53,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.env }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/llama-cpp-python/chart/templates/pvc.yaml b/packages/llama-cpp-python/chart/templates/pvc.yaml index acbe46e84..8041e6873 100644 --- a/packages/llama-cpp-python/chart/templates/pvc.yaml +++ b/packages/llama-cpp-python/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/llama-cpp-python/chart/templates/service.yaml b/packages/llama-cpp-python/chart/templates/service.yaml index c6bf08d62..959e70703 100644 --- a/packages/llama-cpp-python/chart/templates/service.yaml +++ b/packages/llama-cpp-python/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/repeater/chart/templates/configmap.yaml b/packages/repeater/chart/templates/configmap.yaml index d402270b8..414c352ed 100644 --- a/packages/repeater/chart/templates/configmap.yaml +++ b/packages/repeater/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: leapfrogai: sparkle data: diff --git a/packages/repeater/chart/templates/deployment.yaml b/packages/repeater/chart/templates/deployment.yaml index 60f11dabb..39296aad8 100644 --- a/packages/repeater/chart/templates/deployment.yaml +++ b/packages/repeater/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/repeater/chart/templates/service.yaml b/packages/repeater/chart/templates/service.yaml index c6bf08d62..959e70703 100644 --- a/packages/repeater/chart/templates/service.yaml +++ b/packages/repeater/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/supabase/chart/templates/supabase-dashboard-secret.yaml b/packages/supabase/chart/templates/supabase-dashboard-secret.yaml index 805bd99da..f945d18b3 100644 --- a/packages/supabase/chart/templates/supabase-dashboard-secret.yaml +++ b/packages/supabase/chart/templates/supabase-dashboard-secret.yaml @@ -1,10 +1,10 @@ -{{- $dashboardPassword := randAlphaNum 10 }} +{{- $dashboardPassword := randAlphaNum 10 }} {{- $existingSecret := (lookup "v1" "Secret" .Release.Namespace "supabase-dashboard-secret") }} apiVersion: v1 kind: Secret metadata: name: supabase-dashboard-secret - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} {{- if $existingSecret }} annotations: "helm.sh/resource-policy": keep @@ -15,4 +15,4 @@ data: password: {{ $existingSecret.data.password }} {{- else }} password: {{ $dashboardPassword | b64enc | quote }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/packages/supabase/chart/templates/supabase-realtime-secret.yaml b/packages/supabase/chart/templates/supabase-realtime-secret.yaml index a762df845..0cf4ca72a 100644 --- a/packages/supabase/chart/templates/supabase-realtime-secret.yaml +++ b/packages/supabase/chart/templates/supabase-realtime-secret.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: supabase-realtime-extra - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} {{- if $existingSecret }} annotations: "helm.sh/resource-policy": keep @@ -15,4 +15,4 @@ data: dbEncKey: {{ $existingSecret.data.dbEncKey }} {{- else }} dbEncKey: {{ $dbEncKey | b64enc | quote }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/packages/text-embeddings/chart/templates/configmap.yaml b/packages/text-embeddings/chart/templates/configmap.yaml index d402270b8..414c352ed 100644 --- a/packages/text-embeddings/chart/templates/configmap.yaml +++ b/packages/text-embeddings/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: leapfrogai: sparkle data: diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 5762925dd..8452aaeeb 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -58,8 +58,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.env }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/text-embeddings/chart/templates/pvc.yaml b/packages/text-embeddings/chart/templates/pvc.yaml index acbe46e84..8041e6873 100644 --- a/packages/text-embeddings/chart/templates/pvc.yaml +++ b/packages/text-embeddings/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/text-embeddings/chart/templates/service.yaml b/packages/text-embeddings/chart/templates/service.yaml index c6bf08d62..959e70703 100644 --- a/packages/text-embeddings/chart/templates/service.yaml +++ b/packages/text-embeddings/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/ui/chart/templates/ui/migration-job.yaml b/packages/ui/chart/templates/migration-job.yaml similarity index 84% rename from packages/ui/chart/templates/ui/migration-job.yaml rename to packages/ui/chart/templates/migration-job.yaml index 40334f725..eb29edccf 100644 --- a/packages/ui/chart/templates/ui/migration-job.yaml +++ b/packages/ui/chart/templates/migration-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "chart.fullname" . }}-migrations-{{ .Values.migration.image.tag | default .Chart.AppVersion }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -16,10 +16,12 @@ spec: containers: - name: supabase-cli image: "{{ .Values.migration.image.repository }}:{{ .Values.migration.image.tag | default .Chart.AppVersion }}" + {{- with .Values.migration.env }} env: - {{- toYaml .Values.migration.env | nindent 12 }} + {{- toYaml . | nindent 12 }} - name: MIGRATION_NAMESPACE - value: "{{ .Release.Namespace }}" + value: "{{ default "leapfrogai" $.Release.Namespace }}" + {{- end }} command: ["/bin/sh"] args: - -c diff --git a/packages/ui/chart/templates/uds-package.yaml b/packages/ui/chart/templates/uds-package.yaml index d6721404e..7f84ba6c0 100644 --- a/packages/ui/chart/templates/uds-package.yaml +++ b/packages/ui/chart/templates/uds-package.yaml @@ -2,7 +2,7 @@ apiVersion: uds.dev/v1alpha1 kind: Package metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/ui/chart/templates/ui/deployment.yaml b/packages/ui/chart/templates/ui/deployment.yaml index 49b06915c..99ea4919e 100644 --- a/packages/ui/chart/templates/ui/deployment.yaml +++ b/packages/ui/chart/templates/ui/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -30,11 +30,12 @@ spec: - name: {{ include "chart.fullname" . }}-container image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.imagePullPolicy }} + {{- with .Values.env }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml . | nindent 12 }} - name: PUBLIC_SUPABASE_ANON_KEY - {{ if .Values.extraEnv.supabaseAnonKey }} - value: {{ .Values.extraEnv.supabaseAnonKey }} + {{ if $.Values.extraEnv.supabaseAnonKey }} + value: {{ $.Values.extraEnv.supabaseAnonKey }} {{ else }} valueFrom: secretKeyRef: @@ -42,6 +43,7 @@ spec: key: anon-key optional: true {{ end }} + {{- end }} ports: - containerPort: {{ .Values.service.port }} securityContext: diff --git a/packages/ui/chart/templates/ui/service.yaml b/packages/ui/chart/templates/ui/service.yaml index 8f4d17207..7c9c4ea52 100644 --- a/packages/ui/chart/templates/ui/service.yaml +++ b/packages/ui/chart/templates/ui/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "Load the LeapfrogAI UI" zarf.dev/connect-url: "/chat" diff --git a/packages/vllm/chart/templates/configmap.yaml b/packages/vllm/chart/templates/configmap.yaml index d402270b8..414c352ed 100644 --- a/packages/vllm/chart/templates/configmap.yaml +++ b/packages/vllm/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: leapfrogai: sparkle data: diff --git a/packages/vllm/chart/templates/deployment.yaml b/packages/vllm/chart/templates/deployment.yaml index c49b953fe..be5ba6458 100644 --- a/packages/vllm/chart/templates/deployment.yaml +++ b/packages/vllm/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -54,8 +54,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.env }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/vllm/chart/templates/pvc.yaml b/packages/vllm/chart/templates/pvc.yaml index acbe46e84..8041e6873 100644 --- a/packages/vllm/chart/templates/pvc.yaml +++ b/packages/vllm/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/vllm/chart/templates/service.yaml b/packages/vllm/chart/templates/service.yaml index c6bf08d62..959e70703 100644 --- a/packages/vllm/chart/templates/service.yaml +++ b/packages/vllm/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/whisper/chart/templates/configmap.yaml b/packages/whisper/chart/templates/configmap.yaml index d402270b8..414c352ed 100644 --- a/packages/whisper/chart/templates/configmap.yaml +++ b/packages/whisper/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: leapfrogai: sparkle data: diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 80f279d5f..713160fd1 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} labels: {{- include "chart.labels" . | nindent 4 }} spec: @@ -59,8 +59,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.env }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/packages/whisper/chart/templates/pvc.yaml b/packages/whisper/chart/templates/pvc.yaml index acbe46e84..8041e6873 100644 --- a/packages/whisper/chart/templates/pvc.yaml +++ b/packages/whisper/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/whisper/chart/templates/service.yaml b/packages/whisper/chart/templates/service.yaml index c6bf08d62..959e70703 100644 --- a/packages/whisper/chart/templates/service.yaml +++ b/packages/whisper/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: From b35b5316a36cc9fe3fc86dba5d673b30c9aeecd7 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 16:15:33 -0400 Subject: [PATCH 26/51] skip registry1 e2e on draft PRs --- .github/workflows/e2e-registry1-weekly.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index f2ace37d4..352501b81 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -27,6 +27,7 @@ jobs: test-flavors: runs-on: ai-ubuntu-big-boy-8-core name: e2e_registry1_weekly + if: ${{ !github.event.pull_request.draft }} permissions: contents: read From 63227578dee3a373965a626064598bccfd67c424 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 17:32:35 -0400 Subject: [PATCH 27/51] log level, service fixes --- packages/api/chart/values.yaml | 2 +- packages/api/values/registry1-values.yaml | 22 ++++++++++++++++++-- packages/api/values/upstream-values.yaml | 22 ++++++++++++++++++-- packages/llama-cpp-python/chart/values.yaml | 2 +- packages/text-embeddings/chart/values.yaml | 2 +- packages/ui/chart/templates/uds-package.yaml | 2 +- packages/ui/chart/templates/ui/service.yaml | 2 +- packages/ui/values/upstream-values.yaml | 6 ++++++ packages/ui/zarf.yaml | 6 +++--- packages/vllm/chart/values.yaml | 2 +- packages/whisper/chart/values.yaml | 2 +- 11 files changed, 56 insertions(+), 14 deletions(-) diff --git a/packages/api/chart/values.yaml b/packages/api/chart/values.yaml index 623d9c1a1..39e3c1eba 100644 --- a/packages/api/chart/values.yaml +++ b/packages/api/chart/values.yaml @@ -37,7 +37,7 @@ api: env: - name: LFAI_LOG_LEVEL - value: "20" # equivalent to logging.INFO + value: "INFO" - name: LFAI_CONFIG_PATH value: /config/ - name: LFAI_CONFIG_FILENAME diff --git a/packages/api/values/registry1-values.yaml b/packages/api/values/registry1-values.yaml index 70e3bcad2..3d621359f 100644 --- a/packages/api/values/registry1-values.yaml +++ b/packages/api/values/registry1-values.yaml @@ -5,9 +5,27 @@ api: tag: v0.11.0 # x-release-please-end + expose: ###ZARF_VAR_EXPOSE_API### + env: - exposeAPI: "###ZARF_VAR_EXPOSE_API###" - defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + - name: LFAI_LOG_LEVEL + value: "INFO" + - name: LFAI_CONFIG_PATH + value: /config/ + - name: LFAI_CONFIG_FILENAME + value: "*.toml" + - name: DEFAULT_EMBEDDINGS_MODEL + value: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + - name: PORT + value: "8080" + - name: SUPABASE_URL + value: "http://supabase-kong.leapfrogai.svc.cluster.local:80" + - name: SUPABASE_ANON_KEY + valueFrom: + secretKeyRef: + name: supabase-bootstrap-jwt + key: anon-key + optional: true migration: image: diff --git a/packages/api/values/upstream-values.yaml b/packages/api/values/upstream-values.yaml index 655d18b4f..b1923b390 100644 --- a/packages/api/values/upstream-values.yaml +++ b/packages/api/values/upstream-values.yaml @@ -3,9 +3,27 @@ api: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api tag: ###ZARF_CONST_IMAGE_VERSION### + expose: ###ZARF_VAR_EXPOSE_API### + env: - exposeAPI: "###ZARF_VAR_EXPOSE_API###" - defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + - name: LFAI_LOG_LEVEL + value: "INFO" + - name: LFAI_CONFIG_PATH + value: /config/ + - name: LFAI_CONFIG_FILENAME + value: "*.toml" + - name: DEFAULT_EMBEDDINGS_MODEL + value: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###" + - name: PORT + value: "8080" + - name: SUPABASE_URL + value: "http://supabase-kong.leapfrogai.svc.cluster.local:80" + - name: SUPABASE_ANON_KEY + valueFrom: + secretKeyRef: + name: supabase-bootstrap-jwt + key: anon-key + optional: true migration: image: diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index 605694964..23ce8b130 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -15,7 +15,7 @@ fullnameOverride: "" env: - name: LFAI_LOG_LEVEL - value: "20" # equivalent to logging.INFO + value: "INFO" podSecurityContext: runAsNonRoot: true diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 0e6bfb843..c1e5b5d33 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -15,7 +15,7 @@ fullnameOverride: "" env: - name: LFAI_LOG_LEVEL - value: "20" # equivalent to logging.INFO + value: "INFO" podSecurityContext: runAsNonRoot: true diff --git a/packages/ui/chart/templates/uds-package.yaml b/packages/ui/chart/templates/uds-package.yaml index 7f84ba6c0..5ab0efe09 100644 --- a/packages/ui/chart/templates/uds-package.yaml +++ b/packages/ui/chart/templates/uds-package.yaml @@ -13,7 +13,7 @@ spec: {{- include "chart.selectorLabels" . | nindent 10 }} host: {{ include "chart.fullname" . }} gateway: tenant - port: {{ .Values.port }} + port: {{ .Values.service.port }} allow: - direction: Ingress diff --git a/packages/ui/chart/templates/ui/service.yaml b/packages/ui/chart/templates/ui/service.yaml index 7c9c4ea52..471e2a8bc 100644 --- a/packages/ui/chart/templates/ui/service.yaml +++ b/packages/ui/chart/templates/ui/service.yaml @@ -4,6 +4,7 @@ metadata: name: {{ include "chart.fullname" . }} namespace: {{ default "leapfrogai" .Release.Namespace }} annotations: + app: {{ include "chart.fullname" . }} zarf.dev/connect-description: "Load the LeapfrogAI UI" zarf.dev/connect-url: "/chat" labels: @@ -17,4 +18,3 @@ spec: protocol: TCP port: {{ .Values.service.port }} targetPort: {{ .Values.service.port }} - type: ClusterIP diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index 13610a1a0..f884732a6 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -37,3 +37,9 @@ env: # Only required when Supabase is hosted via PaaS outside of the cluster extraEnv: supabaseAnonKey: "###ZARF_VAR_SUPABASE_ANON_KEY###" + +migration: + image: + repository: ghcr.io/defenseunicorns/leapfrogai/ui-migrations + tag: ###ZARF_CONST_IMAGE_VERSION### + imagePullPolicy: Always diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 2c57c6bc1..42367fd2c 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -10,7 +10,7 @@ constants: value: "###ZARF_PKG_TMPL_IMAGE_VERSION###" variables: - - name: LEAPFROGAI_API_BASE_URL #LEAPFROGAI_API_BASE_URL + - name: LEAPFROGAI_API_BASE_URL description: The base URL for the LeapfrogAI API default: http://leapfrogai-api.leapfrogai.svc.cluster.local:8080 prompt: true @@ -35,7 +35,7 @@ variables: sensitive: false - name: SYSTEM_PROMPT description: The default system prompt to use for the LLM - default: 'You may be provided with a list of files and their content in the following structure: [{"filename": "test.pdf","text": "some fake text"}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response.' + default: "You may be provided with a list of files and their content in the following structure: [{'filename': 'test.pdf','text': 'some fake text'}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." prompt: true sensitive: false - name: TEMPERATURE @@ -82,7 +82,7 @@ components: - wait: cluster: kind: Job - name: ui-migrations-###ZARF_PKG_TMPL_IMAGE_VERSION### + name: leapfrogai-ui-migrations-###ZARF_PKG_TMPL_IMAGE_VERSION### namespace: leapfrogai condition: complete - wait: diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index a08210c3a..13fc6e39e 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -15,7 +15,7 @@ fullnameOverride: "" env: - name: LFAI_LOG_LEVEL - value: "20" # equivalent to logging.INFO + value: "INFO" podSecurityContext: runAsNonRoot: true diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index fdee5eac7..f7963f12e 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -15,7 +15,7 @@ fullnameOverride: "" env: - name: LFAI_LOG_LEVEL - value: "20" # equivalent to logging.INFO + value: "INFO" podSecurityContext: runAsNonRoot: true From 5444effd04d104deeec13abe4ffbea8ef2df223a Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 18:29:55 -0400 Subject: [PATCH 28/51] attempt fix migrations issues --- Dockerfile.migrations | 2 - packages/api/chart/values.yaml | 42 +++++++++---------- packages/ui/chart/templates/uds-package.yaml | 2 +- .../ui/chart/templates/ui/permissions.yaml | 7 ++++ packages/ui/chart/templates/ui/service.yaml | 8 ++++ packages/ui/chart/values.yaml | 10 ++--- packages/ui/values/upstream-values.yaml | 6 ++- 7 files changed, 43 insertions(+), 34 deletions(-) create mode 100644 packages/ui/chart/templates/ui/permissions.yaml diff --git a/Dockerfile.migrations b/Dockerfile.migrations index 8c415db66..1eedf19d2 100644 --- a/Dockerfile.migrations +++ b/Dockerfile.migrations @@ -16,7 +16,5 @@ RUN mkdir -p /usr/local/bin && \ # 65532 is the UID of the `nonroot` user in chainguard/static. See: https://edu.chainguard.dev/chainguard/chainguard-images/reference/static/overview/#users USER 65532:65532 -WORKDIR /supabase/migrations/ - # Download the migration scripts COPY --chown=65532:65532 ${MIGRATIONS_DIR}/*.sql /supabase/migrations/ diff --git a/packages/api/chart/values.yaml b/packages/api/chart/values.yaml index 39e3c1eba..c8a3e4822 100644 --- a/packages/api/chart/values.yaml +++ b/packages/api/chart/values.yaml @@ -1,22 +1,3 @@ -podSecurityContext: - runAsNonRoot: true - fsGroup: 65532 - -replicaCount: 1 - -podAnnotations: {} - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - api: expose: true @@ -73,10 +54,6 @@ api: securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL env: - name: POSTGRES_PASSWORD @@ -114,3 +91,22 @@ kiwigrid: value: "true" - name: NAMESPACE value: leapfrogai + +podSecurityContext: + runAsNonRoot: true + fsGroup: 65532 + +replicaCount: 1 + +podAnnotations: {} + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate diff --git a/packages/ui/chart/templates/uds-package.yaml b/packages/ui/chart/templates/uds-package.yaml index 5ab0efe09..3179f8767 100644 --- a/packages/ui/chart/templates/uds-package.yaml +++ b/packages/ui/chart/templates/uds-package.yaml @@ -11,7 +11,7 @@ spec: - service: {{ include "chart.fullname" . }} podLabels: {{- include "chart.selectorLabels" . | nindent 10 }} - host: {{ include "chart.fullname" . }} + host: {{ .Values.extraEnv.host }} gateway: tenant port: {{ .Values.service.port }} diff --git a/packages/ui/chart/templates/ui/permissions.yaml b/packages/ui/chart/templates/ui/permissions.yaml new file mode 100644 index 000000000..0afa20585 --- /dev/null +++ b/packages/ui/chart/templates/ui/permissions.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "chart.serviceAccountName" . }} + namespace: {{ default "leapfrogai" .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} diff --git a/packages/ui/chart/templates/ui/service.yaml b/packages/ui/chart/templates/ui/service.yaml index 471e2a8bc..9703ec3d7 100644 --- a/packages/ui/chart/templates/ui/service.yaml +++ b/packages/ui/chart/templates/ui/service.yaml @@ -18,3 +18,11 @@ spec: protocol: TCP port: {{ .Values.service.port }} targetPort: {{ .Values.service.port }} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "chart.serviceAccountName" . }} + namespace: {{ default "leapfrogai" .Release.Namespace }} + labels: + {{- include "chart.labels" . | nindent 4 }} diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml index fbbf8f9f6..55c18f0f8 100644 --- a/packages/ui/chart/values.yaml +++ b/packages/ui/chart/values.yaml @@ -26,7 +26,7 @@ securityContext: env: - name: LEAPFROGAI_API_BASE_URL - value: "ai" + value: "http://leapfrogai-api.leapfrogai.svc.cluster.local:8080" - name: ORIGIN value: "https://ai.uds.dev" - name: DEFAULT_MODEL @@ -56,9 +56,11 @@ env: name: sso-client-uds-supabase key: secret -# Only required when Supabase is hosted via PaaS outside of the cluster extraEnv: + # Only required when Supabase is hosted via PaaS outside of the cluster supabaseAnonKey: "" + # UDS package CR hosting subdomain (e.g. `ai` will produce a VirtualService with `ai.uds.dev`) + host: "ai" migration: image: @@ -82,10 +84,6 @@ migration: securityContext: runAsUser: 65532 runAsGroup: 65532 - runAsNonRoot: true - capabilities: - drop: - - ALL resources: # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index f884732a6..46bd6fbf5 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -6,7 +6,7 @@ env: - name: LEAPFROGAI_API_BASE_URL value: "###ZARF_VAR_LEAPFROGAI_API_BASE_URL###" - name: ORIGIN - value: "https://###ZARF_VAR_DOMAIN###.###ZARF_VAR_SUBDOMAIN###" + value: "https://###ZARF_VAR_SUBDOMAIN###.###ZARF_VAR_DOMAIN###" - name: DEFAULT_MODEL value: "###ZARF_VAR_MODEL###" - name: DEFAULT_SYSTEM_PROMPT @@ -34,9 +34,11 @@ env: name: sso-client-uds-supabase key: secret -# Only required when Supabase is hosted via PaaS outside of the cluster extraEnv: + # Only required when Supabase is hosted via PaaS outside of the cluster supabaseAnonKey: "###ZARF_VAR_SUPABASE_ANON_KEY###" + # UDS package CR hosting subdomain (e.g. `ai` will produce a VirtualService with `ai.uds.dev`) + host: "###ZARF_VAR_SUBDOMAIN###" migration: image: From 43f44c22446447dd455c564f1466df267ba292f5 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 20:34:56 -0400 Subject: [PATCH 29/51] injector fix for llama, vllm confz fix --- packages/llama-cpp-python/zarf.yaml | 2 +- .../repeater/chart/templates/deployment.yaml | 1 + packages/ui/chart/values.yaml | 2 +- packages/ui/zarf.yaml | 2 +- packages/vllm/Dockerfile | 16 ++++++++++------ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/llama-cpp-python/zarf.yaml b/packages/llama-cpp-python/zarf.yaml index 876b4434e..45eb198f8 100644 --- a/packages/llama-cpp-python/zarf.yaml +++ b/packages/llama-cpp-python/zarf.yaml @@ -46,7 +46,7 @@ components: - source: .model/ target: namespace: leapfrogai - selector: app=lfai-llama + selector: app=lfai-llama-cpp-python container: data-loader path: /data/.model compress: true diff --git a/packages/repeater/chart/templates/deployment.yaml b/packages/repeater/chart/templates/deployment.yaml index 39296aad8..c0ddd8d61 100644 --- a/packages/repeater/chart/templates/deployment.yaml +++ b/packages/repeater/chart/templates/deployment.yaml @@ -22,6 +22,7 @@ spec: {{- end }} labels: app: lfai-{{ .Values.nameOverride }} + {{- include "chart.selectorLabels" . | nindent 8 }} spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml index 55c18f0f8..2eb63a3a0 100644 --- a/packages/ui/chart/values.yaml +++ b/packages/ui/chart/values.yaml @@ -32,7 +32,7 @@ env: - name: DEFAULT_MODEL value: "llama-cpp-python" - name: DEFAULT_SYSTEM_PROMPT - value: 'You may be provided with a list of files and their content in the following structure: [{"filename": "test.pdf","text": "some fake text"}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response.' + value: "You may be provided with a list of files and their content in the following structure: `[{\"filename\": \"test.pdf\", \"text\": \"some fake text\"}]``. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." - name: DEFAULT_TEMPERATURE value: "0.1" - name: OPENAI_API_KEY diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 42367fd2c..27bd5e527 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -35,7 +35,7 @@ variables: sensitive: false - name: SYSTEM_PROMPT description: The default system prompt to use for the LLM - default: "You may be provided with a list of files and their content in the following structure: [{'filename': 'test.pdf','text': 'some fake text'}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." + default: "You may be provided with a list of files and their content in the following structure: `[{\"filename\": \"test.pdf\", \"text\": \"some fake text\"}]``. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." prompt: true sensitive: false - name: TEMPERATURE diff --git a/packages/vllm/Dockerfile b/packages/vllm/Dockerfile index 053ff73b6..8676f5eda 100755 --- a/packages/vllm/Dockerfile +++ b/packages/vllm/Dockerfile @@ -73,17 +73,19 @@ FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 ARG SDK_DEST=src/leapfrogai_sdk/build # model-specific arguments -ARG TRUST_REMOTE_CODE="True" \ +ARG ARG HF_HUB_ENABLE_HF_TRANSFER="1" \ + REPO_ID="TheBloke/Synthia-7B-v2.0-GPTQ" \ + REVISION="gptq-4bit-32g-actorder_True" \ MODEL_SOURCE="/data/.model/" \ MAX_CONTEXT_LENGTH=32768 \ STOP_TOKENS='[""]' \ - PROMPT_FORMAT_CHAT_SYSTEM="<|im_start|>system\n{}<|im_end|>\n" \ - PROMPT_FORMAT_CHAT_USER="<|im_start|>user\n{}<|im_end|>\n" \ - PROMPT_FORMAT_CHAT_ASSISTANT="<|im_start|>assistant\n{}<|im_end|>\n" \ + PROMPT_FORMAT_CHAT_SYSTEM="SYSTEM: {}\n" \ + PROMPT_FORMAT_CHAT_USER="USER: {}\n" \ + PROMPT_FORMAT_CHAT_ASSISTANT="ASSISTANT: {}\n" \ PROMPT_FORMAT_DEFAULTS_TOP_P=1.0 \ PROMPT_FORMAT_DEFAULTS_TOP_K=0 \ TENSOR_PARALLEL_SIZE=1 \ - QUANTIZATION="None" + QUANTIZATION="gptq" # setup nonroot user and permissions USER root @@ -102,7 +104,9 @@ COPY --from=builder --chown=nonroot:nonroot /home/leapfrogai/packages/vllm/src / COPY --from=builder --chown=nonroot:nonroot /home/nonroot/.pyenv/versions/3.11.6/ /home/nonroot/.pyenv/versions/3.11.6/ # load ARG values into env variables for pickup by confz -ENV LAI_TRUST_REMOTE_CODE=${TRUST_REMOTE_CODE} \ +ENV LAI_HF_HUB_ENABLE_HF_TRANSFER=${HF_HUB_ENABLE_HF_TRANSFER} \ + LAI_REPO_ID=${REPO_ID} \ + LAI_REVISION=${REVISION} \ LAI_MODEL_SOURCE=${MODEL_SOURCE} \ LAI_MAX_CONTEXT_LENGTH=${MAX_CONTEXT_LENGTH} \ LAI_STOP_TOKENS=${STOP_TOKENS} \ From 4788ef3f8519e52f76a5407cb968efb128b1fbbc Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 20:36:48 -0400 Subject: [PATCH 30/51] improve cleaning of build artifacts in Makefile --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 38364029f..ba277ecb5 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ help: ## Display this help information clean: ## Clean up all the things (packages, build dirs, compiled .whl files, python eggs) -rm -rf .logs + -rm -rf ./packages/**/.model/ + -rm -rf ./**/__pycache__/ + -rm -rf ./**/.ruff_cache -rm zarf-package-*.tar.zst -rm packages/**/zarf-package-*.tar.zst -rm -rf build/* From fb56b56eb749f2cf2f8bc46091329a1eb9e6b232 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 20:37:54 -0400 Subject: [PATCH 31/51] one more clean improvement --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ba277ecb5..b9ba43e4e 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ clean: ## Clean up all the things (packages, build dirs, compiled .whl files, py -rm -rf .logs -rm -rf ./packages/**/.model/ -rm -rf ./**/__pycache__/ - -rm -rf ./**/.ruff_cache + -rm -rf ./**/.ruff_cache ./.ruff_cache -rm zarf-package-*.tar.zst -rm packages/**/zarf-package-*.tar.zst -rm -rf build/* From 1b4df8e637a4ff2e82c174445a642368ba86b66e Mon Sep 17 00:00:00 2001 From: Justin Law Date: Wed, 4 Sep 2024 21:11:22 -0400 Subject: [PATCH 32/51] mention #984, fix UI Zarf variable string --- .hadolint.yaml | 2 +- packages/ui/chart/values.yaml | 2 +- packages/ui/zarf.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index fafcf3056..7406fc2b2 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,5 +1,5 @@ failure-threshold: error -# TODO: slowly burn down these lower priority container issues +# TODO: slowly burn down these lower priority container warnings and errors, issue #984 ignored: - DL3007 # use of latest image - DL3042 # pip --no-cache-dir diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml index 2eb63a3a0..e1550bcbd 100644 --- a/packages/ui/chart/values.yaml +++ b/packages/ui/chart/values.yaml @@ -32,7 +32,7 @@ env: - name: DEFAULT_MODEL value: "llama-cpp-python" - name: DEFAULT_SYSTEM_PROMPT - value: "You may be provided with a list of files and their content in the following structure: `[{\"filename\": \"test.pdf\", \"text\": \"some fake text\"}]``. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." + value: "You may be provided with a list of files and their content in the following structure: [{filename: test.pdf, text: some fake text}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." - name: DEFAULT_TEMPERATURE value: "0.1" - name: OPENAI_API_KEY diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 27bd5e527..933985f50 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -35,7 +35,7 @@ variables: sensitive: false - name: SYSTEM_PROMPT description: The default system prompt to use for the LLM - default: "You may be provided with a list of files and their content in the following structure: `[{\"filename\": \"test.pdf\", \"text\": \"some fake text\"}]``. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." + default: "You may be provided with a list of files and their content in the following structure: [{filename: test.pdf, text: some fake text}]. Using the content of these files as context, you should refer to specific files by their filename when relevant and use the text content to provide detailed, accurate, and relevant information or answers. If the user asks questions that can be answered based on the content of the provided files, use the appropriate files text in your response. If the user requests clarification, further details, or specific information about a file, respond using the most relevant file or files. If necessary, combine information from multiple files to form a comprehensive response." prompt: true sensitive: false - name: TEMPERATURE From 313490819fbcada8eb6ca7fef140d08997299fe9 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 09:36:46 -0400 Subject: [PATCH 33/51] fix UI keycloak var, gpu_runtime --- Makefile | 4 ++-- bundles/dev/cpu/uds-config.yaml | 4 ++-- bundles/dev/gpu/uds-config.yaml | 4 ++-- bundles/latest/cpu/uds-config.yaml | 4 ++-- bundles/latest/gpu/uds-config.yaml | 4 ++-- packages/text-embeddings/zarf.yaml | 2 +- packages/ui/values/upstream-values.yaml | 2 +- packages/ui/zarf.yaml | 2 +- packages/vllm/zarf.yaml | 2 +- packages/whisper/zarf.yaml | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index b9ba43e4e..c1426210e 100644 --- a/Makefile +++ b/Makefile @@ -304,8 +304,8 @@ silent-deploy-gpu: @$(MAKE) -j${MAX_JOBS} \ silent-deploy-api-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS}" \ silent-deploy-vllm-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS}" \ - silent-deploy-text-embeddings-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME_NAME='nvidia'" \ - silent-deploy-whisper-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME_NAME='nvidia'" + silent-deploy-text-embeddings-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME='nvidia'" \ + silent-deploy-whisper-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=GPU_RUNTIME='nvidia'" @echo "Deploying UI..." @$(MAKE) silent-deploy-ui-package ZARF_FLAGS="${ZARF_FLAGS} ${SILENT_ZARF_FLAGS} --set=MODEL='vllm'" @echo "All deployments completed" diff --git a/bundles/dev/cpu/uds-config.yaml b/bundles/dev/cpu/uds-config.yaml index 2c2dfbd9d..19cd00027 100644 --- a/bundles/dev/cpu/uds-config.yaml +++ b/bundles/dev/cpu/uds-config.yaml @@ -1,10 +1,10 @@ variables: text-embeddings: - GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster + gpu_runtime: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 whisper: - GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster + gpu_runtime: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 supabase: diff --git a/bundles/dev/gpu/uds-config.yaml b/bundles/dev/gpu/uds-config.yaml index 0d39b2632..9ad6cfdb4 100644 --- a/bundles/dev/gpu/uds-config.yaml +++ b/bundles/dev/gpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + gpu_runtime: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased whisper: - GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + gpu_runtime: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased vllm: diff --git a/bundles/latest/cpu/uds-config.yaml b/bundles/latest/cpu/uds-config.yaml index 3e0ccb54a..5caff096b 100644 --- a/bundles/latest/cpu/uds-config.yaml +++ b/bundles/latest/cpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster + gpu_runtime: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 whisper: - GPU_RUNTIME_NAME: "" # Leave blank if nvidia runtimeClass is not present in cluster + gpu_runtime: "" # Leave blank if nvidia runtimeClass is not present in cluster gpu_limit: 0 supabase: diff --git a/bundles/latest/gpu/uds-config.yaml b/bundles/latest/gpu/uds-config.yaml index 0d39b2632..9ad6cfdb4 100644 --- a/bundles/latest/gpu/uds-config.yaml +++ b/bundles/latest/gpu/uds-config.yaml @@ -1,11 +1,11 @@ # see individual zarf packaging configuration for more variables and variable descriptions variables: text-embeddings: - GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + gpu_runtime: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased whisper: - GPU_RUNTIME_NAME: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased + gpu_runtime: "nvidia" # Set to ensure the nvidia runtimeClass is present in case GPU limit is increased gpu_limit: 0 # runs on CPU until GPU limit is increased vllm: diff --git a/packages/text-embeddings/zarf.yaml b/packages/text-embeddings/zarf.yaml index 563d507b4..a413b53c9 100644 --- a/packages/text-embeddings/zarf.yaml +++ b/packages/text-embeddings/zarf.yaml @@ -16,7 +16,7 @@ variables: description: The GPU limit for the model inferencing. default: "0" pattern: "^[0-9]+$" - - name: GPU_RUNTIME_NAME + - name: GPU_RUNTIME description: The GPU class name for the model inferencing. Leave blank for CPU-only. default: "" pattern: "^(nvidia)?$" diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index 46bd6fbf5..fa2296f0a 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -18,7 +18,7 @@ env: - name: PUBLIC_SUPABASE_URL value: "https://supabase-kong.###ZARF_VAR_DOMAIN###" - name: PUBLIC_DISABLE_KEYCLOAK - value: "true" + value: "###ZARF_VAR_DISABLE_KEYCLOAK###" - name: PUBLIC_MESSAGE_LENGTH_LIMIT value: "10000" - name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 933985f50..3924beef5 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -16,7 +16,7 @@ variables: prompt: true sensitive: true - name: OPENAI_API_KEY - description: OpenAI API Key. If specified, app will use OpenAI instead of LeapfrogAI + description: OpenAI API key - if specified, the UI will use OpenAI instead of LeapfrogAI prompt: true default: "" sensitive: true diff --git a/packages/vllm/zarf.yaml b/packages/vllm/zarf.yaml index 881cb1e09..e31a79c0d 100644 --- a/packages/vllm/zarf.yaml +++ b/packages/vllm/zarf.yaml @@ -15,7 +15,7 @@ variables: description: The GPU limit for the model inferencing. Must be 1 or more. default: "1" pattern: "^[1-9][0-9]*$" - - name: GPU_RUNTIME_NAME + - name: GPU_RUNTIME description: The GPU runtime name for the model inferencing. default: "nvidia" pattern: "^(nvidia)?$" diff --git a/packages/whisper/zarf.yaml b/packages/whisper/zarf.yaml index 7bd134553..475bb8275 100644 --- a/packages/whisper/zarf.yaml +++ b/packages/whisper/zarf.yaml @@ -16,7 +16,7 @@ variables: description: The GPU limit for the model inferencing. default: "0" pattern: "^[0-9]+$" - - name: GPU_RUNTIME_NAME + - name: GPU_RUNTIME description: The GPU runtime name for the model inferencing. Leave blank for CPU-only. default: "" pattern: "^(nvidia)?$" From 65a68c3ded4dc7cfe18aa5417af97474b76aaab8 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 09:46:41 -0400 Subject: [PATCH 34/51] yaml server pointer corrected --- bundles/dev/cpu/uds-bundle.yaml | 2 +- bundles/dev/gpu/uds-bundle.yaml | 2 +- bundles/latest/cpu/uds-bundle.yaml | 2 +- bundles/latest/gpu/uds-bundle.yaml | 2 +- packages/api/common/zarf.yaml | 2 +- packages/api/zarf.yaml | 2 +- packages/llama-cpp-python/zarf.yaml | 2 +- packages/repeater/zarf.yaml | 2 ++ packages/supabase/zarf.yaml | 2 +- packages/text-embeddings/zarf.yaml | 2 +- packages/ui/zarf.yaml | 2 ++ packages/vllm/zarf.yaml | 2 +- packages/whisper/zarf.yaml | 2 +- 13 files changed, 15 insertions(+), 11 deletions(-) diff --git a/bundles/dev/cpu/uds-bundle.yaml b/bundles/dev/cpu/uds-bundle.yaml index 70574e34f..0df6fd4d9 100644 --- a/bundles/dev/cpu/uds-bundle.yaml +++ b/bundles/dev/cpu/uds-bundle.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/main/uds.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json kind: UDSBundle metadata: diff --git a/bundles/dev/gpu/uds-bundle.yaml b/bundles/dev/gpu/uds-bundle.yaml index 82b361708..c6205f0c4 100644 --- a/bundles/dev/gpu/uds-bundle.yaml +++ b/bundles/dev/gpu/uds-bundle.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/main/uds.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json kind: UDSBundle metadata: diff --git a/bundles/latest/cpu/uds-bundle.yaml b/bundles/latest/cpu/uds-bundle.yaml index 97d10ad27..879502693 100644 --- a/bundles/latest/cpu/uds-bundle.yaml +++ b/bundles/latest/cpu/uds-bundle.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/main/uds.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json kind: UDSBundle metadata: diff --git a/bundles/latest/gpu/uds-bundle.yaml b/bundles/latest/gpu/uds-bundle.yaml index 8ca74dcee..7b9b92111 100644 --- a/bundles/latest/gpu/uds-bundle.yaml +++ b/bundles/latest/gpu/uds-bundle.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/main/uds.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/uds.schema.json kind: UDSBundle metadata: diff --git a/packages/api/common/zarf.yaml b/packages/api/common/zarf.yaml index a4709c24a..c3e396eb0 100644 --- a/packages/api/common/zarf.yaml +++ b/packages/api/common/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: diff --git a/packages/api/zarf.yaml b/packages/api/zarf.yaml index fc1770ffa..b61017864 100644 --- a/packages/api/zarf.yaml +++ b/packages/api/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: diff --git a/packages/llama-cpp-python/zarf.yaml b/packages/llama-cpp-python/zarf.yaml index 45eb198f8..651ae2d34 100644 --- a/packages/llama-cpp-python/zarf.yaml +++ b/packages/llama-cpp-python/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: diff --git a/packages/repeater/zarf.yaml b/packages/repeater/zarf.yaml index 9fdf3f6ae..cc9b3335d 100644 --- a/packages/repeater/zarf.yaml +++ b/packages/repeater/zarf.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json + kind: ZarfPackageConfig metadata: name: repeater diff --git a/packages/supabase/zarf.yaml b/packages/supabase/zarf.yaml index 6b8e3796c..3c6d5c4f7 100644 --- a/packages/supabase/zarf.yaml +++ b/packages/supabase/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: name: supabase diff --git a/packages/text-embeddings/zarf.yaml b/packages/text-embeddings/zarf.yaml index a413b53c9..9684c2a25 100644 --- a/packages/text-embeddings/zarf.yaml +++ b/packages/text-embeddings/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: diff --git a/packages/ui/zarf.yaml b/packages/ui/zarf.yaml index 3924beef5..6194979d1 100644 --- a/packages/ui/zarf.yaml +++ b/packages/ui/zarf.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json + kind: ZarfPackageConfig metadata: name: leapfrogai-ui diff --git a/packages/vllm/zarf.yaml b/packages/vllm/zarf.yaml index e31a79c0d..9e4204825 100644 --- a/packages/vllm/zarf.yaml +++ b/packages/vllm/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: name: vllm diff --git a/packages/whisper/zarf.yaml b/packages/whisper/zarf.yaml index 475bb8275..63f6eedd2 100644 --- a/packages/whisper/zarf.yaml +++ b/packages/whisper/zarf.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/zarf-dev/zarf/main/zarf.schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/zarf.schema.json kind: ZarfPackageConfig metadata: From b30eaa36c7333968df600878b42e1a0ddb8cb04a Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 10:22:40 -0400 Subject: [PATCH 35/51] fix GPU Zarf Var in values files --- packages/repeater/chart/values.yaml | 5 ----- packages/text-embeddings/chart/values.yaml | 2 +- packages/text-embeddings/values/upstream-values.yaml | 2 +- packages/vllm/chart/values.yaml | 2 +- packages/vllm/values/upstream-values.yaml | 2 +- packages/whisper/chart/values.yaml | 2 +- packages/whisper/values/upstream-values.yaml | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index d1312da1b..c7bc7829f 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -57,8 +57,3 @@ strategy: rollingUpdate: maxUnavailable: 0 type: RollingUpdate - -persistence: - size: 15Gi - accessModes: ReadWriteOnce - storageClass: "local-path" diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index c1e5b5d33..145cc8991 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -67,7 +67,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" modelInjectionContainer: securityContext: diff --git a/packages/text-embeddings/values/upstream-values.yaml b/packages/text-embeddings/values/upstream-values.yaml index e70bee519..9751a67c1 100644 --- a/packages/text-embeddings/values/upstream-values.yaml +++ b/packages/text-embeddings/values/upstream-values.yaml @@ -3,7 +3,7 @@ image: tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### resources: limits: diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index 13fc6e39e..69198d7a7 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -67,7 +67,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" modelInjectionContainer: securityContext: diff --git a/packages/vllm/values/upstream-values.yaml b/packages/vllm/values/upstream-values.yaml index bab154e71..7b9b5c4d3 100644 --- a/packages/vllm/values/upstream-values.yaml +++ b/packages/vllm/values/upstream-values.yaml @@ -3,7 +3,7 @@ image: tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### resources: limits: diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index f7963f12e..1ee167f5d 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -73,7 +73,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME_NAME###" + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" modelInjectionContainer: securityContext: diff --git a/packages/whisper/values/upstream-values.yaml b/packages/whisper/values/upstream-values.yaml index 53b01515e..4aa583fce 100644 --- a/packages/whisper/values/upstream-values.yaml +++ b/packages/whisper/values/upstream-values.yaml @@ -3,7 +3,7 @@ image: tag: ###ZARF_CONST_IMAGE_VERSION### gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME_NAME### + runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### resources: limits: From a0ef92402fa06e37c5e585bb48363586a0d71b05 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 13:49:39 -0400 Subject: [PATCH 36/51] JPerr review fixes Sept 5 2024 1349 EST --- .github/workflows/docker-lint.yaml | 8 -------- .github/workflows/helm-lint.yaml | 8 -------- .github/workflows/uds-lint.yaml | 6 ------ .github/workflows/zarf-lint.yaml | 6 ------ packages/api/Dockerfile | 4 +--- packages/api/chart/templates/api/deployment.yaml | 2 +- packages/api/chart/templates/api/permissions.yaml | 6 +++--- packages/api/chart/templates/api/service.yaml | 2 +- packages/api/chart/templates/migration-job.yaml | 2 +- packages/api/chart/templates/uds-package.yaml | 2 +- packages/api/values/registry1-values.yaml | 8 ++++---- packages/api/values/upstream-values.yaml | 8 ++++---- .../llama-cpp-python/chart/templates/configmap.yaml | 2 +- .../llama-cpp-python/chart/templates/deployment.yaml | 2 +- packages/llama-cpp-python/chart/templates/pvc.yaml | 2 +- .../llama-cpp-python/chart/templates/service.yaml | 2 +- .../llama-cpp-python/values/upstream-values.yaml | 8 ++++---- packages/repeater/chart/templates/configmap.yaml | 2 +- packages/repeater/chart/templates/deployment.yaml | 2 +- packages/repeater/chart/templates/service.yaml | 2 +- packages/repeater/values/upstream-values.yaml | 8 ++++---- .../chart/templates/supabase-dashboard-secret.yaml | 2 +- .../chart/templates/supabase-realtime-secret.yaml | 2 +- .../text-embeddings/chart/templates/configmap.yaml | 2 +- .../text-embeddings/chart/templates/deployment.yaml | 2 +- packages/text-embeddings/chart/templates/pvc.yaml | 2 +- .../text-embeddings/chart/templates/service.yaml | 2 +- packages/text-embeddings/chart/values.yaml | 2 +- packages/text-embeddings/values/upstream-values.yaml | 12 ++++++------ packages/ui/chart/templates/migration-job.yaml | 2 +- packages/ui/chart/templates/uds-package.yaml | 2 +- packages/ui/chart/templates/ui/deployment.yaml | 2 +- packages/ui/chart/templates/ui/permissions.yaml | 2 +- packages/ui/chart/templates/ui/service.yaml | 4 ++-- packages/ui/chart/values.yaml | 4 ++-- packages/ui/values/upstream-values.yaml | 4 ++-- packages/vllm/chart/templates/configmap.yaml | 2 +- packages/vllm/chart/templates/deployment.yaml | 2 +- packages/vllm/chart/templates/pvc.yaml | 2 +- packages/vllm/chart/templates/service.yaml | 2 +- packages/vllm/chart/values.yaml | 2 +- packages/vllm/values/upstream-values.yaml | 12 ++++++------ packages/whisper/chart/templates/configmap.yaml | 2 +- packages/whisper/chart/templates/deployment.yaml | 2 +- packages/whisper/chart/templates/pvc.yaml | 2 +- packages/whisper/chart/templates/service.yaml | 2 +- packages/whisper/chart/values.yaml | 2 +- packages/whisper/values/upstream-values.yaml | 12 ++++++------ 48 files changed, 76 insertions(+), 106 deletions(-) diff --git a/.github/workflows/docker-lint.yaml b/.github/workflows/docker-lint.yaml index 8891d7732..c46e5557d 100644 --- a/.github/workflows/docker-lint.yaml +++ b/.github/workflows/docker-lint.yaml @@ -1,14 +1,6 @@ name: Docker Lint on: - push: - branches: - - "main" - paths: - - "**/Dockerfile" - - "**/Dockerfile.migrations" - - "**/.dockerignore" - - ".github/workflows/docker-lint.yaml" pull_request: branches: - "main" diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 7e6d6e2e1..14bd6b107 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -1,14 +1,6 @@ name: Helm Lint on: - push: - branches: - - "main" - paths: - - "**/chart" - - "**/values" - - "**/*values.yaml" - - ".github/workflows/helm-lint.yaml" pull_request: branches: - "main" diff --git a/.github/workflows/uds-lint.yaml b/.github/workflows/uds-lint.yaml index ebca3247e..5224775d4 100644 --- a/.github/workflows/uds-lint.yaml +++ b/.github/workflows/uds-lint.yaml @@ -1,12 +1,6 @@ name: UDS Lint on: - push: - branches: - - "main" - paths: - - "bundles/**" - - ".github/workflows/uds-lint.yaml" pull_request: branches: - "main" diff --git a/.github/workflows/zarf-lint.yaml b/.github/workflows/zarf-lint.yaml index 4c0271a12..4c3fb87d1 100644 --- a/.github/workflows/zarf-lint.yaml +++ b/.github/workflows/zarf-lint.yaml @@ -1,12 +1,6 @@ name: Zarf Lint on: - push: - branches: - - "main" - paths: - - "**/zarf.yaml" - - ".github/workflows/zarf-lint.yaml" pull_request: branches: - "main" diff --git a/packages/api/Dockerfile b/packages/api/Dockerfile index 151e44b0f..de2256e9a 100644 --- a/packages/api/Dockerfile +++ b/packages/api/Dockerfile @@ -21,10 +21,8 @@ RUN rm -f packages/api/build/*.whl && \ pip install packages/api/build/leapfrogai_api*.whl --no-index --find-links=packages/api/build/ FROM ghcr.io/defenseunicorns/leapfrogai/python:3.11 - -WORKDIR /leapfrogai - ENV PATH="/leapfrogai/.venv/bin:$PATH" +WORKDIR /leapfrogai COPY --from=builder /leapfrogai/.venv/ /leapfrogai/.venv/ diff --git a/packages/api/chart/templates/api/deployment.yaml b/packages/api/chart/templates/api/deployment.yaml index f2edaf765..3e4eb9949 100644 --- a/packages/api/chart/templates/api/deployment.yaml +++ b/packages/api/chart/templates/api/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/api/chart/templates/api/permissions.yaml b/packages/api/chart/templates/api/permissions.yaml index fcef3c2cb..933beb874 100644 --- a/packages/api/chart/templates/api/permissions.yaml +++ b/packages/api/chart/templates/api/permissions.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "chart.serviceAccountName" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} --- @@ -10,7 +10,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "chart.fullname" . }}-read-configmaps - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} rules: @@ -28,7 +28,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "chart.fullname" . }}-read-configmaps - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} roleRef: diff --git a/packages/api/chart/templates/api/service.yaml b/packages/api/chart/templates/api/service.yaml index 1f16d42fc..d0135ae05 100644 --- a/packages/api/chart/templates/api/service.yaml +++ b/packages/api/chart/templates/api/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "Load the OpenAPI specification for the LeapfrogAI API" zarf.dev/connect-url: "/docs" diff --git a/packages/api/chart/templates/migration-job.yaml b/packages/api/chart/templates/migration-job.yaml index be271cf22..74006cb5d 100644 --- a/packages/api/chart/templates/migration-job.yaml +++ b/packages/api/chart/templates/migration-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "chart.fullname" . }}-migrations-{{ .Values.api.migration.image.tag | default .Chart.AppVersion }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/api/chart/templates/uds-package.yaml b/packages/api/chart/templates/uds-package.yaml index 526106213..a6a83dea8 100644 --- a/packages/api/chart/templates/uds-package.yaml +++ b/packages/api/chart/templates/uds-package.yaml @@ -3,7 +3,7 @@ apiVersion: uds.dev/v1alpha1 kind: Package metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/api/values/registry1-values.yaml b/packages/api/values/registry1-values.yaml index 3d621359f..e4d8f23e9 100644 --- a/packages/api/values/registry1-values.yaml +++ b/packages/api/values/registry1-values.yaml @@ -2,10 +2,10 @@ api: image: repository: registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api # x-release-please-start-version - tag: v0.11.0 + tag: "v0.11.0" # x-release-please-end - expose: ###ZARF_VAR_EXPOSE_API### + expose: "###ZARF_VAR_EXPOSE_API###" env: - name: LFAI_LOG_LEVEL @@ -31,9 +31,9 @@ api: image: # TODO: replace with Ironbank image once hardened: registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api/migrations repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" kiwigrid: image: repository: registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar - tag: 1.23.3 + tag: "1.23.3" diff --git a/packages/api/values/upstream-values.yaml b/packages/api/values/upstream-values.yaml index b1923b390..35ca05168 100644 --- a/packages/api/values/upstream-values.yaml +++ b/packages/api/values/upstream-values.yaml @@ -1,9 +1,9 @@ api: image: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" - expose: ###ZARF_VAR_EXPOSE_API### + expose: "###ZARF_VAR_EXPOSE_API###" env: - name: LFAI_LOG_LEVEL @@ -28,9 +28,9 @@ api: migration: image: repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" kiwigrid: image: repository: kiwigrid/k8s-sidecar - tag: 1.23.3 + tag: "1.23.3" diff --git a/packages/llama-cpp-python/chart/templates/configmap.yaml b/packages/llama-cpp-python/chart/templates/configmap.yaml index 414c352ed..4f1ea76d3 100644 --- a/packages/llama-cpp-python/chart/templates/configmap.yaml +++ b/packages/llama-cpp-python/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: leapfrogai: sparkle data: diff --git a/packages/llama-cpp-python/chart/templates/deployment.yaml b/packages/llama-cpp-python/chart/templates/deployment.yaml index 1c4cd27bf..b70b2fb48 100644 --- a/packages/llama-cpp-python/chart/templates/deployment.yaml +++ b/packages/llama-cpp-python/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/llama-cpp-python/chart/templates/pvc.yaml b/packages/llama-cpp-python/chart/templates/pvc.yaml index 8041e6873..3902bc25e 100644 --- a/packages/llama-cpp-python/chart/templates/pvc.yaml +++ b/packages/llama-cpp-python/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/llama-cpp-python/chart/templates/service.yaml b/packages/llama-cpp-python/chart/templates/service.yaml index 959e70703..f49eb9f11 100644 --- a/packages/llama-cpp-python/chart/templates/service.yaml +++ b/packages/llama-cpp-python/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/llama-cpp-python/values/upstream-values.yaml b/packages/llama-cpp-python/values/upstream-values.yaml index 33c9a6d40..c0be9dd05 100644 --- a/packages/llama-cpp-python/values/upstream-values.yaml +++ b/packages/llama-cpp-python/values/upstream-values.yaml @@ -1,8 +1,8 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" persistence: - size: ###ZARF_VAR_PVC_SIZE### - accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### - storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### + size: "###ZARF_VAR_PVC_SIZE###" + accessModes: "###ZARF_VAR_PVC_ACCESS_MODE###" + storageClass: "###ZARF_VAR_PVC_STORAGE_CLASS###" diff --git a/packages/repeater/chart/templates/configmap.yaml b/packages/repeater/chart/templates/configmap.yaml index 414c352ed..4f1ea76d3 100644 --- a/packages/repeater/chart/templates/configmap.yaml +++ b/packages/repeater/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: leapfrogai: sparkle data: diff --git a/packages/repeater/chart/templates/deployment.yaml b/packages/repeater/chart/templates/deployment.yaml index c0ddd8d61..bc0f4591c 100644 --- a/packages/repeater/chart/templates/deployment.yaml +++ b/packages/repeater/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/repeater/chart/templates/service.yaml b/packages/repeater/chart/templates/service.yaml index 959e70703..f49eb9f11 100644 --- a/packages/repeater/chart/templates/service.yaml +++ b/packages/repeater/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/repeater/values/upstream-values.yaml b/packages/repeater/values/upstream-values.yaml index b182458a9..6c8fa7202 100644 --- a/packages/repeater/values/upstream-values.yaml +++ b/packages/repeater/values/upstream-values.yaml @@ -1,8 +1,8 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/repeater - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" persistence: - size: ###ZARF_VAR_PVC_SIZE### - accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### - storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### + size: "###ZARF_VAR_PVC_SIZE###" + accessModes: "###ZARF_VAR_PVC_ACCESS_MODE###" + storageClass: "###ZARF_VAR_PVC_STORAGE_CLASS###" diff --git a/packages/supabase/chart/templates/supabase-dashboard-secret.yaml b/packages/supabase/chart/templates/supabase-dashboard-secret.yaml index f945d18b3..f353de7ec 100644 --- a/packages/supabase/chart/templates/supabase-dashboard-secret.yaml +++ b/packages/supabase/chart/templates/supabase-dashboard-secret.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: supabase-dashboard-secret - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} {{- if $existingSecret }} annotations: "helm.sh/resource-policy": keep diff --git a/packages/supabase/chart/templates/supabase-realtime-secret.yaml b/packages/supabase/chart/templates/supabase-realtime-secret.yaml index 0cf4ca72a..4ca26e9b8 100644 --- a/packages/supabase/chart/templates/supabase-realtime-secret.yaml +++ b/packages/supabase/chart/templates/supabase-realtime-secret.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: supabase-realtime-extra - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} {{- if $existingSecret }} annotations: "helm.sh/resource-policy": keep diff --git a/packages/text-embeddings/chart/templates/configmap.yaml b/packages/text-embeddings/chart/templates/configmap.yaml index 414c352ed..4f1ea76d3 100644 --- a/packages/text-embeddings/chart/templates/configmap.yaml +++ b/packages/text-embeddings/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: leapfrogai: sparkle data: diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 8452aaeeb..0f6a18ed8 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/text-embeddings/chart/templates/pvc.yaml b/packages/text-embeddings/chart/templates/pvc.yaml index 8041e6873..3902bc25e 100644 --- a/packages/text-embeddings/chart/templates/pvc.yaml +++ b/packages/text-embeddings/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/text-embeddings/chart/templates/service.yaml b/packages/text-embeddings/chart/templates/service.yaml index 959e70703..f49eb9f11 100644 --- a/packages/text-embeddings/chart/templates/service.yaml +++ b/packages/text-embeddings/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index 145cc8991..cfc3b70d1 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -67,7 +67,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" + runtimeClassName: "" modelInjectionContainer: securityContext: diff --git a/packages/text-embeddings/values/upstream-values.yaml b/packages/text-embeddings/values/upstream-values.yaml index 9751a67c1..693cd8ac3 100644 --- a/packages/text-embeddings/values/upstream-values.yaml +++ b/packages/text-embeddings/values/upstream-values.yaml @@ -1,15 +1,15 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" resources: limits: - nvidia.com/gpu: ###ZARF_VAR_GPU_LIMIT### + nvidia.com/gpu: "###ZARF_VAR_GPU_LIMIT###" persistence: - size: ###ZARF_VAR_PVC_SIZE### - accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### - storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### + size: "###ZARF_VAR_PVC_SIZE###" + accessModes: "###ZARF_VAR_PVC_ACCESS_MODE###" + storageClass: "###ZARF_VAR_PVC_STORAGE_CLASS###" diff --git a/packages/ui/chart/templates/migration-job.yaml b/packages/ui/chart/templates/migration-job.yaml index eb29edccf..19344a320 100644 --- a/packages/ui/chart/templates/migration-job.yaml +++ b/packages/ui/chart/templates/migration-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "chart.fullname" . }}-migrations-{{ .Values.migration.image.tag | default .Chart.AppVersion }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/ui/chart/templates/uds-package.yaml b/packages/ui/chart/templates/uds-package.yaml index 3179f8767..aa6a7cbb3 100644 --- a/packages/ui/chart/templates/uds-package.yaml +++ b/packages/ui/chart/templates/uds-package.yaml @@ -2,7 +2,7 @@ apiVersion: uds.dev/v1alpha1 kind: Package metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/ui/chart/templates/ui/deployment.yaml b/packages/ui/chart/templates/ui/deployment.yaml index 99ea4919e..8111db0f4 100644 --- a/packages/ui/chart/templates/ui/deployment.yaml +++ b/packages/ui/chart/templates/ui/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/ui/chart/templates/ui/permissions.yaml b/packages/ui/chart/templates/ui/permissions.yaml index 0afa20585..f1e8f570e 100644 --- a/packages/ui/chart/templates/ui/permissions.yaml +++ b/packages/ui/chart/templates/ui/permissions.yaml @@ -2,6 +2,6 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "chart.serviceAccountName" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/packages/ui/chart/templates/ui/service.yaml b/packages/ui/chart/templates/ui/service.yaml index 9703ec3d7..15243e806 100644 --- a/packages/ui/chart/templates/ui/service.yaml +++ b/packages/ui/chart/templates/ui/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: app: {{ include "chart.fullname" . }} zarf.dev/connect-description: "Load the LeapfrogAI UI" @@ -23,6 +23,6 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "chart.serviceAccountName" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/packages/ui/chart/values.yaml b/packages/ui/chart/values.yaml index e1550bcbd..9be2389ef 100644 --- a/packages/ui/chart/values.yaml +++ b/packages/ui/chart/values.yaml @@ -2,7 +2,7 @@ image: repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui" pullPolicy: Always # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end service: @@ -66,7 +66,7 @@ migration: image: repository: ghcr.io/defenseunicorns/leapfrogai/ui-migrations # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end imagePullPolicy: Always diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index fa2296f0a..baf6ad7df 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -1,6 +1,6 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" env: - name: LEAPFROGAI_API_BASE_URL @@ -43,5 +43,5 @@ extraEnv: migration: image: repository: ghcr.io/defenseunicorns/leapfrogai/ui-migrations - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" imagePullPolicy: Always diff --git a/packages/vllm/chart/templates/configmap.yaml b/packages/vllm/chart/templates/configmap.yaml index 414c352ed..4f1ea76d3 100644 --- a/packages/vllm/chart/templates/configmap.yaml +++ b/packages/vllm/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: leapfrogai: sparkle data: diff --git a/packages/vllm/chart/templates/deployment.yaml b/packages/vllm/chart/templates/deployment.yaml index be5ba6458..7b88cc137 100644 --- a/packages/vllm/chart/templates/deployment.yaml +++ b/packages/vllm/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/vllm/chart/templates/pvc.yaml b/packages/vllm/chart/templates/pvc.yaml index 8041e6873..3902bc25e 100644 --- a/packages/vllm/chart/templates/pvc.yaml +++ b/packages/vllm/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/vllm/chart/templates/service.yaml b/packages/vllm/chart/templates/service.yaml index 959e70703..f49eb9f11 100644 --- a/packages/vllm/chart/templates/service.yaml +++ b/packages/vllm/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index 69198d7a7..d7d3c6cb2 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -67,7 +67,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" + runtimeClassName: "nvidia" modelInjectionContainer: securityContext: diff --git a/packages/vllm/values/upstream-values.yaml b/packages/vllm/values/upstream-values.yaml index 7b9b5c4d3..c78f0a8ce 100644 --- a/packages/vllm/values/upstream-values.yaml +++ b/packages/vllm/values/upstream-values.yaml @@ -1,15 +1,15 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/vllm - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" resources: limits: - nvidia.com/gpu: ###ZARF_VAR_GPU_LIMIT### + nvidia.com/gpu: "###ZARF_VAR_GPU_LIMIT###" persistence: - size: ###ZARF_VAR_PVC_SIZE### - accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### - storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### + size: "###ZARF_VAR_PVC_SIZE###" + accessModes: "###ZARF_VAR_PVC_ACCESS_MODE###" + storageClass: "###ZARF_VAR_PVC_STORAGE_CLASS###" diff --git a/packages/whisper/chart/templates/configmap.yaml b/packages/whisper/chart/templates/configmap.yaml index 414c352ed..4f1ea76d3 100644 --- a/packages/whisper/chart/templates/configmap.yaml +++ b/packages/whisper/chart/templates/configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Values.nameOverride }}-configmap" - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: leapfrogai: sparkle data: diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 713160fd1..741af1a05 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} labels: {{- include "chart.labels" . | nindent 4 }} spec: diff --git a/packages/whisper/chart/templates/pvc.yaml b/packages/whisper/chart/templates/pvc.yaml index 8041e6873..3902bc25e 100644 --- a/packages/whisper/chart/templates/pvc.yaml +++ b/packages/whisper/chart/templates/pvc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: lfai-{{ .Values.nameOverride }}-pv-claim - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} spec: {{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} diff --git a/packages/whisper/chart/templates/service.yaml b/packages/whisper/chart/templates/service.yaml index 959e70703..f49eb9f11 100644 --- a/packages/whisper/chart/templates/service.yaml +++ b/packages/whisper/chart/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "chart.fullname" . }} - namespace: {{ default "leapfrogai" .Release.Namespace }} + namespace: {{ .Release.Namespace | default "leapfrogai" }} annotations: zarf.dev/connect-description: "{{ .Values.nameOverride }} gRPC endpoint." labels: diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index 1ee167f5d..6bf833fd6 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -73,7 +73,7 @@ persistence: storageClass: "local-path" gpu: - runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" + runtimeClassName: "" modelInjectionContainer: securityContext: diff --git a/packages/whisper/values/upstream-values.yaml b/packages/whisper/values/upstream-values.yaml index 4aa583fce..880be0853 100644 --- a/packages/whisper/values/upstream-values.yaml +++ b/packages/whisper/values/upstream-values.yaml @@ -1,15 +1,15 @@ image: repository: ghcr.io/defenseunicorns/leapfrogai/whisper - tag: ###ZARF_CONST_IMAGE_VERSION### + tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: - runtimeClassName: ###ZARF_VAR_GPU_RUNTIME### + runtimeClassName: "###ZARF_VAR_GPU_RUNTIME###" resources: limits: - nvidia.com/gpu: ###ZARF_VAR_GPU_LIMIT### + nvidia.com/gpu: "###ZARF_VAR_GPU_LIMIT###" persistence: - size: ###ZARF_VAR_PVC_SIZE### - accessModes: ###ZARF_VAR_PVC_ACCESS_MODE### - storageClass: ###ZARF_VAR_PVC_STORAGE_CLASS### + size: "###ZARF_VAR_PVC_SIZE###" + accessModes: "###ZARF_VAR_PVC_ACCESS_MODE###" + storageClass: "###ZARF_VAR_PVC_STORAGE_CLASS###" From c464daf17d0f67d3654a8742be48626d5e9e8b3a Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 14:03:02 -0400 Subject: [PATCH 37/51] JPerr review fixes Sept 5 2024 1349 EST, pt.2 --- packages/api/chart/values.yaml | 14 +++++++------- packages/api/values/registry1-values.yaml | 6 +++--- packages/api/values/upstream-values.yaml | 4 ++-- packages/llama-cpp-python/chart/values.yaml | 6 +++--- .../llama-cpp-python/values/upstream-values.yaml | 2 +- packages/repeater/chart/values.yaml | 6 +++--- packages/repeater/values/upstream-values.yaml | 2 +- packages/text-embeddings/chart/values.yaml | 6 +++--- .../text-embeddings/values/upstream-values.yaml | 2 +- packages/ui/values/upstream-values.yaml | 2 +- packages/vllm/chart/values.yaml | 6 +++--- packages/vllm/values/upstream-values.yaml | 2 +- packages/whisper/chart/values.yaml | 6 +++--- packages/whisper/values/upstream-values.yaml | 2 +- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/api/chart/values.yaml b/packages/api/chart/values.yaml index c8a3e4822..5374bcf4d 100644 --- a/packages/api/chart/values.yaml +++ b/packages/api/chart/values.yaml @@ -2,9 +2,9 @@ api: expose: true image: - repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api + repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api" # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end imagePullPolicy: Always @@ -40,14 +40,14 @@ api: port: 8080 serviceAccount: - name: leapfrogai-api + name: "leapfrogai-api" create: true migration: image: - repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations + repository: "ghcr.io/defenseunicorns/leapfrogai/api-migrations" # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end imagePullPolicy: Always @@ -68,8 +68,8 @@ api: kiwigrid: image: - repository: kiwigrid/k8s-sidecar - tag: 1.23.3 + repository: "kiwigrid/k8s-sidecar" + tag: "1.23.3" imagePullPolicy: Always securityContext: diff --git a/packages/api/values/registry1-values.yaml b/packages/api/values/registry1-values.yaml index e4d8f23e9..79df0504b 100644 --- a/packages/api/values/registry1-values.yaml +++ b/packages/api/values/registry1-values.yaml @@ -1,6 +1,6 @@ api: image: - repository: registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api + repository: "registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api" # x-release-please-start-version tag: "v0.11.0" # x-release-please-end @@ -30,10 +30,10 @@ api: migration: image: # TODO: replace with Ironbank image once hardened: registry1.dso.mil/ironbank/opensource/defenseunicorns/leapfrogai/api/migrations - repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations + repository: "ghcr.io/defenseunicorns/leapfrogai/api-migrations" tag: "###ZARF_CONST_IMAGE_VERSION###" kiwigrid: image: - repository: registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar + repository: "registry1.dso.mil/ironbank/kiwigrid/k8s-sidecar" tag: "1.23.3" diff --git a/packages/api/values/upstream-values.yaml b/packages/api/values/upstream-values.yaml index 35ca05168..6d867260e 100644 --- a/packages/api/values/upstream-values.yaml +++ b/packages/api/values/upstream-values.yaml @@ -1,6 +1,6 @@ api: image: - repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api + repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-api" tag: "###ZARF_CONST_IMAGE_VERSION###" expose: "###ZARF_VAR_EXPOSE_API###" @@ -27,7 +27,7 @@ api: migration: image: - repository: ghcr.io/defenseunicorns/leapfrogai/api-migrations + repository: "ghcr.io/defenseunicorns/leapfrogai/api-migrations" tag: "###ZARF_CONST_IMAGE_VERSION###" kiwigrid: diff --git a/packages/llama-cpp-python/chart/values.yaml b/packages/llama-cpp-python/chart/values.yaml index 23ce8b130..ea2692f30 100644 --- a/packages/llama-cpp-python/chart/values.yaml +++ b/packages/llama-cpp-python/chart/values.yaml @@ -3,14 +3,14 @@ # Declare variables to be passed into your templates. image: - repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python + repository: "ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python" pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end -nameOverride: llama-cpp-python +nameOverride: "llama-cpp-python" fullnameOverride: "" env: diff --git a/packages/llama-cpp-python/values/upstream-values.yaml b/packages/llama-cpp-python/values/upstream-values.yaml index c0be9dd05..ef454d350 100644 --- a/packages/llama-cpp-python/values/upstream-values.yaml +++ b/packages/llama-cpp-python/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python + repository: "ghcr.io/defenseunicorns/leapfrogai/llama-cpp-python" tag: "###ZARF_CONST_IMAGE_VERSION###" persistence: diff --git a/packages/repeater/chart/values.yaml b/packages/repeater/chart/values.yaml index c7bc7829f..87e7575f5 100644 --- a/packages/repeater/chart/values.yaml +++ b/packages/repeater/chart/values.yaml @@ -3,14 +3,14 @@ # Declare variables to be passed into your templates. image: - repository: ghcr.io/defenseunicorns/leapfrogai/repeater + repository: "ghcr.io/defenseunicorns/leapfrogai/repeater" pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end -nameOverride: repeater +nameOverride: "repeater" fullnameOverride: "" podSecurityContext: diff --git a/packages/repeater/values/upstream-values.yaml b/packages/repeater/values/upstream-values.yaml index 6c8fa7202..c14927d55 100644 --- a/packages/repeater/values/upstream-values.yaml +++ b/packages/repeater/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/repeater + repository: "ghcr.io/defenseunicorns/leapfrogai/repeater" tag: "###ZARF_CONST_IMAGE_VERSION###" persistence: diff --git a/packages/text-embeddings/chart/values.yaml b/packages/text-embeddings/chart/values.yaml index cfc3b70d1..bc7ff8b0b 100644 --- a/packages/text-embeddings/chart/values.yaml +++ b/packages/text-embeddings/chart/values.yaml @@ -3,14 +3,14 @@ # Declare variables to be passed into your templates. image: - repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings + repository: "ghcr.io/defenseunicorns/leapfrogai/text-embeddings" pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end -nameOverride: text-embeddings +nameOverride: "text-embeddings" fullnameOverride: "" env: diff --git a/packages/text-embeddings/values/upstream-values.yaml b/packages/text-embeddings/values/upstream-values.yaml index 693cd8ac3..d84d61162 100644 --- a/packages/text-embeddings/values/upstream-values.yaml +++ b/packages/text-embeddings/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/text-embeddings + repository: "ghcr.io/defenseunicorns/leapfrogai/text-embeddings" tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: diff --git a/packages/ui/values/upstream-values.yaml b/packages/ui/values/upstream-values.yaml index baf6ad7df..119b2258d 100644 --- a/packages/ui/values/upstream-values.yaml +++ b/packages/ui/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui + repository: "ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui" tag: "###ZARF_CONST_IMAGE_VERSION###" env: diff --git a/packages/vllm/chart/values.yaml b/packages/vllm/chart/values.yaml index d7d3c6cb2..f52b59847 100644 --- a/packages/vllm/chart/values.yaml +++ b/packages/vllm/chart/values.yaml @@ -3,14 +3,14 @@ # Declare variables to be passed into your templates. image: - repository: ghcr.io/defenseunicorns/leapfrogai/vllm + repository: "ghcr.io/defenseunicorns/leapfrogai/vllm" pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end -nameOverride: vllm +nameOverride: "vllm" fullnameOverride: "" env: diff --git a/packages/vllm/values/upstream-values.yaml b/packages/vllm/values/upstream-values.yaml index c78f0a8ce..0fe581bdd 100644 --- a/packages/vllm/values/upstream-values.yaml +++ b/packages/vllm/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/vllm + repository: "ghcr.io/defenseunicorns/leapfrogai/vllm" tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: diff --git a/packages/whisper/chart/values.yaml b/packages/whisper/chart/values.yaml index 6bf833fd6..27bf8b85d 100644 --- a/packages/whisper/chart/values.yaml +++ b/packages/whisper/chart/values.yaml @@ -3,14 +3,14 @@ # Declare variables to be passed into your templates. image: - repository: ghcr.io/defenseunicorns/leapfrogai/whisper + repository: "ghcr.io/defenseunicorns/leapfrogai/whisper" pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. # x-release-please-start-version - tag: 0.11.0 + tag: "0.11.0" # x-release-please-end -nameOverride: whisper +nameOverride: "whisper" fullnameOverride: "" env: diff --git a/packages/whisper/values/upstream-values.yaml b/packages/whisper/values/upstream-values.yaml index 880be0853..3317a8816 100644 --- a/packages/whisper/values/upstream-values.yaml +++ b/packages/whisper/values/upstream-values.yaml @@ -1,5 +1,5 @@ image: - repository: ghcr.io/defenseunicorns/leapfrogai/whisper + repository: "ghcr.io/defenseunicorns/leapfrogai/whisper" tag: "###ZARF_CONST_IMAGE_VERSION###" gpu: From eb2505417a07b5ff1fcfd7a0698321d6d2c4d1c9 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Thu, 5 Sep 2024 17:53:21 -0400 Subject: [PATCH 38/51] remove extra workdir --- src/leapfrogai_ui/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/leapfrogai_ui/Dockerfile b/src/leapfrogai_ui/Dockerfile index 2ca352e3f..50a4fbbfa 100644 --- a/src/leapfrogai_ui/Dockerfile +++ b/src/leapfrogai_ui/Dockerfile @@ -10,8 +10,6 @@ ENV PATH=${JAVA_HOME}/bin:$PATH WORKDIR /app -WORKDIR /app - COPY . . RUN npm ci From 35b34b49385129a72bbe79fa1bfafeda876cb39b Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 09:18:41 -0400 Subject: [PATCH 39/51] helm templating and e2e test fixes --- .github/workflows/e2e-registry1-weekly.yaml | 2 ++ .../text-embeddings/chart/templates/deployment.yaml | 11 ++++++++--- packages/whisper/chart/templates/deployment.yaml | 11 ++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 352501b81..d4791022f 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -97,6 +97,8 @@ jobs: - name: Run Backend Tests env: ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} + # this variable is named differently in backend tests as compared to backend tests + SERVICE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_ROLE_KEY }} run: | python -m pytest ./tests/e2e/test_llama.py -v python -m pytest ./tests/e2e/test_text_embeddings.py -v diff --git a/packages/text-embeddings/chart/templates/deployment.yaml b/packages/text-embeddings/chart/templates/deployment.yaml index 0f6a18ed8..8f4adde05 100644 --- a/packages/text-embeddings/chart/templates/deployment.yaml +++ b/packages/text-embeddings/chart/templates/deployment.yaml @@ -24,10 +24,15 @@ spec: app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: - {{- if gt (index .Values.resources.limits "nvidia.com/gpu") 0.0 }} - runtimeClassName: nvidia + # handle the case where limit is a number or a string, else comparison fails on helm install + {{- $gpuLimit := index .Values.resources.limits "nvidia.com/gpu" }} + {{- if kindIs "string" $gpuLimit }} + {{- $gpuLimit = $gpuLimit | float64 }} + {{- end }} + {{- if gt $gpuLimit 0.0 }} + runtimeClassName: nvidia {{- else if .Values.gpu.runtimeClassName }} - runtimeClassName: {{ .Values.gpu.runtimeClassName }} + runtimeClassName: {{ .Values.gpu.runtimeClassName }} {{- end }} # It's necessary to include the ###ZARF_DATA_INJECTION_MARKER### somewhere in the podspec, otherwise data injections will not occur. initContainers: diff --git a/packages/whisper/chart/templates/deployment.yaml b/packages/whisper/chart/templates/deployment.yaml index 741af1a05..e9a4df2c9 100644 --- a/packages/whisper/chart/templates/deployment.yaml +++ b/packages/whisper/chart/templates/deployment.yaml @@ -24,10 +24,15 @@ spec: app: lfai-{{ .Values.nameOverride }} {{- include "chart.selectorLabels" . | nindent 8 }} spec: - {{- if gt (index .Values.resources.limits "nvidia.com/gpu") 0.0 }} - runtimeClassName: nvidia + # handle the case where limit is a number or a string, else comparison fails on helm install + {{- $gpuLimit := index .Values.resources.limits "nvidia.com/gpu" }} + {{- if kindIs "string" $gpuLimit }} + {{- $gpuLimit = $gpuLimit | float64 }} + {{- end }} + {{- if gt $gpuLimit 0.0 }} + runtimeClassName: nvidia {{- else if .Values.gpu.runtimeClassName }} - runtimeClassName: {{ .Values.gpu.runtimeClassName }} + runtimeClassName: {{ .Values.gpu.runtimeClassName }} {{- end }} # It's necessary to include the ###ZARF_DATA_INJECTION_MARKER### somewhere in the podspec, otherwise data injections will not occur. initContainers: From c93918f3a7024cba5641773c760cf7210e8c6cb8 Mon Sep 17 00:00:00 2001 From: Justin Law <81255462+justinthelaw@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:19:36 -0400 Subject: [PATCH 40/51] typo in comment e2e registry1 --- .github/workflows/e2e-registry1-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index d4791022f..d47f5cb21 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -97,7 +97,7 @@ jobs: - name: Run Backend Tests env: ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} - # this variable is named differently in backend tests as compared to backend tests + # this variable is named differently in backend tests as compared to playwright tests SERVICE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_ROLE_KEY }} run: | python -m pytest ./tests/e2e/test_llama.py -v From 733c81d5b7da7da38ba266256b754c7942a16a28 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 10:00:11 -0400 Subject: [PATCH 41/51] pin registry1 weekly git checkout --- .github/release-please-config.json | 5 +++++ .github/workflows/e2e-registry1-weekly.yaml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 6cf564cdb..4458cae05 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -45,6 +45,11 @@ "type": "generic", "path": "**/hugo.toml", "glob": true + }, + { + "type": "generic", + "path": ".github/workflows/e2e-registry1-weekly.yaml", + "glob": true } ] } diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index d47f5cb21..aad6037d6 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -37,6 +37,10 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # x-release-please-start-version + ref: "0.11.0" + # x-release-please-end - name: Setup Python uses: ./.github/actions/python From e788eaa8427eacc3e0381a9e89bad7522737408e Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 10:07:37 -0400 Subject: [PATCH 42/51] version with the v --- .github/workflows/e2e-registry1-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index aad6037d6..9519a0236 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: # x-release-please-start-version - ref: "0.11.0" + ref: "v0.11.0" # x-release-please-end - name: Setup Python From 8c55debe75483f4473e13896c4ad1a1b89b08e45 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 10:42:27 -0400 Subject: [PATCH 43/51] uds-cluster action hardcode --- .github/workflows/e2e-registry1-weekly.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 9519a0236..914b592b3 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -45,12 +45,19 @@ jobs: - name: Setup Python uses: ./.github/actions/python - - name: Setup UDS Cluster - uses: ./.github/actions/uds-cluster + # TODO: remove hardcoded uds-cluster action due to incorrect usage in v0.11.0 + - name: Setup UDS Environment + uses: defenseunicorns/uds-common/.github/actions/setup@822dac4452e6815aadcf09f487406ff258756a0c # v0.14.0 with: registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} ghToken: ${{ secrets.GITHUB_TOKEN }} + udsCliVersion: 0.14.0 + + - name: Create UDS Cluster + shell: bash + run: | + UDS_CONFIG=.github/config/uds-config.yaml make create-uds-cpu-cluster - name: Setup Playwright run: | From fc573a369e8d466bbeef7ca66fb957ea3b8903d4 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 10:56:09 -0400 Subject: [PATCH 44/51] revert e2e registry1 to 0.11.0 state --- .github/workflows/e2e-registry1-weekly.yaml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 914b592b3..0b2b2c816 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -57,7 +57,7 @@ jobs: - name: Create UDS Cluster shell: bash run: | - UDS_CONFIG=.github/config/uds-config.yaml make create-uds-cpu-cluster + make create-uds-cpu-cluster - name: Setup Playwright run: | @@ -80,36 +80,25 @@ jobs: run: | cd bundles/latest/cpu uds create . --confirm && \ - uds deploy uds-bundle-leapfrogai-amd64-registry1.tar.zst \ - --set LEAPFROGAI_API_BASE_URL="http://leapfrogai-api.leapfrogai.svc.cluster.local:8080" --confirm --no-progress && \ + uds deploy uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ rm -rf uds-bundle-leapfrogai-amd64-registry1.tar.zst && \ docker system prune -af - name: Generate Secrets id: generate_secrets run: | - PASSWORD=$(cat <(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9!@#$%^&*()_+-=[]{}|;:,.<>?' | head -c 20) <(echo '!@1Aa') | fold -w1 | shuf | tr -d '\n') - echo "::add-mask::$PASSWORD" - echo "FAKE_E2E_USER_PASSWORD=$PASSWORD" >> $GITHUB_OUTPUT ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d) echo "::add-mask::$ANON_KEY" echo "ANON_KEY=$ANON_KEY" >> $GITHUB_OUTPUT - SERVICE_ROLE_KEY=$(uds zarf tools kubectl get secret -n leapfrogai supabase-bootstrap-jwt -o jsonpath={.data.service-key} | base64 -d) - echo "::add-mask::$SERVICE_ROLE_KEY" - echo "SERVICE_ROLE_KEY=$SERVICE_ROLE_KEY" >> $GITHUB_OUTPUT - name: Verify Secrets run: | - echo "FAKE_E2E_USER_PASSWORD is set: ${{ steps.generate_secrets.outputs.FAKE_E2E_USER_PASSWORD != '' }}" echo "ANON_KEY is set: ${{ steps.generate_secrets.outputs.ANON_KEY != '' }}" - echo "SERVICE_ROLE_KEY is set: ${{ steps.generate_secrets.outputs.SERVICE_ROLE_KEY != '' }}" # Backends - name: Run Backend Tests env: ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} - # this variable is named differently in backend tests as compared to playwright tests - SERVICE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_ROLE_KEY }} run: | python -m pytest ./tests/e2e/test_llama.py -v python -m pytest ./tests/e2e/test_text_embeddings.py -v @@ -130,7 +119,7 @@ jobs: mkdir -p playwright/auth touch playwright/auth.user.json - SERVICE_ROLE_KEY=$SERVICE_ROLE_KEY TEST_ENV=CI USERNAME=doug PASSWORD=$FAKE_E2E_USER_PASSWORD PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci - name: Archive Playwright Report uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 From bf83d0181c6dd2f2afbc6d6f6e8228e004d69de6 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 11:12:37 -0400 Subject: [PATCH 45/51] more 0.11.0 shennanigans --- .github/workflows/e2e-registry1-weekly.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 0b2b2c816..0a4be43af 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -70,11 +70,12 @@ jobs: # Mutate UDS bundle definition to use Registry1 packages - name: Mutation to Registry1 Bundle + # TODO: fix bundle path run: | - uds zarf tools yq -i '.packages[1] |= del(.repository)' bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.packages[1] |= .ref = "registry1"' bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.packages[1] |= .path = "../../../packages/api"' bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.metadata.version = "registry1"' bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= del(.repository)' uds-bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= .ref = "registry1"' uds-bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= .path = "../../../packages/api"' uds-bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.metadata.version = "registry1"' uds-bundles/latest/cpu/uds-bundle.yaml - name: Create and Deploy Bundle run: | @@ -108,13 +109,8 @@ jobs: - name: Run Playwright E2E Tests env: - SERVICE_ROLE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_ROLE_KEY }} - FAKE_E2E_USER_PASSWORD: ${{ steps.generate_secrets.outputs.FAKE_E2E_USER_PASSWORD }} ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} run: | - chmod +x ./.github/scripts/createUser.sh - ./.github/scripts/createUser.sh - cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env mkdir -p playwright/auth touch playwright/auth.user.json From b0c9e280dc9c28131f2bb03da81d5cd6b9297646 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 11:15:11 -0400 Subject: [PATCH 46/51] more 0.11.0 workarounds --- .github/workflows/e2e-registry1-weekly.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 0a4be43af..2ce0836a4 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -112,8 +112,6 @@ jobs: ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - mkdir -p playwright/auth - touch playwright/auth.user.json TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci From 2e64f07ddb7b8324568451a038866c4cac67c78b Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 11:26:19 -0400 Subject: [PATCH 47/51] more 0.11.0 workarounds, pt.2 --- .github/workflows/e2e-registry1-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 2ce0836a4..080a91e70 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -79,7 +79,7 @@ jobs: - name: Create and Deploy Bundle run: | - cd bundles/latest/cpu + cd uds-bundles/latest/cpu uds create . --confirm && \ uds deploy uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ rm -rf uds-bundle-leapfrogai-amd64-registry1.tar.zst && \ From d93b3e6cb4a88bb685043d7075f4a2c6924e1164 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Fri, 6 Sep 2024 12:06:11 -0400 Subject: [PATCH 48/51] disable keycloak again --- .github/workflows/e2e-registry1-weekly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 080a91e70..6a132651f 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -81,7 +81,7 @@ jobs: run: | cd uds-bundles/latest/cpu uds create . --confirm && \ - uds deploy uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ + uds deploy --set DISABLE_KEYCLOAK=true uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ rm -rf uds-bundle-leapfrogai-amd64-registry1.tar.zst && \ docker system prune -af From 95b652de8cda242a2f1d46f545f095c0d16d8fd5 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Sat, 7 Sep 2024 12:42:47 -0400 Subject: [PATCH 49/51] fix registry1 weekly bunlde pointer --- .github/workflows/e2e-registry1-weekly.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index 124b73c83..db1092f0b 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -72,14 +72,14 @@ jobs: - name: Mutation to Registry1 Bundle # TODO: fix bundle path run: | - uds zarf tools yq -i '.packages[1] |= del(.repository)' uds-bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.packages[1] |= .ref = "registry1"' uds-bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.packages[1] |= .path = "../../../packages/api"' uds-bundles/latest/cpu/uds-bundle.yaml - uds zarf tools yq -i '.metadata.version = "registry1"' uds-bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= del(.repository)' bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= .ref = "registry1"' bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.packages[1] |= .path = "../../../packages/api"' bundles/latest/cpu/uds-bundle.yaml + uds zarf tools yq -i '.metadata.version = "registry1"' bundles/latest/cpu/uds-bundle.yaml - name: Create and Deploy Bundle run: | - cd uds-bundles/latest/cpu + cd bundles/latest/cpu uds create . --confirm && \ uds deploy --set DISABLE_KEYCLOAK=true uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ rm -rf uds-bundle-leapfrogai-amd64-registry1.tar.zst && \ From 9ab5658a832e26bc95334815840eb81430c80840 Mon Sep 17 00:00:00 2001 From: Justin Law <81255462+justinthelaw@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:24:19 -0400 Subject: [PATCH 50/51] typo in text-embeddings comments --- packages/text-embeddings/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/text-embeddings/Dockerfile b/packages/text-embeddings/Dockerfile index 68652fdb7..2a8919f3a 100644 --- a/packages/text-embeddings/Dockerfile +++ b/packages/text-embeddings/Dockerfile @@ -12,7 +12,7 @@ RUN python3.11 -m venv .venv ENV PATH="/leapfrogai/.venv/bin:$PATH" # copy and install all python dependencies -# NOTE: We are copying the leapfrog whl to this filename because installing 'optional extras' from +# NOTE: We are copying the leapfrogai whl to this filename because installing 'optional extras' from # a wheel requires the absolute path to the wheel file (instead of a wildcard whl) COPY --from=sdk /leapfrogai/${SDK_DEST} ${SDK_DEST} COPY packages/text-embeddings packages/text-embeddings From 2893f7c2a6f369b34a9f28bce43a7bad3e648652 Mon Sep 17 00:00:00 2001 From: Justin Law Date: Tue, 10 Sep 2024 13:23:02 -0400 Subject: [PATCH 51/51] merge origin main, 0.12.2 registry1 published --- .github/workflows/e2e-registry1-weekly.yaml | 51 +++++++++++++++++---- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-registry1-weekly.yaml b/.github/workflows/e2e-registry1-weekly.yaml index db1092f0b..588128984 100644 --- a/.github/workflows/e2e-registry1-weekly.yaml +++ b/.github/workflows/e2e-registry1-weekly.yaml @@ -57,7 +57,7 @@ jobs: - name: Create UDS Cluster shell: bash run: | - make create-uds-cpu-cluster + UDS_CONFIG=.github/config/uds-config.yaml make create-uds-cpu-cluster - name: Setup Playwright run: | @@ -81,7 +81,7 @@ jobs: run: | cd bundles/latest/cpu uds create . --confirm && \ - uds deploy --set DISABLE_KEYCLOAK=true uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ + uds deploy uds-bundle-leapfrogai-amd64-registry1.tar.zst --confirm --no-progress && \ rm -rf uds-bundle-leapfrogai-amd64-registry1.tar.zst && \ docker system prune -af @@ -91,29 +91,62 @@ jobs: ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d) echo "::add-mask::$ANON_KEY" echo "ANON_KEY=$ANON_KEY" >> $GITHUB_OUTPUT + FAKE_PASSWORD=$(cat <(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9!@#$%^&*()_+-=[]{}|;:,.<>?' | head -c 20) <(echo '!@1Aa') | fold -w1 | shuf | tr -d '\n') + echo "::add-mask::$FAKE_PASSWORD" + echo "FAKE_PASSWORD=$FAKE_PASSWORD" >> $GITHUB_OUTPUT + SERVICE_KEY=$(uds zarf tools kubectl get secret -n leapfrogai supabase-bootstrap-jwt -o jsonpath={.data.service-key} | base64 -d) + echo "::add-mask::$SERVICE_KEY" + echo "SERVICE_KEY=$SERVICE_KEY" >> $GITHUB_OUTPUT - name: Verify Secrets run: | + echo "FAKE_PASSWORD is set: ${{ steps.generate_secrets.outputs.FAKE_PASSWORD != '' }}" echo "ANON_KEY is set: ${{ steps.generate_secrets.outputs.ANON_KEY != '' }}" + echo "SERVICE_KEY is set: ${{ steps.generate_secrets.outputs.SERVICE_KEY != '' }}" + + # TODO: enable for post-0.12.2 release of LeapfrogAI + # - name: Run Integration Tests + # if: github.sha == 'YOUR_SPECIFIC_COMMIT_SHA' + # env: + # SUPABASE_ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} + # SUPABASE_PASS: ${{ steps.generate_secrets.outputs.FAKE_PASSWORD }} + # SUPABASE_EMAIL: integration@uds.dev + # SUPABASE_URL: https://supabase-kong.uds.dev + # # Turn off NIAH tests that are not applicable for integration testing using the Repeater model + # LFAI_RUN_NIAH_TESTS: "false" + # run: | + # uds zarf connect --name=llama-cpp-python-model --namespace=leapfrogai --local-port=50051 --remote-port=50051 & + # while ! nc -z localhost 50051; do sleep 1; done + + # make test-user-pipeline + # env $(cat .env | xargs) python -m pytest -v -s tests/integration/api # Backends - - name: Run Backend Tests + - name: Run Backend E2E Tests env: ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} + SERVICE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_KEY }} run: | - python -m pytest ./tests/e2e/test_llama.py -v - python -m pytest ./tests/e2e/test_text_embeddings.py -v - python -m pytest ./tests/e2e/test_whisper.py -v - python -m pytest ./tests/e2e/test_supabase.py -v - python -m pytest ./tests/e2e/test_api.py -v + python -m pytest ./tests/e2e/test_llama.py -vv + python -m pytest ./tests/e2e/test_text_embeddings.py -vv + python -m pytest ./tests/e2e/test_whisper.py -vv + python -m pytest ./tests/e2e/test_supabase.py -vv + python -m pytest ./tests/e2e/test_api.py -vv - name: Run Playwright E2E Tests env: + SERVICE_ROLE_KEY: ${{ steps.generate_secrets.outputs.SERVICE_KEY }} + FAKE_E2E_USER_PASSWORD: ${{ steps.generate_secrets.outputs.FAKE_PASSWORD }} ANON_KEY: ${{ steps.generate_secrets.outputs.ANON_KEY }} run: | + chmod +x ./.github/scripts/createUser.sh + ./.github/scripts/createUser.sh + cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env + mkdir -p playwright/auth + touch playwright/auth.user.json - TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci + SERVICE_ROLE_KEY=$SERVICE_ROLE_KEY TEST_ENV=CI USERNAME=doug PASSWORD=$FAKE_E2E_USER_PASSWORD PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci - name: Archive Playwright Report uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6