Updates to CI process for Python dependencies (#912)

This commit is contained in:
Juan Calderon-Perez
2023-11-27 22:08:30 -05:00
committed by GitHub
parent 442b1b7d31
commit 78cff9c47f
6 changed files with 16 additions and 7 deletions

View File

@@ -12,7 +12,6 @@ CONTRIBUTING.md
Dockerfile
docker-compose.yml
docker-compose.dev.yml
/vendor
.vscode/
**/node_modules/

View File

@@ -30,11 +30,13 @@ COPY --from=frontend /usr/src/app/web/build /usr/src/app/api/static/
COPY ./api /usr/src/app/api
COPY scripts/deploy.sh /usr/src/app/deploy.sh
COPY scripts/serge.env /usr/src/app/serge.env
COPY vendor/requirements.txt /usr/src/app/requirements.txt
# Install api dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends dumb-init \
&& pip install --no-cache-dir ./api \
&& pip install -r /usr/src/app/requirements.txt \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* \
&& chmod 755 /usr/src/app/deploy.sh \
&& chmod 755 /usr/local/bin/redis-server \

View File

@@ -25,6 +25,7 @@ COPY --from=redis /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=node_base /usr/local /usr/local
COPY scripts/dev.sh /usr/src/app/dev.sh
COPY scripts/serge.env /usr/src/app/serge.env
COPY vendor/requirements.txt /usr/src/app/requirements.txt
COPY ./web/package.json ./web/package-lock.json ./
RUN npm ci \

View File

@@ -19,9 +19,8 @@ detect_cpu_features() {
# Detect CPU features and generate install command
cpu_feature=$(detect_cpu_features)
pip_command="UNAME_M=$(dpkg --print-architecture) python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --prefer-binary --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
echo "Recommended install command for llama-cpp-python:"
echo "$pip_command"
pip_command="UNAME_M=$(dpkg --print-architecture) python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
echo "Recommended install command for llama-cpp-python: $pip_command"
# Handle termination signals
_term() {

View File

@@ -19,9 +19,14 @@ detect_cpu_features() {
# Detect CPU features and generate install command
cpu_feature=$(detect_cpu_features)
pip_command="UNAME_M=$(dpkg --print-architecture) python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --prefer-binary --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
echo "Recommended install command for llama-cpp-python:"
echo "$pip_command"
pip_command="UNAME_M=$(dpkg --print-architecture) python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
echo "Recommended install command for llama-cpp-python: $pip_command"
# Install python vendor dependencies
pip install -r /usr/src/app/requirements.txt || {
echo 'Failed to install python dependencies from requirements.txt'
exit 1
}
# Install python dependencies
pip install -e ./api || {

3
vendor/requirements.txt vendored Normal file
View File

@@ -0,0 +1,3 @@
typing-extensions>=4.5.0
numpy>=1.20.0
diskcache>=5.6.1