diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index c09272326..f64b29771 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -15,14 +15,19 @@ jobs: submodules: true - name: Format with clang-format run: .github/workflows/scripts/format_cpp.sh + BuildAndTest: runs-on: ubuntu-latest + strategy: + matrix: + compiler: [gcc6, latest] steps: - uses: actions/checkout@v2 with: submodules: recursive - name: "KeySetCache" + if: ${{ matrix.compiler == 'gcc6' }} uses: actions/cache@v2 with: path: ${{ github.workspace }}/KeySetCache @@ -32,10 +37,11 @@ jobs: ${{ runner.os }}-KeySetCache- - name: Build and test compiler + if: ${{ matrix.compiler == 'gcc6' }} uses: addnab/docker-run-action@v3 with: registry: ghcr.io - image: ghcr.io/zama-ai/zamalang-compiler:latest + image: ghcr.io/zama-ai/concretefhe-compiler:gcc6 username: ${{ secrets.GHCR_LOGIN }} password: ${{ secrets.GHCR_PASSWORD }} options: -v ${{ github.workspace }}/compiler:/compiler -v ${{ github.workspace }}/KeySetCache:/tmp/KeySetCache @@ -45,13 +51,35 @@ jobs: echo "Debug: ccache statistics (prior to the build):" ccache -s cd /compiler - pip install pytest + /opt/python/cp38-cp38/bin/pip install pytest rm -rf /build - export PYTHONPATH="" - make CCACHE=ON BUILD_DIR=/build test + sed "s/pytest/\/opt\/python\/cp38-cp38\/bin\/python -m pytest/g" -i Makefile + make CCACHE=ON Python3_EXECUTABLE=/opt/python/cp38-cp38/bin/python BUILD_DIR=/build test echo "Debug: ccache statistics (after the build):" ccache -s chmod -R ugo+rwx /tmp/KeySetCache + + - name: Build compiler + if: ${{ matrix.compiler == 'latest' }} + uses: addnab/docker-run-action@v3 + with: + registry: ghcr.io + image: ghcr.io/zama-ai/zamalang-compiler:latest + username: ${{ secrets.GHCR_LOGIN }} + password: ${{ secrets.GHCR_PASSWORD }} + options: -v ${{ github.workspace }}/compiler:/compiler + shell: bash + run: | + set -e + echo "Debug: ccache statistics (prior to the build):" + ccache -s + cd /compiler + rm -rf /build + export PYTHONPATH="" + make CCACHE=ON BUILD_DIR=/build zamacompiler python-bindings + echo "Debug: ccache statistics (after the build):" + ccache -s + BuildAndTestDF: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docker-zamalang.yml b/.github/workflows/docker-zamalang.yml index dc41ea7b7..3fb9bbac1 100644 --- a/.github/workflows/docker-zamalang.yml +++ b/.github/workflows/docker-zamalang.yml @@ -16,6 +16,7 @@ jobs: runs-on: ubuntu-latest env: IMAGE: ghcr.io/zama-ai/zamalang-compiler + IMAGE_GCC6: ghcr.io/zama-ai/concretefhe-compiler steps: - uses: actions/checkout@v2 @@ -34,6 +35,15 @@ jobs: docker image push $IMAGE:latest docker image push $IMAGE:${{ github.sha }} + - name: build gcc6 image + run: docker image build --no-cache --label "commit-sha=${{ github.sha }}" -t $IMAGE_GCC6:gcc6 -f builders/Dockerfile.zamalang-env-gcc6 . + + - name: tag and publish gcc6 image + run: | + docker image tag $IMAGE_GCC6:gcc6 $IMAGE_GCC6:gcc6-${{ github.sha }} + docker image push $IMAGE_GCC6:gcc6 + docker image push $IMAGE_GCC6:gcc6-${{ github.sha }} + - name: tag and publish release image if: github.event_name == 'release' run: | diff --git a/builders/Dockerfile.zamalang-env-gcc6 b/builders/Dockerfile.zamalang-env-gcc6 new file mode 100644 index 000000000..d3722f8e3 --- /dev/null +++ b/builders/Dockerfile.zamalang-env-gcc6 @@ -0,0 +1,21 @@ +FROM quay.io/pypa/manylinux_2_24_x86_64 + +RUN apt-get update +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential ninja-build ccache +# setup ccache with an unlimited amount of files and storage +RUN ccache -M 0 +RUN ccache -F 0 +# Set the python path. Options: [cp38-cp38, cp39-cp39, cp310-cp310] +ARG python_tag=cp38-cp38 +# Install python deps +RUN /opt/python/${python_tag}/bin/pip install numpy pybind11==2.6.2 PyYAML +# Setup LLVM +COPY /llvm-project /llvm-project +# Setup Concrete +COPY --from=ghcr.io/zama-ai/concrete-api-env:latest /target/release /concrete/target/release +ENV CONCRETE_PROJECT=/concrete +# Setup and build compiler +COPY /compiler /compiler +WORKDIR /compiler +RUN mkdir -p /build +RUN make BUILD_DIR=/build Python3_EXECUTABLE=/opt/python/${python_tag}/bin/python CCACHE=ON python-bindings zamacompiler \ No newline at end of file