Skip to content

Commit

Permalink
feat: adding support for python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
bcm-at-zama committed Aug 27, 2024
1 parent 819dca7 commit 11292f7
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 15 deletions.
51 changes: 47 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ on:
- pr

linux_python_versions:
description: "Space separated list of python versions (3.8, 3.9, 3.10, 3.11 are supported) to launch on linux"
description: "Space separated list of python versions (3.8, 3.9, 3.10, 3.11, 3.12 are supported) to launch on linux"
required: false
type: string
default: "3.8"

macos_python_versions:
description: "Space separated list of python versions (3.8, 3.9, 3.10, 3.11 are supported) to launch on macos (intel)"
description: "Space separated list of python versions (3.8, 3.9, 3.10, 3.11, 3.12 are supported) to launch on macos (intel)"
required: false
type: string
default: "3.8"
Expand Down Expand Up @@ -110,6 +110,7 @@ jobs:
needs-39-linux-runner: ${{ steps.set-matrix.outputs.needs-39-linux-runner }}
needs-310-linux-runner: ${{ steps.set-matrix.outputs.needs-310-linux-runner }}
needs-311-linux-runner: ${{ steps.set-matrix.outputs.needs-311-linux-runner }}
needs-312-linux-runner: ${{ steps.set-matrix.outputs.needs-312-linux-runner }}
instance-type: ${{ steps.set-matrix.outputs.instance-type }}
linux-python-versions: ${{ steps.set-matrix.outputs.linux-python-versions }}
macos-python-versions: ${{ steps.set-matrix.outputs.macos-python-versions }}
Expand Down Expand Up @@ -158,10 +159,10 @@ jobs:
LINUX_PYTHON_VERSIONS="3.8"
MACOS_PYTHON_VERSIONS=""
elif [[ "${BUILD_TYPE}" == "weekly" ]]; then
LINUX_PYTHON_VERSIONS="3.8 3.9 3.10 3.11"
LINUX_PYTHON_VERSIONS="3.8 3.9 3.10 3.11 3.12"
MACOS_PYTHON_VERSIONS="3.9"
elif [[ "${BUILD_TYPE}" == "release" ]] || [[ "${BUILD_TYPE}" == "published_release" ]]; then
LINUX_PYTHON_VERSIONS="3.8 3.9 3.10 3.11"
LINUX_PYTHON_VERSIONS="3.8 3.9 3.10 3.11 3.12"
MACOS_PYTHON_VERSIONS=""
elif [[ "${BUILD_TYPE}" == "push_to_main" ]]; then
LINUX_PYTHON_VERSIONS="3.8"
Expand Down Expand Up @@ -211,6 +212,8 @@ jobs:
jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.10")) | length > 0')
NEEDS_LINUX_311_RUNNER=$(echo "${LINUX_MATRIX}" | \
jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.11")) | length > 0')
NEEDS_LINUX_312_RUNNER=$(echo "${LINUX_MATRIX}" | \
jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.12")) | length > 0')
echo "Needs Linux 3.8 runner:"
echo "${NEEDS_LINUX_38_RUNNER}"
Expand All @@ -224,10 +227,14 @@ jobs:
echo "Needs Linux 3.11 runner:"
echo "${NEEDS_LINUX_311_RUNNER}"
echo "Needs Linux 3.12 runner:"
echo "${NEEDS_LINUX_312_RUNNER}"
echo "needs-38-linux-runner=${NEEDS_LINUX_38_RUNNER}" >> $GITHUB_OUTPUT
echo "needs-39-linux-runner=${NEEDS_LINUX_39_RUNNER}" >> $GITHUB_OUTPUT
echo "needs-310-linux-runner=${NEEDS_LINUX_310_RUNNER}" >> $GITHUB_OUTPUT
echo "needs-311-linux-runner=${NEEDS_LINUX_311_RUNNER}" >> $GITHUB_OUTPUT
echo "needs-312-linux-runner=${NEEDS_LINUX_312_RUNNER}" >> $GITHUB_OUTPUT
echo "instance-type=${INSTANCE_TYPE}" >> $GITHUB_OUTPUT
start-runner-linux:
Expand All @@ -244,6 +251,8 @@ jobs:
ec2-instance-id-310: ${{ steps.start-ec2-runner-310.outputs.ec2-instance-id || '' }}
label-311: ${{ steps.start-ec2-runner-311.outputs.label }}
ec2-instance-id-311: ${{ steps.start-ec2-runner-311.outputs.ec2-instance-id || '' }}
label-312: ${{ steps.start-ec2-runner-312.outputs.label }}
ec2-instance-id-312: ${{ steps.start-ec2-runner-312.outputs.ec2-instance-id || '' }}
matrix: ${{ steps.update-linux-matrix.outputs.linux-matrix }}
steps:
- name: Checkout Code
Expand Down Expand Up @@ -352,6 +361,29 @@ jobs:
{"Key": "Team", "Value": "CML"}
]
- name: Start EC2 runner python 3.12
id: start-ec2-runner-312
if: ${{ !cancelled() && fromJSON(needs.matrix-preparation.outputs.needs-312-linux-runner) }}
uses: machulav/ec2-github-runner@fcfb31a5760dad1314a64a0e172b78ec6fc8a17e
with:
mode: start
github-token: ${{ secrets.EC2_RUNNER_BOT_TOKEN }}
ec2-image-id: ${{ secrets.AWS_EC2_AMI }}
ec2-instance-type: ${{ needs.matrix-preparation.outputs.instance-type }}
subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }}
security-group-id: ${{ secrets.AWS_EC2_SECURITY_GROUP_ID }}
aws-resource-tags: >
[
{"Key": "Name", "Value": "cml-ci-ec2-github-runner-py312"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"},
{"Key": "Python version", "Value": "3.12"},
{"Key": "Actor", "Value": "${{ github.actor }}"},
{"Key": "Action", "Value": "${{ github.action }}"},
{"Key": "GitHash", "Value": "${{ github.sha }}"},
{"Key": "RefName", "Value": "${{ github.ref_name }}"},
{"Key": "RunId", "Value": "${{ github.run_id }}"},
{"Key": "Team", "Value": "CML"}
]
- name: Update Linux runs_on Matrix
id: update-linux-matrix
Expand All @@ -366,6 +398,8 @@ jobs:
'(. | map(select(.os_kind=="linux" and .python_version=="3.10") |= . + {"runs_on": "${{ steps.start-ec2-runner-310.outputs.label }}"}) )')
MATRIX=$(echo "${MATRIX}" | jq -rc \
'(. | map(select(.os_kind=="linux" and .python_version=="3.11") |= . + {"runs_on": "${{ steps.start-ec2-runner-311.outputs.label }}"}) )')
MATRIX=$(echo "${MATRIX}" | jq -rc \
'(. | map(select(.os_kind=="linux" and .python_version=="3.12") |= . + {"runs_on": "${{ steps.start-ec2-runner-312.outputs.label }}"}) )')
echo "Updated matrix:"
echo "${MATRIX}"
Expand Down Expand Up @@ -1046,6 +1080,15 @@ jobs:
ec2-instance-id: ${{ needs.start-runner-linux.outputs.ec2-instance-id-311 }}
mode: stop

- name: Stop EC2 runner python 3.12
uses: machulav/ec2-github-runner@fcfb31a5760dad1314a64a0e172b78ec6fc8a17e
if: ${{ always() && needs.start-runner-linux.outputs.ec2-instance-id-312 }}
with:
github-token: ${{ secrets.EC2_RUNNER_BOT_TOKEN }}
label: ${{ needs.start-runner-linux.outputs.label-312 }}
ec2-instance-id: ${{ needs.start-runner-linux.outputs.ec2-instance-id-312 }}
mode: stop

build-macos-intel:
name: Python ${{ matrix.python_version }} (macOS, intel)
needs: [matrix-preparation]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Depending on your OS, Concrete ML may be installed with Docker or with pip:
| macOS 11+ (Intel) | Yes | Yes |
| macOS 11+ (Apple Silicon: M1, M2, etc.) | Coming soon | Yes |

Note: Concrete ML only supports Python `3.8`, `3.9`, `3.10` and `3.11`.
Note: Concrete ML only supports Python `3.8`, `3.9`, `3.10`, `3.11` and `3.12`.
Concrete ML can be installed on Kaggle ([see this question on the community for more details](https://community.zama.ai/t/how-do-we-use-concrete-ml-on-kaggle/332)) and on Google Colab.

#### Docker
Expand Down
2 changes: 1 addition & 1 deletion deps_licenses/licenses_linux_user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ python-dateutil, 2.9.0.post0, Apache Software License; BSD License
pytz, 2024.1, MIT License
requests, 2.32.3, Apache Software License
scikit-learn, 1.1.3, BSD License
scipy, 1.10.1, BSD License
scipy, 1.13.1, BSD License
six, 1.16.0, MIT License
skl2onnx, 1.12, Apache Software License
skops, 0.5.0, MIT
Expand Down
16 changes: 16 additions & 0 deletions deps_licenses/licenses_linux_user.txt.md5
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
eb83b0f0acb879e882947f38f5d0c8aa
=======
<<<<<<< HEAD
f07036c8072f32a26aa79e5e4bbd9c32
=======
ead3663b936227b3d224dc480933b084
>>>>>>> 8de97ea7 (feat: adding support for python3.11)
>>>>>>> bc2393ee (feat: adding support for python3.11)
=======
eb83b0f0acb879e882947f38f5d0c8aa
>>>>>>> ea6f0812 (chore: update licenses)
=======
e3848db8eda62bc7a88db65909ae3602
>>>>>>> 70e0e1f8 (chore: update licenses)
2 changes: 1 addition & 1 deletion deps_licenses/licenses_mac_intel_user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ python-dateutil, 2.9.0.post0, Apache Software License; BSD License
pytz, 2024.1, MIT License
requests, 2.32.3, Apache Software License
scikit-learn, 1.1.3, BSD License
scipy, 1.10.1, BSD License
scipy, 1.13.1, BSD License
six, 1.16.0, MIT License
skl2onnx, 1.12, Apache Software License
skops, 0.5.0, MIT
Expand Down
16 changes: 16 additions & 0 deletions deps_licenses/licenses_mac_intel_user.txt.md5
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
eb83b0f0acb879e882947f38f5d0c8aa
=======
<<<<<<< HEAD
f07036c8072f32a26aa79e5e4bbd9c32
=======
ead3663b936227b3d224dc480933b084
>>>>>>> 8de97ea7 (feat: adding support for python3.11)
>>>>>>> bc2393ee (feat: adding support for python3.11)
=======
eb83b0f0acb879e882947f38f5d0c8aa
>>>>>>> ea6f0812 (chore: update licenses)
=======
e3848db8eda62bc7a88db65909ae3602
>>>>>>> 70e0e1f8 (chore: update licenses)
2 changes: 1 addition & 1 deletion deps_licenses/licenses_mac_silicon_user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ python-dateutil, 2.9.0.post0, Apache Software License; BSD License
pytz, 2024.1, MIT License
requests, 2.32.3, Apache Software License
scikit-learn, 1.1.3, BSD License
scipy, 1.10.1, BSD License
scipy, 1.13.1, BSD License
six, 1.16.0, MIT License
skl2onnx, 1.12, Apache Software License
skops, 0.5.0, MIT
Expand Down
16 changes: 16 additions & 0 deletions deps_licenses/licenses_mac_silicon_user.txt.md5
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
eb83b0f0acb879e882947f38f5d0c8aa
=======
<<<<<<< HEAD
f07036c8072f32a26aa79e5e4bbd9c32
=======
ead3663b936227b3d224dc480933b084
>>>>>>> 8de97ea7 (feat: adding support for python3.11)
>>>>>>> bc2393ee (feat: adding support for python3.11)
=======
eb83b0f0acb879e882947f38f5d0c8aa
>>>>>>> ea6f0812 (chore: update licenses)
=======
e3848db8eda62bc7a88db65909ae3602
>>>>>>> 70e0e1f8 (chore: update licenses)
2 changes: 1 addition & 1 deletion docs/getting-started/pip_installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Depending on your OS/HW, Concrete ML may be installed with Docker or with pip:

### Python support

- **Version**: In the current release, Concrete ML supports only `3.8`, `3.9`, `3.10` and `3.11` versions of `python`.
- **Version**: In the current release, Concrete ML supports only `3.8`, `3.9`, `3.10`, `3.11` and `3.12` versions of `python`.
- **Linux requirement**: The Concrete ML Python package requires `glibc >= 2.28`. On Linux, you can check your `glibc` version by running `ldd --version`.
- **Kaggle installation**: Concrete ML can be installed on Kaggle ([see question on community for more details](https://community.zama.ai/t/how-do-we-use-concrete-ml-on-kaggle/332)) and on Google Colab.

Expand Down
Loading

0 comments on commit 11292f7

Please sign in to comment.