-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cross): Split images by python, use bake (#8458)
- Loading branch information
Showing
10 changed files
with
198 additions
and
181 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,2 @@ | ||
[worker.oci] | ||
max-parallelism = 1 |
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 was deleted.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
rust/cubestore/cross/aarch64-unknown-linux-gnu-python.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,27 @@ | ||
FROM base | ||
|
||
ARG PYTHON_VERSION | ||
ARG PYTHON_RELEASE | ||
|
||
# python is required for cross compiling python :D | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python${PYTHON_RELEASE} \ | ||
&& rm -rf /var/lib/apt/lists/*; | ||
|
||
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -O - | tar -xz \ | ||
&& cd Python-${PYTHON_VERSION} \ | ||
&& touch config.site-aarch64 \ | ||
&& echo "ac_cv_buggy_getaddrinfo=no" >> config.site-aarch64 \ | ||
&& echo "ac_cv_file__dev_ptmx=no" >> config.site-aarch64 \ | ||
&& echo "ac_cv_file__dev_ptc=no" >> config.site-aarch64 \ | ||
&& CONFIG_SITE=config.site-aarch64 ./configure \ | ||
--enable-shared \ | ||
--enable-optimizations \ | ||
--disable-ipv6 \ | ||
--prefix=/usr/aarch64-linux-gnu \ | ||
--build=aarch64-unknown-linux-gnu \ | ||
--host=x86_64-linux-gnu \ | ||
--with-build-python=/usr/bin/python${PYTHON_RELEASE} \ | ||
&& make -j $(nproc) \ | ||
&& make install \ | ||
&& cd .. && rm -rf Python-${PYTHON_VERSION} \ | ||
&& rm -rf /var/lib/apt/lists/*; \ |
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,110 @@ | ||
variable "CROSS_VERSION" { | ||
default = "15082024" | ||
} | ||
|
||
variable "LLVM_VERSION" { | ||
default = "18" | ||
} | ||
|
||
target "aarch64-unknown-linux-gnu" { | ||
context = "." | ||
dockerfile = "aarch64-unknown-linux-gnu.Dockerfile" | ||
args = { | ||
LLVM_VERSION = LLVM_VERSION | ||
} | ||
tags = ["cubejs/cross:aarch64-unknown-linux-gnu-${CROSS_VERSION}"] | ||
platforms = ["linux/amd64"] | ||
} | ||
|
||
target "aarch64-unknown-linux-gnu-python" { | ||
inherits = ["aarch64-unknown-linux-gnu"] | ||
contexts = { | ||
base = "target:aarch64-unknown-linux-gnu" | ||
} | ||
dockerfile = "aarch64-unknown-linux-gnu-python.Dockerfile" | ||
name = "aarch64-unknown-linux-gnu-python-${replace(item.python_release, ".", "-")}" | ||
matrix = { | ||
item = [ | ||
{ | ||
python_version = "3.12.4" | ||
python_release = "3.12" | ||
}, | ||
{ | ||
python_version = "3.11.3" | ||
python_release = "3.11" | ||
}, | ||
{ | ||
python_version = "3.10.11" | ||
python_release = "3.10" | ||
}, | ||
{ | ||
python_version = "3.9.18" | ||
python_release = "3.9" | ||
} | ||
] | ||
} | ||
args = { | ||
CROSS_VERSION = CROSS_VERSION | ||
PYTHON_VERSION = item.python_version | ||
PYTHON_RELEASE = item.python_release | ||
} | ||
tags = ["cubejs/rust-cross:aarch64-unknown-linux-gnu-${CROSS_VERSION}-python-${item.python_release}"] | ||
platforms = ["linux/amd64"] | ||
} | ||
|
||
# We use -python prefix for ci | ||
target "x86_64-unknown-linux-musl-python" { | ||
context = "." | ||
dockerfile = "x86_64-unknown-linux-musl.Dockerfile" | ||
args = { | ||
LLVM_VERSION = LLVM_VERSION | ||
} | ||
tags = ["cubejs/rust-cross:x86_64-unknown-linux-musl-${CROSS_VERSION}"] | ||
platforms = ["linux/amd64"] | ||
} | ||
|
||
target "x86_64-unknown-linux-gnu" { | ||
context = "." | ||
dockerfile = "x86_64-unknown-linux-gnu.Dockerfile" | ||
args = { | ||
LLVM_VERSION = LLVM_VERSION | ||
} | ||
tags = ["cubejs/rust-cross:x86_64-unknown-linux-gnu-${CROSS_VERSION}"] | ||
platforms = ["linux/amd64"] | ||
} | ||
|
||
target "x86_64-unknown-linux-gnu-python" { | ||
inherits = ["x86_64-unknown-linux-gnu"] | ||
contexts = { | ||
base = "target:x86_64-unknown-linux-gnu" | ||
} | ||
dockerfile = "x86_64-unknown-linux-gnu-python.Dockerfile" | ||
name = "x86_64-unknown-linux-gnu-python-${replace(item.python_release, ".", "-")}" | ||
matrix = { | ||
item = [ | ||
{ | ||
python_version = "3.12.4" | ||
python_release = "3.12" | ||
}, | ||
{ | ||
python_version = "3.11.3" | ||
python_release = "3.11" | ||
}, | ||
{ | ||
python_version = "3.10.11" | ||
python_release = "3.10" | ||
}, | ||
{ | ||
python_version = "3.9.18" | ||
python_release = "3.9" | ||
} | ||
] | ||
} | ||
args = { | ||
CROSS_VERSION = CROSS_VERSION | ||
PYTHON_VERSION = item.python_version | ||
PYTHON_RELEASE = item.python_release | ||
} | ||
tags = ["cubejs/rust-cross:x86_64-unknown-linux-gnu-${CROSS_VERSION}-python-${item.python_release}"] | ||
platforms = ["linux/amd64"] | ||
} |
22 changes: 22 additions & 0 deletions
22
rust/cubestore/cross/x86_64-unknown-linux-gnu-python.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,22 @@ | ||
FROM base | ||
|
||
ARG PYTHON_VERSION | ||
ARG PYTHON_RELEASE | ||
|
||
RUN cd tmp && wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -O - | tar -xz \ | ||
&& cd Python-${PYTHON_VERSION} && \ | ||
./configure \ | ||
--enable-shared \ | ||
--with-openssl=/openssl \ | ||
--enable-optimizations \ | ||
--disable-ipv6 \ | ||
--prefix=/usr \ | ||
&& make -j $(nproc) \ | ||
&& make install \ | ||
&& ln -f -s /usr/bin/python${PYTHON_RELEASE} /usr/bin/python3 \ | ||
&& cd .. && rm -rf Python-${PYTHON_VERSION}; | ||
|
||
# pyo3 uses python3 to detect version, but there is a bug and it uses python3.9 (system), this force it to use a new python | ||
ENV PYO3_PYTHON=python${PYTHON_RELEASE} | ||
|
||
ENV PATH="/cargo/bin:$PATH" |
Oops, something went wrong.