tools: create Docker release image, helper build script and requirements

- also create Documentation and issue template
This commit is contained in:
Arthur Meyre
2021-09-02 10:38:11 +02:00
parent 1e58dde1fa
commit a8e7f0e237
8 changed files with 96 additions and 0 deletions

48
docker/Dockerfile.release Normal file
View File

@@ -0,0 +1,48 @@
FROM ghcr.io/zama-ai/zamalang-compiler as builder
RUN apt-get update && apt-get upgrade --no-install-recommends -y && \
apt-get install --no-install-recommends -y \
python3.8 \
python-is-python3 && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install --no-cache-dir --upgrade pip wheel setuptools && \
python3 -m pip install --no-cache-dir poetry
WORKDIR /build
COPY concrete ./concrete
COPY pyproject.toml ./pyproject.toml
RUN poetry build --format wheel
FROM ghcr.io/zama-ai/zamalang-compiler
RUN mkdir /pkg && mkdir /app
WORKDIR /pkg
COPY --from=builder /build/dist/*.whl .
COPY docker/datascience_requirements.txt .
COPY torch_requirements.txt .
RUN apt-get update && apt-get upgrade --no-install-recommends -y && \
apt-get install --no-install-recommends -y \
python3.8 \
python3.8-tk \
python-is-python3 \
graphviz* && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install --no-cache-dir --upgrade pip wheel setuptools && \
echo "export LD_PRELOAD=/compiler/build/lib/Runtime/libZamalangRuntime.so" >> /root/.bashrc && \
echo "export MPLBACKEND=TkAgg" >> /root/.bashrc && \
python3 -m pip install --no-cache-dir ./*.whl && \
python3 -m pip install --no-cache-dir -r torch_requirements.txt \
-f https://download.pytorch.org/whl/torch_stable.html && \
python3 -m pip install --no-cache-dir -r datascience_requirements.txt
WORKDIR /app
RUN printf "#!/bin/bash\npython3 -m jupyter notebook --ip=0.0.0.0 --allow-root --no-browser\n" \
> entry_point.sh && \
mkdir /data
WORKDIR /data
VOLUME [ "/data" ]
CMD ["/bin/bash", "-l", "/app/entry_point.sh"]

View File

@@ -0,0 +1,12 @@
# Ignore all
**
# Not our sources
!concrete
!pyproject.toml
!docker/datascience_requirements.txt
!torch_requirements.txt
# But still ignore pycache
**/__pycache__
**/*.pyc

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
CURR_DIR=$(dirname $0)
DOCKER_BUILDKIT=1 docker build --pull --no-cache -f "$CURR_DIR/Dockerfile.release" \
-t concretefhe-release "$CURR_DIR/.."

View File

@@ -0,0 +1,4 @@
jupyter~=1.0.0
opencv-python-headless~=4.5.3.56
pandas~=1.3.2
scikit-learn~=0.24.2