-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add tests for non-native architectures
This change introduces a new job to the CI to test the SDK on non-native architectures. Github CI ATM provides amd64 runners by default, so the new job targets testing on arch64 for now. The tests are run in containers running on the target platform(s). The container definitions are supposed to exist in the directory .github/containers/nox-cross-arch. A definition for an arm64-ubuntu20.04-python3.11 container can be found there. Since the tests take quite a while to run, given that they run on emulations, this step runs only on the `merge_group` event. Signed-off-by: Tiyash Basu <[email protected]>
- Loading branch information
1 parent
a8f3d62
commit ec6ecd6
Showing
7 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Cross-Arch Testing Containers | ||
|
||
This directory containers dockerfiles that can be used in the CI to test the | ||
python package in non-native machine architectures, e.g., `aarch64`. | ||
|
||
The dockerfiles here follow a naming scheme so that they can be easily used in | ||
build matrices in the CI, in `nox-cross-arch` job. The naming scheme is: | ||
|
||
``` | ||
<arch>-<os>-python-<python-version>.Dockerfile | ||
``` | ||
|
||
E.g., | ||
|
||
``` | ||
arm64-ubuntu-20.04-python-3.11.Dockerfile | ||
``` | ||
|
||
If a dockerfile for your desired target architecture, OS, and python version | ||
does not exist here, please add one before proceeding to add your options to the | ||
test matrix. |
28 changes: 28 additions & 0 deletions
28
.github/containers/nox-cross-arch/arm64-ubuntu-20.04-python-3.11.Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM docker.io/library/ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install Python 3.11 and curl to install pip later | ||
RUN apt-get update -y && \ | ||
apt-get install --no-install-recommends -y \ | ||
software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get install --no-install-recommends -y \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
python3.11 \ | ||
python3.11-distutils && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install pip | ||
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 | ||
|
||
RUN update-alternatives --install \ | ||
/usr/local/bin/python python /usr/bin/python3.11 1 && \ | ||
python -m pip install --upgrade --no-cache-dir pip | ||
|
||
COPY entrypoint.bash /usr/bin/entrypoint.bash | ||
|
||
ENTRYPOINT ["/usr/bin/entrypoint.bash"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "System details:" $(uname -a) | ||
echo "Machine:" $(uname -m) | ||
|
||
pip install -e .[dev-noxfile] | ||
|
||
exec "$@" |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--8<-- ".github/containers/nox-cross-arch/README.md" |