Skip to content

Commit bc2a379

Browse files
authored
[CI] [GHA] Build additional Python packages for Python 3.9-3.12 (openvinotoolkit#29889)
### Tickets: - *165409*
1 parent 33e9d78 commit bc2a379

File tree

21 files changed

+358
-59
lines changed

21 files changed

+358
-59
lines changed

.github/dockerfiles/docker_tag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pr-28972
1+
pr-29889

.github/dockerfiles/ov_build/debian_10_arm/Dockerfile

Lines changed: 145 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
1212
ENV DEBIAN_FRONTEND="noninteractive" \
1313
TZ="Europe/London"
1414

15-
RUN apt-get update && \
15+
RUN dpkg --add-architecture armhf && apt-get update && \
1616
apt-get install \
1717
software-properties-common \
1818
curl \
@@ -21,7 +21,7 @@ RUN apt-get update && \
2121
tzdata \
2222
# parallel gzip
2323
pigz \
24-
# Pythons \
24+
# Python
2525
python3 \
2626
python3-pip \
2727
python3-dev \
@@ -30,10 +30,10 @@ RUN apt-get update && \
3030
libhdf5-dev \
3131
# For building Python from source
3232
build-essential \
33-
libffi-dev \
3433
libgdbm-dev \
3534
libc6-dev \
3635
libssl-dev \
36+
libffi-dev \
3737
zlib1g-dev \
3838
libbz2-dev \
3939
libreadline-dev \
@@ -46,6 +46,22 @@ RUN apt-get update && \
4646
libxmlsec1-dev \
4747
liblzma-dev \
4848
wget \
49+
libavcodec58:armhf \
50+
libusb-1.0-0-dev:armhf \
51+
libboost-regex-dev:armhf \
52+
crossbuild-essential-armhf \
53+
libgtk-3-dev:armhf \
54+
libavcodec-dev:armhf \
55+
libavformat-dev:armhf \
56+
libswscale-dev:armhf \
57+
libgstreamer1.0-dev:armhf \
58+
libpython-dev:armhf \
59+
libgstreamer-plugins-base1.0-dev:armhf \
60+
zlib1g-dev:armhf \
61+
nlohmann-json-dev \
62+
libgflags-dev:armhf \
63+
libtbb-dev:armhf \
64+
libffi-dev:armhf \
4965
# Compilers
5066
gcc-arm-linux-gnueabihf \
5167
g++-arm-linux-gnueabihf \
@@ -70,19 +86,140 @@ RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
7086

7187
ENV PATH="$SCCACHE_HOME:$PATH"
7288

73-
# Setup Python
89+
# Build Pythons
90+
# Python 3.9
91+
92+
# To cross-compile Python 3.9 we need to first compile it for the host
93+
RUN wget https://www.python.org/ftp/python/3.9.21/Python-3.9.21.tar.xz
94+
95+
RUN tar -xf Python-3.9.21.tar.xz && \
96+
cd Python-3.9.21 && \
97+
./configure --enable-optimizations && \
98+
make -j $(nproc) && \
99+
make altinstall
100+
101+
# Compile Python 3.9 for ARM
102+
RUN cd Python-3.9.21 && make distclean && \
103+
./configure \
104+
--host=arm-linux-gnueabihf \
105+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
106+
--disable-ipv6 \
107+
--enable-shared \
108+
--prefix=/opt/python3.9_arm \
109+
ac_cv_file__dev_ptmx=no \
110+
ac_cv_file__dev_ptc=no && \
111+
make -j $(nproc) && make altinstall
112+
113+
# Python 3.10
114+
# To cross-compile Python 3.10 we need to first compile it for the host
115+
RUN wget https://www.python.org/ftp/python/3.10.16/Python-3.10.16.tar.xz
116+
117+
RUN tar -xf Python-3.10.16.tar.xz && \
118+
cd Python-3.10.16 && \
119+
./configure --enable-optimizations && \
120+
make -j $(nproc) && \
121+
make altinstall
122+
123+
# Compile Python 3.10 for ARM
124+
RUN cd Python-3.10.16 && make distclean && \
125+
./configure \
126+
--host=arm-linux-gnueabihf \
127+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
128+
--disable-ipv6 \
129+
--enable-shared \
130+
--prefix=/opt/python3.10_arm \
131+
ac_cv_file__dev_ptmx=no \
132+
ac_cv_file__dev_ptc=no && \
133+
make -j $(nproc) && make altinstall
134+
135+
# Upgrade openssl to 3.3.1 for Python3.11 - 3.13 ssl module
136+
RUN wget https://www.openssl.org/source/openssl-3.3.1.tar.gz && \
137+
tar -zxf openssl-3.3.1.tar.gz && \
138+
cd openssl-3.3.1 && \
139+
./config && \
140+
make install && \
141+
ln -sf /usr/local/bin/openssl /usr/bin/openssl && \
142+
echo /usr/local/lib64 | tee /etc/ld.so.conf.d/custom.conf && \
143+
ldconfig && \
144+
openssl version
145+
146+
# Python 3.11
147+
# To cross-compile Python 3.11 we need to first compile it for the host
74148
RUN wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tar.xz
75149

76150
RUN tar -xf Python-3.11.9.tar.xz && \
77151
cd Python-3.11.9 && \
78-
./configure --enable-optimizations && \
79-
make -j 8 && \
152+
LDFLAGS="-L/usr/local/lib64" ./configure --with-openssl=/usr/local --with-openssl-rpath=auto && \
153+
make -j $(nproc) && \
154+
make altinstall
155+
156+
# Compile Python 3.11 for ARM
157+
RUN cd Python-3.11.9 && make distclean && \
158+
./configure \
159+
--host=arm-linux-gnueabihf \
160+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
161+
--disable-ipv6 \
162+
--enable-shared \
163+
--with-build-python \
164+
--prefix=/opt/python3.11_arm \
165+
ac_cv_file__dev_ptmx=no \
166+
ac_cv_file__dev_ptc=no && \
167+
make -j $(nproc) && make altinstall
168+
169+
# Python 3.12
170+
# To cross-compile Python 3.12 we need to first compile it for the host
171+
RUN wget https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tar.xz
172+
173+
RUN tar -xf Python-3.12.9.tar.xz && \
174+
cd Python-3.12.9 && \
175+
LDFLAGS="-L/usr/local/lib64" ./configure --with-openssl=/usr/local --with-openssl-rpath=auto && \
176+
make -j $(nproc) && \
177+
make altinstall
178+
179+
# Compile Python 3.12 for ARM
180+
RUN cd Python-3.12.9 && make distclean && \
181+
./configure \
182+
--host=arm-linux-gnueabihf \
183+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
184+
--disable-ipv6 \
185+
--enable-shared \
186+
--with-build-python \
187+
--prefix=/opt/python3.12_arm \
188+
ac_cv_file__dev_ptmx=no \
189+
ac_cv_file__dev_ptc=no && \
190+
make -j $(nproc) && make altinstall
191+
192+
# Python 3.13
193+
# To cross-compile Python 3.13 we need to first compile it for the host
194+
RUN wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
195+
196+
RUN tar -xf Python-3.13.2.tar.xz && \
197+
cd Python-3.13.2 && \
198+
LDFLAGS="-L/usr/local/lib64" ./configure --with-openssl=/usr/local --with-openssl-rpath=auto && \
199+
make -j $(nproc) && \
80200
make altinstall
81201

202+
# Compile Python 3.13 for ARM
203+
RUN cd Python-3.13.2 && make distclean && \
204+
./configure \
205+
--host=arm-linux-gnueabihf \
206+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
207+
--disable-ipv6 \
208+
--enable-shared \
209+
--with-build-python \
210+
--prefix=/opt/python3.13_arm \
211+
ac_cv_file__dev_ptmx=no \
212+
ac_cv_file__dev_ptc=no && \
213+
make -j $(nproc) && make altinstall
214+
82215
# Setup pip
83216
ENV PIP_VERSION="24.0"
84-
RUN python3 -m pip install --upgrade pip==24.0
85-
RUN python3.11 -m pip install --upgrade pip==24.0
217+
RUN python3 -m pip install --upgrade pip==${PIP_VERSION} && \
218+
python3.9 -m pip install --upgrade pip==${PIP_VERSION} && \
219+
python3.10 -m pip install --upgrade pip==${PIP_VERSION} && \
220+
python3.11 -m pip install --upgrade pip==${PIP_VERSION} && \
221+
python3.12 -m pip install --upgrade pip==${PIP_VERSION} && \
222+
python3.13 -m pip install --upgrade pip==${PIP_VERSION}
86223

87224
# Use Python 3.11 as default
88225
# Using venv here because other methods to switch the default Python break both system and wheels build

.github/dockerfiles/ov_build/fedora_29/Dockerfile

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,44 @@ RUN chmod +x /install_build_dependencies.sh && \
3232
/install_build_dependencies.sh && \
3333
rm -rf /var/lib/apt/lists/*
3434

35-
# Setup Python
35+
# Build Pythons
36+
# Python 3.9
3637
RUN cd /usr/src && \
37-
wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz && \
38-
tar xvf Python-3.9.9.tar.xz
39-
RUN cd /usr/src/Python-3.9.9 && \
38+
wget https://www.python.org/ftp/python/3.9.21/Python-3.9.21.tar.xz && \
39+
tar xvf Python-3.9.21.tar.xz
40+
RUN cd /usr/src/Python-3.9.21 && \
41+
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
42+
make altinstall
43+
44+
# Python 3.10
45+
RUN cd /usr/src && \
46+
wget https://www.python.org/ftp/python/3.10.16/Python-3.10.16.tar.xz && \
47+
tar xvf Python-3.10.16.tar.xz
48+
RUN cd /usr/src/Python-3.10.16 && \
49+
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
50+
make altinstall
51+
52+
# Python 3.11
53+
RUN cd /usr/src && \
54+
wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tar.xz && \
55+
tar xvf Python-3.11.9.tar.xz
56+
RUN cd /usr/src/Python-3.11.9 && \
57+
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
58+
make altinstall
59+
60+
# Python 3.12
61+
RUN cd /usr/src && \
62+
wget https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tar.xz && \
63+
tar xvf Python-3.12.9.tar.xz
64+
RUN cd /usr/src/Python-3.12.9 && \
65+
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
66+
make altinstall
67+
68+
# Python 3.13
69+
RUN cd /usr/src && \
70+
wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz && \
71+
tar xvf Python-3.13.2.tar.xz
72+
RUN cd /usr/src/Python-3.13.2 && \
4073
./configure --enable-optimizations --enable-loadable-sqlite-extensions --prefix=/usr && \
4174
make altinstall
4275

@@ -61,6 +94,10 @@ RUN alternatives --install /usr/bin/python python /usr/bin/python3.9 10
6194
ENV PIP_VERSION="24.0"
6295
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
6396
python3.9 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
97+
python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
98+
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
99+
python3.12 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
100+
python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
64101
rm -f get-pip.py
65102

66103
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

.github/dockerfiles/ov_build/ubuntu_20_04_arm64/Dockerfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ RUN apt-get update && \
2626
# parallel gzip
2727
pigz \
2828
# Pythons
29-
python3.8-dev \
30-
python3.8-venv \
31-
python3.8-distutils \
29+
python3.9-dev \
30+
python3.9-venv \
31+
python3.9-distutils \
32+
python3.10-dev \
33+
python3.10-venv \
34+
python3.10-distutils \
3235
python3.11-dev \
3336
python3.11-venv \
3437
python3.11-distutils \
38+
python3.12-dev \
39+
python3.12-venv \
40+
python3.13-dev \
41+
python3.13-venv \
3542
libhdf5-dev \
3643
# For Java API
3744
default-jdk \
@@ -64,8 +71,12 @@ RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
6471
# Setup pip
6572
ENV PIP_VERSION="24.0"
6673
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
67-
python3.8 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
74+
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
75+
python3.9 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
76+
python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
6877
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
78+
python3.12 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
79+
python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
6980
rm -f get-pip.py
7081

7182
# Use Python 3.11 as default instead of Python 3.8

.github/dockerfiles/ov_build/ubuntu_20_04_x64/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ RUN apt-get update && \
2828
python3.9-dev \
2929
python3.9-venv \
3030
python3.9-distutils \
31+
python3.10-dev \
32+
python3.10-venv \
33+
python3.10-distutils \
34+
python3.11-dev \
35+
python3.11-venv \
36+
python3.11-distutils \
37+
python3.12-dev \
38+
python3.12-venv \
39+
python3.13-dev \
40+
python3.13-venv \
3141
# For Java API
3242
default-jdk \
3343
&& \
@@ -56,6 +66,10 @@ ENV PIP_VERSION="24.0"
5666
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
5767
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
5868
python3.9 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
69+
python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
70+
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
71+
python3.12 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
72+
python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
5973
rm -f get-pip.py
6074

6175
# Use Python 3.9 as default instead of Python 3.8

.github/dockerfiles/ov_build/ubuntu_22_04_x64/Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,20 @@ RUN apt-get update && \
2525
libtbb2 \
2626
# parallel gzip
2727
pigz \
28-
# Pythons \
28+
# Pythons
29+
python3.9-dev \
30+
python3.9-venv \
31+
python3.9-distutils \
32+
python3.10-dev \
33+
python3.10-venv \
34+
python3.10-distutils \
2935
python3.11-dev \
3036
python3.11-venv \
3137
python3.11-distutils \
38+
python3.12-dev \
39+
python3.12-venv \
40+
python3.13-dev \
41+
python3.13-venv \
3242
# For Java API
3343
default-jdk \
3444
&& \
@@ -54,8 +64,12 @@ ENV PATH="$SCCACHE_HOME:$PATH"
5464
# Setup pip
5565
ENV PIP_VERSION="24.0"
5666
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
57-
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
67+
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
68+
python3.9 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
69+
python3.10 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
5870
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
71+
python3.12 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
72+
python3.13 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
5973
rm -f get-pip.py
6074

6175
# Use Python 3.11 as default

.github/dockerfiles/ov_build/ubuntu_24_04_x64/Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@ RUN apt-get update && \
2424
tzdata \
2525
# parallel gzip
2626
pigz \
27-
# Python
27+
# Pythons
28+
python3.9-dev \
29+
python3.9-venv \
30+
python3.9-distutils \
31+
python3.10-dev \
32+
python3.10-venv \
33+
python3.10-distutils \
34+
python3.11-dev \
35+
python3.11-venv \
36+
python3.11-distutils \
37+
python3.12-dev \
38+
python3.12-venv \
39+
python3.13-dev \
40+
python3.13-venv \
2841
python3-dev \
2942
python3-venv \
3043
python3-pip \
@@ -59,6 +72,11 @@ ENV PATH="/venv/bin:$PATH"
5972

6073
# Setup pip
6174
ENV PIP_VERSION="24.0"
62-
RUN /venv/bin/python3 -m pip install --upgrade pip==${PIP_VERSION}
75+
RUN /venv/bin/python3 -m pip install --upgrade pip==${PIP_VERSION} && \
76+
python3.9 -m pip install --upgrade pip==${PIP_VERSION} && \
77+
python3.10 -m pip install --upgrade pip==${PIP_VERSION} && \
78+
python3.11 -m pip install --upgrade pip==${PIP_VERSION} && \
79+
python3.12 -m pip install --upgrade pip==${PIP_VERSION} && \
80+
python3.13 -m pip install --upgrade pip==${PIP_VERSION}
6381

6482
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

0 commit comments

Comments
 (0)