mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
💾 feat: Add Memory Configuration Options for CI unit tests
- responding to PR feedback from Copilot
This commit is contained in:
parent
b8fe41e59d
commit
ef8f27122e
5 changed files with 12 additions and 8 deletions
|
|
@ -72,8 +72,12 @@ DEBUG_CONSOLE=false
|
||||||
# Node Options #
|
# Node Options #
|
||||||
#==============#
|
#==============#
|
||||||
|
|
||||||
# Used to adjust Node.js memory configuration (default: 6144 MiB)
|
# NOTE: NODE_MAX_OLD_SPACE_SIZE is NOT recognized by Node.js directly.
|
||||||
# https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-mib
|
# This variable is used as a build argument for Docker or CI/CD workflows,
|
||||||
|
# and is NOT used by Node.js to set the heap size at runtime.
|
||||||
|
# To configure Node.js memory, use NODE_OPTIONS, e.g.:
|
||||||
|
# NODE_OPTIONS="--max-old-space-size=6144"
|
||||||
|
# See: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-mib
|
||||||
NODE_MAX_OLD_SPACE_SIZE=6144
|
NODE_MAX_OLD_SPACE_SIZE=6144
|
||||||
|
|
||||||
#===============#
|
#===============#
|
||||||
|
|
|
||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- run: |
|
- run: |
|
||||||
docker build --build-arg RUNNER_VERSION=${{ env.RUNNER_VERSION }} --build-arg NODE_MAX_OLD_SPACE_SIZE=${{ secrets.NODE_MAX_OLD_SPACE_SIZE || 6144 }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/pwd9000-github-runner-lin:${{ env.RUNNER_VERSION }} .
|
docker build --build-arg RUNNER_VERSION=${{ env.RUNNER_VERSION }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/pwd9000-github-runner-lin:${{ env.RUNNER_VERSION }} .
|
||||||
|
|
||||||
- name: 'Push container image to ACR'
|
- name: 'Push container image to ACR'
|
||||||
uses: azure/docker-login@v1
|
uses: azure/docker-login@v1
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
# Dockerfile.multi
|
# Dockerfile.multi
|
||||||
# v0.8.1
|
# v0.8.1
|
||||||
|
|
||||||
|
# Set configurable max-old-space-size with default
|
||||||
|
ARG NODE_MAX_OLD_SPACE_SIZE=6144
|
||||||
|
|
||||||
# Base for all builds
|
# Base for all builds
|
||||||
FROM node:20-alpine AS base-min
|
FROM node:20-alpine AS base-min
|
||||||
# Install jemalloc
|
# Install jemalloc
|
||||||
|
|
@ -8,9 +11,6 @@ RUN apk add --no-cache jemalloc
|
||||||
# Set environment variable to use jemalloc
|
# Set environment variable to use jemalloc
|
||||||
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
||||||
|
|
||||||
# Set configurable max-old-space-size with default
|
|
||||||
ARG NODE_MAX_OLD_SPACE_SIZE=6144
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk --no-cache add curl
|
RUN apk --no-cache add curl
|
||||||
RUN npm config set fetch-retry-maxtimeout 600000 && \
|
RUN npm config set fetch-retry-maxtimeout 600000 && \
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,6 @@ BAN_VIOLATIONS=true
|
||||||
BAN_DURATION=7200000
|
BAN_DURATION=7200000
|
||||||
BAN_INTERVAL=20
|
BAN_INTERVAL=20
|
||||||
|
|
||||||
|
# NODE_MAX_OLD_SPACE_SIZE is only used as a Docker build argument.
|
||||||
|
# Node.js does NOT recognize this environment variable for heap size.
|
||||||
NODE_MAX_OLD_SPACE_SIZE=6144
|
NODE_MAX_OLD_SPACE_SIZE=6144
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,3 @@ process.env.ALLOW_EMAIL_LOGIN = 'true';
|
||||||
// This can be overridden in individual tests if needed
|
// This can be overridden in individual tests if needed
|
||||||
jest.setTimeout(30000);
|
jest.setTimeout(30000);
|
||||||
process.env.OPENAI_API_KEY = 'test';
|
process.env.OPENAI_API_KEY = 'test';
|
||||||
|
|
||||||
process.env.NODE_MAX_OLD_SPACE_SIZE = '6144';
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue