diff --git a/.github/scripts/e2e-test-server-linux-and-mac.sh b/.github/scripts/e2e-test-server-linux-and-mac.sh index 6a53a3f..ac8c207 100755 --- a/.github/scripts/e2e-test-server-linux-and-mac.sh +++ b/.github/scripts/e2e-test-server-linux-and-mac.sh @@ -23,6 +23,7 @@ PORT=$((RANDOM % range + min)) # Install numpy for Python export PYTHONHOME=$(pwd)/engines/cortex.python/python/ export LD_LIBRARY_PATH="$PYTHONHOME:$LD_LIBRARY_PATH" +export export DYLD_FALLBACK_LIBRARY_PATH="$PYTHONHOME:$DYLD_FALLBACK_LIBRARY_PATH" echo "Set Python HOME to $PYTHONHOME" ./engines/cortex.python/python/bin/python3 -m ensurepip ./engines/cortex.python/python/bin/python3 -m pip install --upgrade pip diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index e3856a4..ed7feaa 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -12,12 +12,12 @@ jobs: strategy: matrix: include: - - os: "linux" - name: "amd64" - runs-on: "ubuntu-18-04" # - os: "linux" # name: "amd64" - # runs-on: "ubuntu-latest" + # runs-on: "ubuntu-18-04" + - os: "linux" + name: "amd64" + runs-on: "ubuntu-latest" - os: "mac" name: "arm64" runs-on: "mac-silicon" @@ -36,11 +36,11 @@ jobs: id: checkout uses: actions/checkout@v3 - - name: Install OpenSSL on Ubuntu - if: matrix.os == 'linux' - run: | - sudo apt-get update - sudo apt-get install -y openssl libssl-dev + # - name: Install OpenSSL on Ubuntu + # if: matrix.os == 'linux' + # run: | + # sudo apt-get update + # sudo apt-get install -y openssl libssl-dev - name: Install make on Windows if: runner.os == 'windows' diff --git a/Makefile b/Makefile index 85b98fd..59f6a6d 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,16 @@ endif build-example-server: ifeq ($(OS),Windows_NT) @powershell -Command "mkdir -p .\examples\server\build\engines\cortex.python; cd .\examples\server\build; cmake .. $(CMAKE_EXTRA_FLAGS); cmake --build . --config Release; cp -r ..\..\..\build\python .\Release\engines\cortex.python\python" -else - mkdir -p examples/server/build/engines/cortex.python - cd examples/server/build && cmake .. && cmake --build . --config Release -j12 - cp -r build/python examples/server/build/engines/cortex.python +else + @mkdir -p examples/server/build/engines/cortex.python; \ + cp -rf build_deps/_install/lib/engines-3 build/python/; \ + cp -rf build_deps/_install/lib/libcrypto.* build/python/; \ + cp -rf build_deps/_install/lib/libssl.* build/python/; \ + cp -rf build_deps/_install/lib/ossl-modules build/python/; \ + cp -r build/python examples/server/build/engines/cortex.python; \ + ls examples/server/build/engines/cortex.python/python; + @cd examples/server/build; \ + cmake .. && cmake --build . --config Release -j12 endif package: @@ -51,6 +57,7 @@ ifeq ($(OS),Windows_NT) @powershell -Command "mkdir -p .\examples\server\build\Release\engines\cortex.python; cd examples\server\build\Release; cp ..\..\..\..\build\Release\engine.dll engines\cortex.python; ..\..\..\..\.github\scripts\e2e-test-server-windows.bat server.exe ..\..\..\..\$(PYTHON_FILE_EXECUTION_PATH);" else @mkdir -p examples/server/build/engines/cortex.python && \ + rm -rf build_deps && \ cd examples/server/build && \ cp ../../../build/libengine.$(shell uname | tr '[:upper:]' '[:lower:]' | sed 's/darwin/dylib/;s/linux/so/') engines/cortex.python/ && \ chmod +x ../../../.github/scripts/e2e-test-server-linux-and-mac.sh && ../../../.github/scripts/e2e-test-server-linux-and-mac.sh ./server ../../../$(PYTHON_FILE_EXECUTION_PATH) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 77a2197..1e89f94 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -92,6 +92,17 @@ if(APPLE) endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Download and install OpenSSL + ExternalProject_Add( + OpenSSL + URL https://www.openssl.org/source/openssl-3.3.0.tar.gz + PREFIX ${THIRD_PARTY_INSTALL_PATH} + CONFIGURE_COMMAND ./Configure --prefix= --libdir=lib + BUILD_COMMAND make -j8 + INSTALL_COMMAND make install + BUILD_IN_SOURCE 1 + ) + # Download and install zlib ExternalProject_Add( zlib @@ -139,7 +150,7 @@ if (UNIX) # APPLE and LINUX else() set(PYTHON_INSTALL_CONFIG_HOST "") set(PYTHON_INSTALL_CONFIG_BUILD "") - set(PYTHON_INSTALL_CONFIG_SSL "") + set(PYTHON_INSTALL_CONFIG_SSL "--with-openssl=${THIRD_PARTY_INSTALL_PATH} --with-openssl-rpath=auto") endif() # Download and install Python3 from source @@ -157,7 +168,7 @@ if (UNIX) # APPLE and LINUX if(APPLE) add_dependencies(Python3 XZUtils OpenSSL) else() # Linux - add_dependencies(Python3 zlib libffi) + add_dependencies(Python3 zlib libffi OpenSSL) endif() else() # WINDOWS