Concrete ML Tests #969
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Concrete ML 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: ghcr.io/zama-ai/concrete-compiler | |
jobs: | |
linux-x86: | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
runs-on: ${{ github.event.inputs.runner_name }} | |
steps: | |
- name: Log instance configuration | |
run: | | |
echo "IDs: ${{ inputs.instance_id }}" | |
echo "AMI: ${{ inputs.instance_image_id }}" | |
echo "Type: ${{ inputs.instance_type }}" | |
echo "Request ID: ${{ inputs.request_id }}" | |
echo "User Inputs: ${{ inputs.user_inputs }}" | |
- name: Set up GitHub environment | |
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: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }} | |
- name: Set release version | |
run: echo "__version__ = \"$(date +"%Y.%m.%d")\"" >| frontends/concrete-python/version.txt | |
- name: Expose release version from Python | |
run: cp frontends/concrete-python/version.txt frontends/concrete-python/concrete/fhe/version.py | |
- name: Create build directory | |
run: mkdir build | |
- name: Build wheel | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
id: build-compiler-bindings | |
with: | |
registry: ghcr.io | |
image: ${{ env.DOCKER_IMAGE }} | |
username: ${{ secrets.GHCR_LOGIN }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
options: >- | |
-v ${{ github.workspace }}:/concrete | |
-v ${{ github.workspace }}/build:/build | |
-v ${{ env.SSH_AUTH_SOCK }}:/ssh.socket | |
-e SSH_AUTH_SOCK=/ssh.socket | |
${{ env.DOCKER_GPU_OPTION }} | |
shell: bash | |
run: | | |
set -e | |
rm -rf /build/* | |
export PYTHON=${{ format('python{0}', matrix.python-version) }} | |
echo "Using $PYTHON" | |
cd /concrete/frontends/concrete-python | |
make PYTHON=$PYTHON venv | |
source .venv/bin/activate | |
cd /concrete/compilers/concrete-compiler/compiler | |
make BUILD_DIR=/build CCACHE=ON DATAFLOW_EXECUTION_ENABLED=ON Python3_EXECUTABLE=$(which python) python-bindings | |
echo "Debug: ccache statistics (after the build):" | |
ccache -s | |
cd /concrete/frontends/concrete-python | |
export COMPILER_BUILD_DIRECTORY="/build" | |
make whl | |
deactivate | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: ML Tests | |
run: | | |
export CONCRETE_PYTHON_WHEEL=$(pwd)/frontends/concrete-python/dist/*manylinux*.whl | |
apt update | |
apt install git git-lfs -y | |
pip install poetry==1.7.1 | |
./ci/scripts/test_cml.sh --use-wheel $CONCRETE_PYTHON_WHEEL --verbose |