Skip to content

Commit

Permalink
Fix Dockerfile for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 2, 2024
1 parent 5f4d2dc commit 3ab88ec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked
apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-poetry \
&& rm -rf /var/lib/apt/lists/*

RUN curl -o libssl1.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb && dpkg -i libssl1.deb && rm -f libssl1.deb
RUN --mount=type=bind,source=openssl-1.1.1w.tar.gz,target=/root/openssl-1.1.1w.tar.gz \
echo '/usr/local/lib' >> /etc/ld.so.conf.d/local.conf \
&& echo '/usr/local/lib64' >> /etc/ld.so.conf.d/local.conf \
&& cd /root && tar xzf openssl-1.1.1w.tar.gz \
&& cd openssl-1.1.1w && ./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11 shared \
&& make -j && make install \
&& ldconfig && cd /root && rm -rf openssl-1.1.1w

ENV PYTHONDONTWRITEBYTECODE=1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

Expand Down
8 changes: 7 additions & 1 deletion Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked
apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-poetry \
&& rm -rf /var/lib/apt/lists/*

RUN curl -o libssl1.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb && dpkg -i libssl1.deb && rm -f libssl1.deb
RUN --mount=type=bind,source=openssl-1.1.1w.tar.gz,target=/root/openssl-1.1.1w.tar.gz \
echo '/usr/local/lib' >> /etc/ld.so.conf.d/local.conf \
&& echo '/usr/local/lib64' >> /etc/ld.so.conf.d/local.conf \
&& cd /root && tar xzf openssl-1.1.1w.tar.gz \
&& cd openssl-1.1.1w && ./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11 shared \
&& make -j && make install \
&& ldconfig && cd /root && rm -rf openssl-1.1.1w

ENV PYTHONDONTWRITEBYTECODE=1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

Expand Down
14 changes: 13 additions & 1 deletion download_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from huggingface_hub import snapshot_download
import nltk
import os
import urllib.request

urls = [
"https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz",
]

repos = [
"InfiniFlow/text_concat_xgb_v1.0",
Expand All @@ -20,10 +25,17 @@ def download_model(repo_id):


if __name__ == "__main__":
for url in urls:
filename = url.split("/")[-1]
print(f"Downloading {url}...")
if not os.path.exists(filename):
urllib.request.urlretrieve(url, filename)

local_dir = os.path.abspath('nltk_data')
for data in ['wordnet', 'punkt', 'wordnet']:
for data in ['wordnet', 'punkt', 'punkt_tab']:
print(f"Downloading nltk {data}...")
nltk.download(data, download_dir=local_dir)

for repo_id in repos:
print(f"Downloading huggingface repo {repo_id}...")
download_model(repo_id)

0 comments on commit 3ab88ec

Please sign in to comment.