Skip to content

Commit eede0e5

Browse files
Remove python installation from build images
python should now come fully hermetic from bazel CMK-21151 and CMK-32337 Change-Id: I61ac5fe9fe3cfd96a6a031d31ed5bafafa6adfcd
1 parent 194e27b commit eede0e5

12 files changed

Lines changed: 3 additions & 78 deletions

File tree

buildscripts/infrastructure/build-nodes/almalinux-10/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ RUN /opt/install-protobuf-cpp.sh
175175
COPY install-openssl.sh /opt/
176176
RUN /opt/install-openssl.sh
177177

178-
COPY install-python.sh /opt/
179-
RUN /opt/install-python.sh
180178

181179
# install GDB after Python as it requires shared object files, see CMK-15854
182180
COPY install-gdb.sh /opt/
@@ -209,7 +207,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
209207
RUN /opt/install-valgrind.sh link-only
210208
RUN /opt/install-cmake.sh link-only
211209
RUN /opt/install-protobuf-cpp.sh --link-only
212-
RUN /opt/install-python.sh link-only
213210
RUN /opt/install-bazel.sh link-only
214211

215212
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/almalinux-8/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ RUN /opt/install-protobuf-cpp.sh
170170
COPY install-openssl.sh /opt/
171171
RUN /opt/install-openssl.sh
172172

173-
COPY install-python.sh /opt/
174-
RUN /opt/install-python.sh
175173

176174
# install GDB after Python as it requires shared object files, see CMK-15854
177175
COPY install-gdb.sh /opt/
@@ -204,7 +202,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
204202
RUN /opt/install-valgrind.sh link-only
205203
RUN /opt/install-cmake.sh link-only
206204
RUN /opt/install-protobuf-cpp.sh --link-only
207-
RUN /opt/install-python.sh link-only
208205
RUN /opt/install-bazel.sh link-only
209206

210207
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/almalinux-9/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ RUN /opt/install-protobuf-cpp.sh
199199
COPY install-openssl.sh /opt/
200200
RUN /opt/install-openssl.sh
201201

202-
COPY install-python.sh /opt/
203-
RUN /opt/install-python.sh
204202

205203
# install GDB after Python as it requires shared object files, see CMK-15854
206204
COPY install-gdb.sh /opt/
@@ -233,7 +231,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
233231
RUN /opt/install-valgrind.sh link-only
234232
RUN /opt/install-cmake.sh link-only
235233
RUN /opt/install-protobuf-cpp.sh --link-only
236-
RUN /opt/install-python.sh link-only
237234
RUN /opt/install-bazel.sh link-only
238235

239236
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/debian-12/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ RUN /opt/install-protobuf-cpp.sh
126126
COPY install-openssl.sh /opt/
127127
RUN /opt/install-openssl.sh
128128

129-
COPY install-python.sh /opt/
130-
RUN /opt/install-python.sh
131129

132130
# install GDB after Python as it requires shared object files, see CMK-15854
133131
COPY install-gdb.sh /opt/
@@ -160,7 +158,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
160158
RUN /opt/install-valgrind.sh link-only
161159
RUN /opt/install-cmake.sh link-only
162160
RUN /opt/install-protobuf-cpp.sh --link-only
163-
RUN /opt/install-python.sh link-only
164161
RUN /opt/install-bazel.sh link-only
165162

166163
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/debian-13/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ RUN /opt/install-protobuf-cpp.sh
125125
COPY install-openssl.sh /opt/
126126
RUN /opt/install-openssl.sh
127127

128-
COPY install-python.sh /opt/
129-
RUN /opt/install-python.sh
130128

131129
# install GDB after Python as it requires shared object files, see CMK-15854
132130
COPY install-gdb.sh /opt/
@@ -159,7 +157,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
159157
RUN /opt/install-valgrind.sh link-only
160158
RUN /opt/install-cmake.sh link-only
161159
RUN /opt/install-protobuf-cpp.sh --link-only
162-
RUN /opt/install-python.sh link-only
163160
RUN /opt/install-bazel.sh link-only
164161

165162
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/scripts/install-development.sh

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,6 @@ collect_user_input() {
159159
print_green "User input collection done"
160160
}
161161

162-
strip_binaries() {
163-
STRIP_PATH="${INSTALL_PATH}"
164-
if [ $# -eq 1 ]; then
165-
STRIP_PATH=$1
166-
fi
167-
168-
if [[ -n ${CI} ]]; then
169-
# CI build, located at /opt
170-
/opt/strip_binaries "${STRIP_PATH}"
171-
else
172-
omd/strip_binaries "${STRIP_PATH}"
173-
fi
174-
}
175-
176162
prepare_gplusplus_sources_list() {
177163
if [[ $(echo "$VERSION_NUMBER" | cut -f1 -d'.') -gt 22 ]]; then
178164
return
@@ -262,30 +248,16 @@ install_for_python_dev() {
262248
rm "${SCRIPT_DIR}"/INSTALLED_BY_PYENV
263249
print_debug "INSTALLED_BY_PYENV: $INSTALLED_BY_PYENV"
264250
else
265-
# not installed via pyenv, do it the oldschool way
266-
print_blue "All right, Python will be installed as done in the CI to $TARGET_DIR"
267-
install_python_and_teammates
251+
print_blue "Python comes fully hermetic from bazel, only installing openssl."
252+
install_ssl
268253
fi
269254

270255
print_green "Installation for Python development done"
271256
}
272257

273-
install_python_and_teammates() {
258+
install_ssl() {
274259
export TARGET_DIR="${INSTALL_PATH}"
275260
"${SCRIPT_DIR}"/install-openssl.sh
276-
"${SCRIPT_DIR}"/install-python.sh
277-
278-
if [[ $STRIP_LATER -eq 1 ]]; then
279-
print_blue "strip_binaries during Python setup"
280-
strip_for_python
281-
"${SCRIPT_DIR}"/install-python.sh link-only
282-
fi
283-
}
284-
285-
strip_for_python() {
286-
# strip only the content of the latest created directory
287-
strip_binaries "$(find "${INSTALL_PATH}" -maxdepth 1 -type d -name "Python-*" -print -quit | head -n 1)"
288-
strip_binaries "$(find "${INSTALL_PATH}" -maxdepth 1 -type d -name "openssl-*" -print -quit | head -n 1)"
289261
}
290262

291263
install_for_cpp_dev() {
@@ -420,8 +392,6 @@ INSTALL_FOR_CPP=0
420392
INSTALL_FOR_LOCALIZE=0
421393
INSTALL_FOR_BAZEL=0
422394
INSTALLED_BY_PYENV=0
423-
# strip only once, if "all" or multiple profiles selected, do it at the end
424-
STRIP_LATER=0
425395
for PROFILE in "${PROFILE_ARGS[@]}"; do
426396
case "$PROFILE" in
427397
all)
@@ -430,17 +400,14 @@ for PROFILE in "${PROFILE_ARGS[@]}"; do
430400
INSTALL_FOR_CPP=1
431401
INSTALL_FOR_LOCALIZE=1
432402
INSTALL_FOR_BAZEL=1
433-
((STRIP_LATER += 5))
434403
;;
435404
python)
436405
((REQUIRES_NEXUS += 1))
437406
INSTALL_FOR_PYTHON=1
438-
((STRIP_LATER += 1))
439407
;;
440408
cpp)
441409
((REQUIRES_NEXUS += 1))
442410
INSTALL_FOR_CPP=1
443-
((STRIP_LATER += 1))
444411
;;
445412
localize)
446413
INSTALL_FOR_LOCALIZE=1
@@ -461,7 +428,6 @@ print_debug "INSTALL_FOR_CPP = ${INSTALL_FOR_CPP}"
461428
print_debug "INSTALL_FOR_LOCALIZE = ${INSTALL_FOR_LOCALIZE}"
462429
print_debug "INSTALL_FOR_BAZEL = ${INSTALL_FOR_BAZEL}"
463430
print_debug "REQUIRES_NEXUS = ${REQUIRES_NEXUS}"
464-
print_debug "STRIP_LATER = ${STRIP_LATER}"
465431

466432
if [[ -n ${CI} ]]; then
467433
print_debug "It is a CI build, don't ask for a password"
@@ -495,16 +461,6 @@ if [[ $INSTALL_FOR_LOCALIZE -eq 1 ]]; then
495461
install_for_localize_dev
496462
fi
497463

498-
if [[ $STRIP_LATER -gt 1 ]]; then
499-
print_blue "strip_binaries finally"
500-
501-
if [[ $INSTALL_FOR_PYTHON -eq 1 && $INSTALLED_BY_PYENV -eq 0 ]]; then
502-
print_debug "Link Python"
503-
strip_for_python
504-
"${SCRIPT_DIR}"/install-python.sh link-only
505-
fi
506-
fi
507-
508464
if [[ $INSTALL_ONLY -eq 0 ]]; then
509465
# basic tools and env variables required to install docker
510466
"${SCRIPT_DIR}"/install-docker.sh

buildscripts/infrastructure/build-nodes/sles-15sp7/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ RUN /opt/install-protobuf-cpp.sh
138138
COPY install-openssl.sh /opt/
139139
RUN /opt/install-openssl.sh
140140

141-
COPY install-python.sh /opt/
142-
RUN /opt/install-python.sh
143141

144142
# install GDB after Python as it requires shared object files, see CMK-15854
145143
COPY install-gdb.sh /opt/
@@ -172,7 +170,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
172170
RUN /opt/install-valgrind.sh link-only
173171
RUN /opt/install-cmake.sh link-only
174172
RUN /opt/install-protobuf-cpp.sh --link-only
175-
RUN /opt/install-python.sh link-only
176173
RUN /opt/install-bazel.sh link-only
177174

178175
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/sles-16.0/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ RUN /opt/install-protobuf-cpp.sh
137137
COPY install-openssl.sh /opt/
138138
RUN /opt/install-openssl.sh
139139

140-
COPY install-python.sh /opt/
141-
RUN /opt/install-python.sh
142140

143141
# install GDB after Python as it requires shared object files, see CMK-15854
144142
COPY install-gdb.sh /opt/
@@ -171,7 +169,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
171169
RUN /opt/install-valgrind.sh link-only
172170
RUN /opt/install-cmake.sh link-only
173171
RUN /opt/install-protobuf-cpp.sh --link-only
174-
RUN /opt/install-python.sh link-only
175172
RUN /opt/install-bazel.sh link-only
176173

177174
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/ubuntu-22.04/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ RUN /opt/install-protobuf-cpp.sh
138138
COPY install-openssl.sh /opt/
139139
RUN /opt/install-openssl.sh
140140

141-
COPY install-python.sh /opt/
142-
RUN /opt/install-python.sh
143141

144142
# install GDB after Python as it requires shared object files, see CMK-15854
145143
COPY install-gdb.sh /opt/
@@ -172,7 +170,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
172170
RUN /opt/install-valgrind.sh link-only
173171
RUN /opt/install-cmake.sh link-only
174172
RUN /opt/install-protobuf-cpp.sh --link-only
175-
RUN /opt/install-python.sh link-only
176173
RUN /opt/install-bazel.sh link-only
177174

178175
# Install non cached dependencies

buildscripts/infrastructure/build-nodes/ubuntu-24.04/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ RUN /opt/install-protobuf-cpp.sh
141141
COPY install-openssl.sh /opt/
142142
RUN /opt/install-openssl.sh
143143

144-
COPY install-python.sh /opt/
145-
RUN /opt/install-python.sh
146144

147145
# install GDB after Python as it requires shared object files, see CMK-15854
148146
COPY install-gdb.sh /opt/
@@ -175,7 +173,6 @@ RUN /opt/install-gnu-toolchain.sh link-only
175173
RUN /opt/install-valgrind.sh link-only
176174
RUN /opt/install-cmake.sh link-only
177175
RUN /opt/install-protobuf-cpp.sh --link-only
178-
RUN /opt/install-python.sh link-only
179176
RUN /opt/install-bazel.sh link-only
180177

181178
# Install non cached dependencies

0 commit comments

Comments
 (0)