-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Signed-off-by: Michele Dolfi <[email protected]>
- Loading branch information
1 parent
8d903ba
commit e1c8e49
Showing
13 changed files
with
294 additions
and
153 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,34 @@ | ||
#!/bin/bash | ||
|
||
set -e # trigger failure on error - do not remove! | ||
set -x # display command on output | ||
|
||
# Build the sdist | ||
poetry build -f sdist | ||
|
||
# Compile the wheel from sdist in centos stream | ||
|
||
docker build -f - . <<EOF | ||
FROM quay.io/centos/centos:stream9 | ||
RUN dnf config-manager --set-enabled crb | ||
# RUN dnf copr -y enable cheimes/deepsearch-glm rhel-9-x86_64 | ||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ | ||
&& dnf clean all | ||
RUN dnf install -y --nodocs \ | ||
gcc gcc-c++ git make cmake pkgconfig glibc-devel \ | ||
python3.11 python3.11-pip python3.11-devel \ | ||
libjpeg-turbo-devel libpng-devel qpdf-devel json-devel utf8cpp-devel zlib-devel \ | ||
loguru-devel \ | ||
&& dnf clean all | ||
RUN mkdir /src | ||
COPY ./dist/*.tar.gz /src/ | ||
RUN USE_SYSTEM_DEPS=ON pip3.11 install /src/docling_parse*.tar.gz \ | ||
&& python3.11 -c 'from docling_parse.docling_parse import pdf_parser' | ||
COPY ./tests /src/tests | ||
RUN cd /src \ | ||
&& pip3.11 install pytest \ | ||
&& pytest | ||
EOF |
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,12 @@ | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-poetry | ||
- name: Run build in docker | ||
run: ./.github/scripts/build_rhel.sh | ||
shell: bash |
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 |
---|---|---|
|
@@ -287,7 +287,6 @@ pyrightconfig.json | |
[Ll]ib | ||
[Ll]ib64 | ||
[Ll]ocal | ||
[Ss]cripts | ||
pyvenv.cfg | ||
pip-selfcheck.json | ||
|
||
|
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
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 |
---|---|---|
@@ -1,36 +1,54 @@ | ||
|
||
message(STATUS "entering in extlib_jpeg.cmake") | ||
|
||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
set(ext_name "jpeg") | ||
|
||
set(JPEG_URL https://github.com/libjpeg-turbo/libjpeg-turbo.git) | ||
set(JPEG_TAG 3.0.3) | ||
if(USE_SYSTEM_DEPS) | ||
find_package(PkgConfig) | ||
pkg_check_modules(libjpeg REQUIRED IMPORTED_TARGET libjpeg) | ||
|
||
ExternalProject_Add(extlib_jpeg | ||
PREFIX extlib_jpeg | ||
add_library(${ext_name} ALIAS PkgConfig::libjpeg) | ||
#set_target_properties(${ext_name} PROPERTIES INTERFACE_LINK_LIBRARIES "${libjpeg_LIBRARIES}") | ||
#set_target_properties(${ext_name} PROPERTIES INTERFACE_LINK_DIRECTORIES "${libjpeg_LIBRARY_DIRS}") | ||
#set_target_properties(${ext_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${libjpeg_INCLUDEDIR}") | ||
|
||
UPDATE_COMMAND "" | ||
GIT_REPOSITORY ${JPEG_URL} | ||
GIT_TAG ${JPEG_TAG} | ||
else() | ||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
|
||
BUILD_ALWAYS OFF | ||
set(JPEG_URL https://github.com/libjpeg-turbo/libjpeg-turbo.git) | ||
set(JPEG_TAG 3.0.3) | ||
|
||
INSTALL_DIR ${EXTERNALS_PREFIX_PATH} | ||
ExternalProject_Add(extlib_jpeg | ||
|
||
CMAKE_ARGS \\ | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \\ | ||
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \\ | ||
-DCMAKE_C_FLAGS=${ENV_ARCHFLAGS} \\ | ||
-DARMV8_BUILD=ON \\ | ||
-DCMAKE_INSTALL_LIBDIR=${EXTERNALS_PREFIX_PATH}/lib \\ | ||
-DCMAKE_INSTALL_PREFIX=${EXTERNALS_PREFIX_PATH} | ||
PREFIX extlib_jpeg | ||
|
||
BUILD_IN_SOURCE ON | ||
LOG_DOWNLOAD ON | ||
# LOG_BUILD ON | ||
) | ||
UPDATE_COMMAND "" | ||
GIT_REPOSITORY ${JPEG_URL} | ||
GIT_TAG ${JPEG_TAG} | ||
|
||
add_library(jpeg STATIC IMPORTED) | ||
set_target_properties(jpeg PROPERTIES IMPORTED_LOCATION ${EXTERNALS_PREFIX_PATH}/lib/libjpeg.a) | ||
add_dependencies(jpeg extlib_jpeg) | ||
BUILD_ALWAYS OFF | ||
|
||
INSTALL_DIR ${EXTERNALS_PREFIX_PATH} | ||
|
||
CMAKE_ARGS \\ | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \\ | ||
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \\ | ||
-DCMAKE_C_FLAGS=${ENV_ARCHFLAGS} \\ | ||
-DARMV8_BUILD=ON \\ | ||
-DCMAKE_INSTALL_LIBDIR=${EXTERNALS_PREFIX_PATH}/lib \\ | ||
-DCMAKE_INSTALL_PREFIX=${EXTERNALS_PREFIX_PATH} | ||
|
||
BUILD_IN_SOURCE ON | ||
LOG_DOWNLOAD ON | ||
# LOG_BUILD ON | ||
) | ||
|
||
add_library(${ext_name} STATIC IMPORTED) | ||
add_dependencies(${ext_name} extlib_jpeg) | ||
set_target_properties(${ext_name} PROPERTIES | ||
IMPORTED_LOCATION ${EXTERNALS_PREFIX_PATH}/lib/libjpeg.a | ||
INTERFACE_INCLUDE_DIRECTORIES ${EXTERNALS_PREFIX_PATH}/include | ||
) | ||
|
||
endif() |
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 |
---|---|---|
@@ -1,28 +1,44 @@ | ||
|
||
message(STATUS "entering in extlib_json.cmake") | ||
|
||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
set(ext_name "json") | ||
|
||
set(JSON_URL https://github.com/nlohmann/json.git) | ||
set(JSON_TAG v3.11.3) | ||
if(USE_SYSTEM_DEPS) | ||
# this will define the nlohmann_json::nlohmann_json target | ||
find_package(nlohmann_json REQUIRED) | ||
|
||
ExternalProject_Add(extlib_json | ||
PREFIX extlib_json | ||
add_library(${ext_name} INTERFACE IMPORTED) | ||
add_dependencies(${ext_name} nlohmann_json::nlohmann_json) | ||
|
||
GIT_REPOSITORY ${JSON_URL} | ||
GIT_TAG ${JSON_TAG} | ||
else() | ||
|
||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
include(ExternalProject) | ||
include(CMakeParseArguments) | ||
|
||
BUILD_COMMAND "" | ||
BUILD_ALWAYS OFF | ||
set(JSON_URL https://github.com/nlohmann/json.git) | ||
set(JSON_TAG v3.11.3) | ||
|
||
INSTALL_DIR ${EXTERNALS_PREFIX_PATH} | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include/ ${EXTERNALS_PREFIX_PATH}/include/ | ||
ExternalProject_Add(extlib_json | ||
|
||
PREFIX extlib_json | ||
|
||
GIT_REPOSITORY ${JSON_URL} | ||
GIT_TAG ${JSON_TAG} | ||
|
||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
|
||
BUILD_COMMAND "" | ||
BUILD_ALWAYS OFF | ||
|
||
INSTALL_DIR ${EXTERNALS_PREFIX_PATH} | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include/ ${EXTERNALS_PREFIX_PATH}/include/ | ||
) | ||
|
||
add_library(json INTERFACE) | ||
add_custom_target(install_extlib_json DEPENDS extlib_json) | ||
add_dependencies(json install_extlib_json) | ||
add_library(${ext_name} INTERFACE IMPORTED) | ||
add_dependencies(${ext_name} extlib_json) | ||
set_target_properties(${ext_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${EXTERNALS_PREFIX_PATH}/include) | ||
|
||
endif() | ||
|
||
|
Oops, something went wrong.