|
#!/bin/bash |
|
set -o pipefail |
|
set -ex |
|
|
|
shopt -s expand_aliases |
|
if ! test -f /usr/bin/sudo; then |
|
echo "No sudo" |
|
alias sudo=' ' |
|
fi |
|
|
|
|
|
|
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
conda install weasyprint pygobject -c conda-forge -y |
|
|
|
|
|
pip uninstall -y pandoc pypandoc pypandoc-binary flash-attn |
|
else |
|
echo "pandoc is part of base wolfi-os image" |
|
fi |
|
|
|
|
|
pip install --upgrade pip wheel |
|
|
|
|
|
pip install -r requirements.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
|
|
|
|
|
|
|
|
sudo apt-get update -y |
|
sudo apt-get -y install autoconf libtool |
|
fi |
|
|
|
pip install -r reqs_optional/requirements_optional_langchain.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
pip install -r reqs_optional/requirements_optional_llamacpp_gpt4all.txt -c reqs_optional/reqs_constraints.txt --no-cache-dir |
|
else |
|
C=gcc-11 CXX=g++-11 pip install -r reqs_optional/requirements_optional_llamacpp_gpt4all.txt -c reqs_optional/reqs_constraints.txt --no-cache-dir |
|
fi |
|
|
|
|
|
if [ "${GPLOK}" -eq "1" ] |
|
then |
|
pip install -r reqs_optional/requirements_optional_langchain.gpllike.txt -c reqs_optional/reqs_constraints.txt |
|
fi |
|
|
|
pip install -r reqs_optional/requirements_optional_gpu_only.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install -r reqs_optional/requirements_optional_langchain.urls.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
sudo apt-get install -y libmagic-dev poppler-utils tesseract-ocr libtesseract-dev libreoffice |
|
else |
|
echo "libmagic, tesseract, libreoffice are part of base wolfi-os image, but no poppler" |
|
fi |
|
|
|
pip install -r reqs_optional/requirements_optional_doctr.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install onnxruntime==1.15.0 -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install onnxruntime-gpu==1.15.0 -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
for i in 1 2 3 4; do python -m nltk.downloader all && break || sleep 1; done |
|
|
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
playwright install --with-deps |
|
else |
|
echo "playwright is part of the base wolfi-os image" |
|
fi |
|
|
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
sudo apt-get install -y rubberband-cli |
|
pip install pyrubberband==0.3.0 -c reqs_optional/reqs_constraints.txt |
|
fi |
|
|
|
pip uninstall -y pysoundfile soundfile |
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
sudo apt-get install ffmpeg -y |
|
else |
|
echo "ffmpeg is part of the base wolfi-os image" |
|
fi |
|
|
|
|
|
|
|
pip install TTS deepspeed -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install -r reqs_optional/requirements_optional_audio.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
pip install numpy==1.23.0 --no-deps --upgrade -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install librosa==0.10.1 --no-deps --upgrade -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
pip install -r reqs_optional/requirements_optional_image.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
|
|
|
|
pip uninstall -y hnswlib chroma-hnswlib |
|
|
|
pip install chroma-hnswlib==0.7.3 --upgrade -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
|
|
|
|
|
|
sudo apt install -y unzip xvfb libxi6 libgconf-2-4 libu2f-udev |
|
fi |
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
javaVersion=$(java --version) |
|
if [ -z "$javaVersion" ]; then |
|
sudo apt install -y default-jdk |
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sudo mkdir -p /etc/apt/keyrings/ |
|
sudo rm -rf /tmp/google.pub |
|
sudo wget https://dl-ssl.google.com/linux/linux_signing_key.pub -O /tmp/google.pub |
|
sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/google-chrome.gpg --import /tmp/google.pub |
|
sudo echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list |
|
sudo apt-get update -y |
|
|
|
sudo apt-get install google-chrome-stable -y |
|
chromeVersion="$(echo $(google-chrome --version) | cut -d' ' -f3)" |
|
|
|
|
|
|
|
sudo rm -rf chromedriver-linux64.zip chromedriver LICENSE.chromedriver |
|
if ! wget -O chromedriver-linux64.zip "https://storage.googleapis.com/chrome-for-testing-public/${chromeVersion}/linux64/chromedriver-linux64.zip"; then |
|
echo "Failed to download ChromeDriver for version ${chromeVersion}, attempting to download known working version 124.0.6367.91." |
|
if ! wget -O chromedriver-linux64.zip "https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.91/linux64/chromedriver-linux64.zip"; then |
|
echo "Failed to download fallback ChromeDriver version 124.0.6367.91." |
|
exit 1 |
|
fi |
|
fi |
|
|
|
sudo unzip -o chromedriver-linux64.zip |
|
sudo mv chromedriver-linux64/chromedriver /usr/bin/chromedriver |
|
sudo chown root:root /usr/bin/chromedriver |
|
sudo chmod +x /usr/bin/chromedriver |
|
else |
|
echo "wolfi-os base image uses chromium with playwright support" |
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pip uninstall -y autoawq ; pip install autoawq -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install sacrebleu==2.3.1 --upgrade -c reqs_optional/reqs_constraints.txt |
|
|
|
if [ 1 -eq 0 ] |
|
then |
|
pip uninstall -y autoawq |
|
git clone https://github.com/casper-hansen/AutoAWQ |
|
cd AutoAWQ |
|
pip install . -c reqs_optional/reqs_constraints.txt |
|
fi |
|
|
|
|
|
pip uninstall llama_cpp_python_cuda -y |
|
|
|
|
|
if [[ "${PIP_EXTRA_INDEX_URL}" == *"cu118"* ]]; then |
|
|
|
|
|
|
|
echo "cuda118" |
|
|
|
pip install https://github.com/casper-hansen/AutoAWQ_kernels/releases/download/v0.0.3/autoawq_kernels-0.0.3+cu118-cp310-cp310-linux_x86_64.whl |
|
|
|
pip install auto-gptq==0.7.1 --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ |
|
echo "cuda118 for awq, see: https://github.com/casper-hansen/AutoAWQ_kernels/releases/" |
|
|
|
elif [[ -v CUDA_HOME ]]; then |
|
|
|
|
|
|
|
echo "cuda121" |
|
pip install autoawq-kernels -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install auto-gptq==0.7.1 exllamav2==0.0.16 |
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [[ -v CUDA_HOME ]]; |
|
then |
|
pip install --upgrade pip |
|
pip install flash-attn==2.6.3 --no-build-isolation --no-cache-dir -c reqs_optional/reqs_constraints.txt |
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
pip uninstall -y pyduckdb duckdb |
|
pip install https://h2o-release.s3.amazonaws.com/h2ogpt/duckdb-0.8.2.dev4025%2Bg9698e9e6a8.d20230907-cp310-cp310-linux_x86_64.whl --no-cache-dir --force-reinstall --no-deps -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
|
|
|
|
|
|
pip install -r reqs_optional/requirements_optional_agents.txt -c reqs_optional/reqs_constraints.txt |
|
|
|
pip install aider-chat |
|
|
|
pip install transformers -U -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
pip uninstall flash_attn autoawq autoawq-kernels -y |
|
pip install flash_attn autoawq autoawq-kernels --no-cache-dir -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
pip install tenacity==8.3.0 -c reqs_optional/reqs_constraints.txt |
|
|
|
|
|
pip install jinja2==3.1.4 -c reqs_optional/reqs_constraints.txt |
|
|
|
bash ./docs/run_patches.sh |
|
|
|
|
|
|
|
npm install -g @mermaid-js/mermaid-cli |
|
npm install -g puppeteer-core |
|
|
|
|
|
|
|
|
|
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.4.tgz |
|
tar xvzf mongodb-linux-x86_64-ubuntu2204-7.0.4.tgz |
|
sudo mkdir -p /usr/lib/python3.10/site-packages/fiftyone/db/ |
|
sudo cp -r mongodb-linux-x86_64-ubuntu2204-7.0.4/bin /usr/lib/python3.10/site-packages/fiftyone/db/ |
|
sudo chmod -R a+rwx /usr/lib/python3.10/site-packages/fiftyone/db |
|
|
|
if [[ -z "${WOLFI_OS}" ]]; then |
|
|
|
|
|
|
|
|
|
|
|
if [ 1 -eq 0 ] |
|
then |
|
MAX_GCC_VERSION=11 |
|
sudo apt install gcc-$MAX_GCC_VERSION g++-$MAX_GCC_VERSION |
|
sudo update-alternatives --config gcc |
|
|
|
sudo update-alternatives --config g++ |
|
|
|
fi |
|
fi |
|
|