Skip to content

Commit

Permalink
remove datetime tag (#92)
Browse files Browse the repository at this point in the history
* update with buildx

* Update build.yml

* Update main.cpp

change localhost to 0.0.0.0

* Update build-dev.yml

* update Dockerfile

* update workflow

* Create version

* Rename version to VERSION

* Update build.yml

* Update VERSION

* Update build.yml

* Update build-dev.yml

* Update build-dev.yml

* Update Dockerfile

* Update build-dev.yml

* Update build-dev.yml

* Update build-dev.yml

* Create build-base.yml

* Update build-dev.yml

* Update build-dev.yml

* Update build.yml

* Update build-base.yml

* update

* Update build.yml

* Update build-dev.yml

* Delete engine/VERSION

* Update build.yml

* Update dockerfile

* Add back docker

* Revert "update oatpp dependency (#90)" (#94)

This reverts commit 2139141.

---------

Co-authored-by: richard-epsilla <richard@epsilla.com>
Co-authored-by: TopKeyboard <141210110+TopKeyboard@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 5, 2023
1 parent 2139141 commit e339089
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ jobs:
SHA_TAG: ${{ github.sha }}
run: |
export IMAGE_TAG=${{ steps.date.outputs.date }};
export IMAGE_TAG_LATEST="latest";
echo "IMAGE_TAG: ${IMAGE_TAG}";
export IMAGE_TAG_LATEST="latest";
echo "SHA: ${SHA_TAG}";
export RELEASE_TAG=`cat VERSION`;
Expand Down Expand Up @@ -74,7 +75,6 @@ jobs:
--label "org.opencontainers.image.version"=${RELEASE_TAG} \
--pull \
--push \
-t ${DOCKER_HUB_REPOSITORY}:${IMAGE_TAG} \
-t ${DOCKER_HUB_REPOSITORY}:${RELEASE_TAG} \
-t ${DOCKER_HUB_REPOSITORY}:${IMAGE_TAG_LATEST} .
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.1
43 changes: 14 additions & 29 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,6 @@ GET_CURRENT_TIME(BUILD_TIME)
string(REGEX REPLACE "\n" "" BUILD_TIME ${BUILD_TIME})
message(STATUS "Build time = ${BUILD_TIME}")

# include modules
include(FetchContent)
include(GoogleTest)

# configure modules
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
oatpp
URL https://github.com/oatpp/oatpp/archive/refs/tags/1.3.0.zip
)
FetchContent_GetProperties(oatpp)
if(NOT ExternalPackage_POPULATED)
FetchContent_Populate(oatpp)

# Set compiler flags for the fetched package
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic")

# Add the subdirectory for the fetched package
add_subdirectory(${oatpp_SOURCE_DIR} ${oatpp_BINARY_DIR})
endif()
FetchContent_MakeAvailable(oatpp)


# Now all includes are relative to the engine directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

Expand Down Expand Up @@ -92,7 +64,12 @@ list(APPEND LIB_FILES ${QUERY_FILES})

# used by PyBinding
find_package(PythonLibs REQUIRED)
find_package(oatpp REQUIRED)

add_library(oatpp STATIC IMPORTED)
set_target_properties(oatpp PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/build/dependencies/lib/oatpp-1.3.0/liboatpp.a"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/build/dependencies/include/oatpp-1.3.0/oatpp/"
)

add_library(vectordb_lib ${LIB_FILES})
add_library(vectordb_dylib SHARED ${LIB_FILES})
Expand Down Expand Up @@ -134,6 +111,14 @@ endif()



include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)

enable_testing()

set(DB_TEST_FILES)
Expand Down
1 change: 0 additions & 1 deletion engine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ elif [[ "$(uname -s)" == "Linux" ]]; then
N_PROCESSOR="$(nproc)"
fi


# Build
if [[ "$1" == "-d" ]]; then
echo "building in debug mode"
Expand Down
44 changes: 44 additions & 0 deletions engine/scripts/install_oatpp_modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
##########################################################
## install oatpp

MODULE_NAME="oatpp"
CURRENT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
INSTALL_PATH="$CURRENT_DIR/../build/dependencies"
echo "installing to: $INSTALL_PATH"
mkdir -p "${INSTALL_PATH}"
working_dir="$(mktemp -d)"
cd "${working_dir}"
git clone https://github.com/oatpp/$MODULE_NAME
cd $MODULE_NAME
git checkout tags/1.3.0
mkdir build
cd build

N_PROCESSOR=1
PLATFORM="$(uname -s)"
if [[ "$PLATFORM" == "Darwin" ]]; then
export CC=gcc-13
export CXX=g++-13
N_PROCESSOR="$(sysctl -n hw.ncpu)"
elif [[ "$PLATFORM" == "Linux" ]]; then
N_PROCESSOR="$(nproc)"
sudo apt-get update
sudo apt-get install -y python3 python3-pip git cmake build-essential libboost-all-dev
else
echo "Unknown platform: $PLATFORM"
fi

cmake \
-DOATPP_BUILD_TESTS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PATH}" \
..

make -j "${N_PROCESSOR}"
echo "installing OATPP to path ${INSTALL_PATH}"
make install


##########################################################

0 comments on commit e339089

Please sign in to comment.