mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
chore: add concrete python tests to ci
This commit is contained in:
122
.github/workflows/concrete_python_tests.yml
vendored
Normal file
122
.github/workflows/concrete_python_tests.yml
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
name: Concrete Python Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
instance_id:
|
||||
description: 'Instance ID'
|
||||
type: string
|
||||
instance_image_id:
|
||||
description: 'Instance AMI ID'
|
||||
type: string
|
||||
instance_type:
|
||||
description: 'Instance product type'
|
||||
type: string
|
||||
runner_name:
|
||||
description: 'Action runner name'
|
||||
type: string
|
||||
request_id:
|
||||
description: 'Slab request ID'
|
||||
type: string
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE_TEST: ghcr.io/zama-ai/concrete-compiler
|
||||
GLIB_VER: 2_28
|
||||
|
||||
jobs:
|
||||
BuildConcreteCompilerAndTestConcretePython:
|
||||
name: Build Concrete Compiler and Test Concrete Python in EC2
|
||||
runs-on: ${{ github.event.inputs.runner_name }}
|
||||
if: ${{ !cancelled() }}
|
||||
steps:
|
||||
- name: Instance configuration used
|
||||
run: |
|
||||
echo "IDs: ${{ inputs.instance_id }}"
|
||||
echo "AMI: ${{ inputs.instance_image_id }}"
|
||||
echo "Type: ${{ inputs.instance_type }}"
|
||||
echo "Request ID: ${{ inputs.request_id }}"
|
||||
|
||||
- name: Set up SSH agent
|
||||
uses: webfactory/ssh-agent@v0.7.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.CONCRETE_CI_SSH_PRIVATE }}
|
||||
|
||||
- name: Set up env
|
||||
run: |
|
||||
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
|
||||
#echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK)" >> "${GITHUB_ENV}"
|
||||
echo "SSH_AUTH_SOCK_DIR=$(dirname $SSH_AUTH_SOCK)" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Fetch repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
|
||||
|
||||
- name: Create build directory
|
||||
run: mkdir build
|
||||
|
||||
- name: Build Concrete Compiler
|
||||
uses: addnab/docker-run-action@v3
|
||||
id: build-compiler
|
||||
with:
|
||||
registry: ghcr.io
|
||||
image: ${{ env.DOCKER_IMAGE_TEST }}
|
||||
username: ${{ secrets.GHCR_LOGIN }}
|
||||
password: ${{ secrets.GHCR_PASSWORD }}
|
||||
options: >-
|
||||
-v ${{ github.workspace }}:/concrete
|
||||
-v ${{ github.workspace }}/build:/build
|
||||
-v ${{ github.workspace }}/wheels:/wheels
|
||||
-v ${{ env.SSH_AUTH_SOCK }}:/ssh.socket
|
||||
-e SSH_AUTH_SOCK=/ssh.socket
|
||||
${{ env.DOCKER_GPU_OPTION }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
|
||||
cd /concrete/frontends/concrete-python
|
||||
make venv
|
||||
source .venv/bin/activate
|
||||
|
||||
cd /concrete/compilers/concrete-compiler/compiler
|
||||
rm -rf /build/*
|
||||
make DATAFLOW_EXECUTION_ENABLED=ON CCACHE=ON Python3_EXECUTABLE=$(which python3) BUILD_DIR=/build python-bindings
|
||||
echo "Debug: ccache statistics (after the build):"
|
||||
ccache -s
|
||||
|
||||
cd /concrete/frontends/concrete-python
|
||||
export COMPILER_BUILD_DIRECTORY=/build
|
||||
make whl
|
||||
|
||||
- name: Test Concrete Python
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
image: ${{ env.DOCKER_IMAGE_TEST }}
|
||||
username: ${{ secrets.GHCR_LOGIN }}
|
||||
password: ${{ secrets.GHCR_PASSWORD }}
|
||||
options: >-
|
||||
-v ${{ github.workspace }}:/concrete
|
||||
-v ${{ github.workspace }}/build:/build
|
||||
${{ env.DOCKER_GPU_OPTION }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
cd /concrete/frontends/concrete-python
|
||||
|
||||
make venv
|
||||
source .venv/bin/activate
|
||||
|
||||
export COMPILER_BUILD_DIRECTORY=/build
|
||||
export CONCRETE_PYTHON_KEY_CACHE_DIRECTORY=/tmp/KeySetCache
|
||||
make pytest
|
||||
|
||||
chmod -R ugo+rwx /tmp/KeySetCache
|
||||
|
||||
- name: Archive Concrete Python Wheel
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: concrete-python
|
||||
path: /concrete/frontends/concrete-python/dist/
|
||||
retention-days: 14
|
||||
Reference in New Issue
Block a user