Skip to content

Commit 57c376d

Browse files
dolfim-ibmtiran
andauthored
chore: fix rhel ci with proper deps and network isolation (#63)
Signed-off-by: Christian Heimes <[email protected]> Signed-off-by: Michele Dolfi <[email protected]> Co-authored-by: Christian Heimes <[email protected]>
1 parent 160ce19 commit 57c376d

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

.github/scripts/build_rhel.sh

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,44 @@ set -x # display command on output
66
# Build the Python package with Poetry
77
poetry build -f sdist
88

9-
USE_SYSTEM_DEPS="ON"
10-
11-
docker build --progress=plain \
9+
sudo -E XDG_RUNTIME_DIR= podman build --progress=plain \
1210
--build-arg USE_SYSTEM_DEPS="$USE_SYSTEM_DEPS" \
1311
-f - . <<EOF
1412
# syntax=docker/dockerfile:1
1513
1614
FROM quay.io/centos/centos:stream9
1715
18-
RUN dnf config-manager --set-enabled crb
19-
20-
RUN dnf copr -y enable cheimes/deepsearch-glm rhel-9-x86_64
21-
22-
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
23-
&& dnf clean all
16+
RUN dnf update -y \
17+
&& dnf install -y 'dnf-command(config-manager)' 'dnf-command(copr)' \
18+
&& dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
19+
&& dnf copr -y enable cheimes/deepsearch-glm rhel-9-x86_64 \
20+
&& crb enable \
21+
&& dnf clean all
2422
2523
RUN dnf install -y --nodocs \
2624
autoconf automake binutils cmake gcc gcc-c++ git glibc-devel glibc-headers glibc-static kernel-devel libtool libstdc++-devel make ninja-build pkgconfig zlib-devel \
2725
python3.11 python3.11-pip python3.11-devel \
28-
libjpeg-turbo-devel libpng-devel qpdf-devel json-devel utf8cpp-devel \
26+
libjpeg-turbo-devel libpng-devel qpdf-devel json-devel utf8cpp-devel loguru-devel cxxopts-devel \
2927
&& dnf clean all
3028
31-
# # RUN dnf install -y --nodocs loguru-devel
32-
33-
# TEMPORARY loguru install method
34-
# https://koji.fedoraproject.org/koji/buildinfo?buildID=2563067
35-
RUN curl -O https://kojipkgs.fedoraproject.org//packages/loguru/2.2.0%5E20230406git4adaa18/5.el9/x86_64/loguru-2.2.0%5E20230406git4adaa18-5.el9.x86_64.rpm
36-
RUN dnf install -y loguru-2.2.0%5E20230406git4adaa18-5.el9.x86_64.rpm
37-
RUN curl -O https://kojipkgs.fedoraproject.org//packages/loguru/2.2.0%5E20230406git4adaa18/5.el9/x86_64/loguru-devel-2.2.0%5E20230406git4adaa18-5.el9.x86_64.rpm
38-
RUN dnf install -y loguru-devel-2.2.0%5E20230406git4adaa18-5.el9.x86_64.rpm
29+
WORKDIR /src
3930
40-
RUN mkdir /src
31+
COPY ./dist/*.tar.gz .
4132
42-
COPY ./dist/*.tar.gz /src/
33+
ENV USE_SYSTEM_DEPS=on
4334
44-
RUN USE_SYSTEM_DEPS=\$USE_SYSTEM_DEPS pip3.11 install /src/docling_parse*.tar.gz \
35+
# pre-install build requirements + wheel for "--no-build-isolation"
36+
# build docling-parse wheel in an isolated network namespace (unshare -rn)
37+
# install the wheel and its dependencies
38+
RUN pip3.11 install poetry-core pybind11 wheel \
39+
&& unshare -rn pip3.11 wheel \
40+
--no-deps --no-build-isolation -w /dist/ \
41+
/src/docling_parse*.tar.gz \
42+
&& pip3.11 install /dist/docling_parse*.whl \
4543
&& python3.11 -c 'from docling_parse.docling_parse import pdf_parser_v1, pdf_parser_v2'
4644
4745
COPY ./tests /src/tests
4846
49-
RUN cd /src \
50-
&& pip3.11 install pytest \
47+
RUN pip3.11 install pytest \
5148
&& pytest
5249
EOF

.github/workflows/rhel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
steps:
88
- uses: actions/checkout@v4
99
- uses: ./.github/actions/setup-poetry
10+
- name: Install podman
11+
run: sudo apt-get update && sudo apt-get install -y podman
1012
- name: Run build in docker
1113
run: ./.github/scripts/build_rhel.sh
1214
shell: bash

0 commit comments

Comments
 (0)