-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aarch64 Linux wheels to build / release workflow (#109)
- Loading branch information
1 parent
8a30066
commit 14b19a7
Showing
8 changed files
with
219 additions
and
12 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,3 @@ | ||
.idea | ||
.git | ||
__pycache__ |
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,36 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
|
||
ARG PYTHON_TAG | ||
FROM python:${PYTHON_TAG} as build | ||
|
||
ARG DEBIAN_FRONTEND="noninteractive" | ||
ARG TARGETARCH | ||
ARG PYTHON_TAG | ||
RUN \ | ||
--mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-${TARGETARCH}-${PYTHON_TAG} \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-${TARGETARCH}-${PYTHON_TAG} \ | ||
set -eux; \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean; \ | ||
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' | tee /etc/apt/apt.conf.d/keep-cache; \ | ||
wget --no-hsts -O /usr/share/keyrings/adoptium.asc https://packages.adoptium.net/artifactory/api/gpg/key/public; \ | ||
echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list; \ | ||
apt-get -qq update; \ | ||
apt-get -qq -y --no-install-recommends install temurin-8-jdk maven | ||
RUN \ | ||
--mount=type=cache,target=/root/.cache/pip,sharing=locked \ | ||
set -eux; \ | ||
python -m venv /jpy-build-venv; \ | ||
/jpy-build-venv/bin/pip install --upgrade pip setuptools; \ | ||
/jpy-build-venv/bin/pip install --only-binary=:all: wheel patchelf | ||
ENV JAVA_HOME=/usr/lib/jvm/temurin-8-jdk-${TARGETARCH} \ | ||
VIRTUAL_ENV='/jpy-build-venv' \ | ||
PATH="/jpy-build-venv/bin:${PATH}" \ | ||
CI=true | ||
COPY --link . /jpy | ||
RUN \ | ||
--mount=type=cache,target=/root/.m2,sharing=locked \ | ||
cd /jpy; \ | ||
.github/env/Linux/bdist-wheel.sh | ||
|
||
FROM scratch | ||
COPY --link --from=build /jpy/dist/* . |
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,19 @@ | ||
# docker buildx bake | ||
|
||
This is an alternative way to build the jpy Linux wheels. | ||
It is mainly used as a means to produce arm64 wheels via QEMU cross-compiling since GHA does not have a native Linux arm64 runner. | ||
|
||
That said, it can be useful locally too; either to produce native or arm64 Linux wheels. | ||
|
||
```bash | ||
docker buildx bake \ | ||
--file .github/docker/docker-bake.hcl \ | ||
--set "*.output=type=local,dest=/tmp/dist" | ||
``` | ||
|
||
```bash | ||
docker buildx bake \ | ||
--file .github/docker/docker-bake.hcl \ | ||
--set "*.output=type=local,dest=/tmp/dist" \ | ||
--set "*.platform=linux/arm64/v8" | ||
``` |
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,70 @@ | ||
group "default" { | ||
targets = [ | ||
"python-36-linux", | ||
"python-37-linux", | ||
"python-38-linux", | ||
"python-39-linux", | ||
"python-310-linux", | ||
"python-311-linux" | ||
] | ||
} | ||
|
||
variable "DEBIAN_BASE" { | ||
default = "bullseye" | ||
} | ||
|
||
variable "GITHUB_ACTIONS" { | ||
default = false | ||
} | ||
|
||
target "shared" { | ||
dockerfile = ".github/docker/Dockerfile" | ||
cache-from = [ | ||
GITHUB_ACTIONS ? "type=gha,scope=jpy-build" : "" | ||
] | ||
cache-to = [ | ||
GITHUB_ACTIONS ? "type=gha,mode=max,scope=jpy-build" : "" | ||
] | ||
} | ||
|
||
target "python-36-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.6-${DEBIAN_BASE}" | ||
} | ||
} | ||
|
||
target "python-37-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.7-${DEBIAN_BASE}" | ||
} | ||
} | ||
|
||
target "python-38-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.8-${DEBIAN_BASE}" | ||
} | ||
} | ||
|
||
target "python-39-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.9-${DEBIAN_BASE}" | ||
} | ||
} | ||
|
||
target "python-310-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.10-${DEBIAN_BASE}" | ||
} | ||
} | ||
|
||
target "python-311-linux" { | ||
inherits = [ "shared" ] | ||
args = { | ||
PYTHON_TAG = "3.11-${DEBIAN_BASE}" | ||
} | ||
} |
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,45 @@ | ||
# Release | ||
|
||
Jpy is built and released across a matrix of operating systems, architectures, and Python versions. | ||
|
||
The jar artifacts are Java 8+ compatible and released to [org.jpyconsortium:jpy](https://repo1.maven.org/maven2/org/jpyconsortium/jpy) on Maven Central. | ||
|
||
The wheel artifacts are compatible with the table below, and released to the PyPi package [jpy](https://pypi.org/project/jpy/). | ||
|
||
| Version | OS | Arch | | ||
|---------|---------|--------| | ||
| 3.6 | Linux | x86_64 | | ||
| 3.7 | Linux | x86_64 | | ||
| 3.8 | Linux | x86_64 | | ||
| 3.9 | Linux | x86_64 | | ||
| 3.10 | Linux | x86_64 | | ||
| 3.11 | Linux | x86_64 | | ||
| 3.6 | Linux | arm64 | | ||
| 3.7 | Linux | arm64 | | ||
| 3.8 | Linux | arm64 | | ||
| 3.9 | Linux | arm64 | | ||
| 3.10 | Linux | arm64 | | ||
| 3.11 | Linux | arm64 | | ||
| 3.6 | MacOS | x86_64 | | ||
| 3.7 | MacOS | x86_64 | | ||
| 3.8 | MacOS | x86_64 | | ||
| 3.9 | MacOS | x86_64 | | ||
| 3.10 | MacOS | x86_64 | | ||
| 3.11 | MacOS | x86_64 | | ||
| 3.6 | MacOS | arm64 | | ||
| 3.7 | MacOS | arm64 | | ||
| 3.8 | MacOS | arm64 | | ||
| 3.9 | MacOS | arm64 | | ||
| 3.10 | MacOS | arm64 | | ||
| 3.11 | MacOS | arm64 | | ||
| 3.6 | Windows | x86_64 | | ||
| 3.7 | Windows | x86_64 | | ||
| 3.8 | Windows | x86_64 | | ||
| 3.9 | Windows | x86_64 | | ||
| 3.10 | Windows | x86_64 | | ||
| 3.11 | Windows | x86_64 | | ||
|
||
## Process | ||
|
||
The [build.yml](.github/workflows/build.yml) workflow is the main process by which PRs and releases are built. | ||
The release process is kicked off whenever a branch name matches `release/v*` is pushed to [jpy-consortium/jpy](https://github.com/jpy-consortium/jpy). |
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