forked from metal3-io/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathbuild-wheels-ocp.sh
More file actions
executable file
·45 lines (36 loc) · 1.67 KB
/
Copy pathbuild-wheels-ocp.sh
File metadata and controls
executable file
·45 lines (36 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/bash
# This script builds Python wheels from cachito sources for the OCP build.
# It runs in the wheel-builder stage of the Docker build.
# Adapted from the upstream build-wheels.sh for the downstream cachito pipeline.
set -euxo pipefail
REQS="${REMOTE_SOURCES_DIR}/requirements.cachito"
# load cachito variables only if they're available
if [[ -d "${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps" ]]; then
source "${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env"
REQS="${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/app/requirements.cachito"
fi
# NOTE(elfosardo): --no-build-isolation is needed to allow build engine
# to use build tools already installed in the system, for our case
# setuptools and pbr, instead of installing them in the isolated
# pip environment.
WHEEL_OPTIONS="--no-cache-dir --no-build-isolation --no-index"
# NOTE(elfosardo): download all the libraries and dependencies first,
# using --no-deps to avoid chain-downloading packages.
# This forces to download only the packages specified in the requirements file.
# This is done to allow testing any source code package in CI emulating
# the cachito downstream build pipeline.
# See https://issues.redhat.com/browse/METAL-1049 for more details.
PIP_SOURCES_DIR="/tmp/all_sources"
mkdir -p $PIP_SOURCES_DIR
python3.12 -m pip download --no-binary=:all: --no-build-isolation --no-deps -r "${REQS}" -d $PIP_SOURCES_DIR
# Build wheels from downloaded sources
mkdir -p /wheels
python3.12 -m pip wheel \
$WHEEL_OPTIONS \
--wheel-dir=/wheels \
--no-deps \
--find-links=$PIP_SOURCES_DIR \
-r "${REQS}"
rm -rf $PIP_SOURCES_DIR
echo "Wheels built successfully in /wheels"
ls -la /wheels/