This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
forked from ml4ai/skema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.skema-py
68 lines (56 loc) · 2.08 KB
/
Dockerfile.skema-py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Dockerfile for the skema-py service
FROM python:3.8-bullseye
# ======================
# Install prerequisites
# ======================
ARG DEBIAN_FRONTEND=noninteractive
ARG NODE_MAJOR=18
RUN apt-get update &&\
apt-get -y --no-install-recommends install \
tree \
# Required for pygraphviz
build-essential \
graphviz \
libgraphviz-dev \
python3-venv \
gnupg \
ca-certificates \
curl \
cmake
# Node needed for img2mml
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get -y install nodejs
# The two commands below are to reduce the size of the Docker image
RUN apt-get clean &&\
rm -rf /var/lib/apt/lists/*
# =====================
# ENV setup for app
# =====================
ARG APP_VERSION=unknown
ENV APP_VERSION=$APP_VERSION
# =====================
# Setup the repository
# =====================
RUN mkdir -p /app
# Copy the necessary files and folders, omitting unnecessary ones.
COPY . /app/
WORKDIR /app/
# Install rust (needed b/c of ISA's use of graspologic; no wheels available for ARM64/M1)
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install the skema package
RUN pip install wheel
RUN pip install six
# Download ML model (~150MB)
RUN pip install huggingface_hub && python scripts/retrieve_model_ci.py
RUN tree /app
#RUN pip install ".[all]"
# exclude dependencies for docs
RUN pip install ".[core,dev,demo]"
# Build tree-sitter-fortran grammar required by Fortran code2fn
RUN python /app/skema/program_analysis/tree_sitter_parsers/build_parsers.py --c --cpp --fortran --matlab --python --r
# img2mml JS dependencies for MathJax server
RUN (cd skema/img2mml/data_generation && npm install)
#CMD ["uvicorn", "skema.skema_py.server:app", "--host", "0.0.0.0", "--port", "8000"]