Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*.exe
*.out
*.app
./tests/go/kvtest/cmd/kvtest/kvtest
./tests/go/kvtest/kvtest

# Project-specific
*.bak
Expand All @@ -46,3 +48,9 @@ build
var
tmp
current

# Compiled Protobufs
*.pb.*

# node
node_modules
51 changes: 49 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,61 @@
"debuggerPath": "/usr/bin/gdb"
},
},
{
"name": "Debug - BufferReaderWriter",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/BufferReaderWriterTest",
// Path to the compiled executable
"args": [
"--gtest_filter=BufferReaderWriterTest.ReadYourWrites"
],
// Arguments to pass to the program
"stopAtEntry": false,
// Set to true to stop at the program's entry point
"cwd": "${workspaceFolder}",
// Current working directory
"environment": [],
"externalConsole": false,
// Set to true if you want to use an external terminal
"MIMode": "gdb",
// Use "lldb" if you're using clang on macOS
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
// Ensure your program is built before launching
"miDebuggerPath": "/usr/bin/gdb",
// Path to the gdb or lldb debugger
"logging": {
"trace": true,
// Enable trace for debugging the launch.json config
"traceResponse": true,
"engineLogging": false
},
"launchCompleteCommand": "exec-run",
"targetArchitecture": "x86_64",
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "/bin/bash",
"pipeArgs": [
"-c"
],
"debuggerPath": "/usr/bin/gdb"
},
},
{
"name": "Debug - LSMTreeTest",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/LSMTreeTest",
// Path to the compiled executable
"args": [],
"args": [
"--gtest_filter=LSMTreeTestBasicCRUD.MultipleLargeKeyValuePairsFlush"
],
// Arguments to pass to the program
"stopAtEntry": false,
// Set to true to stop at the program's entry point
Expand All @@ -186,7 +234,6 @@
"ignoreFailures": true
}
],
"preLaunchTask": "build",
// Ensure your program is built before launching
"miDebuggerPath": "/usr/bin/gdb",
// Path to the gdb or lldb debugger
Expand Down
33 changes: 17 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ set(CMAKE_CXX_EXTENSIONS Off)

set(TINYKVPP_COMMON_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic-errors")
set(TINYKVPP_COMMON_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic-errors")
"${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic-errors"
)

message("Using compiler: ${CMAKE_CXX_COMPILER_ID}")

Expand All @@ -18,11 +19,11 @@ message("Using compiler: ${CMAKE_CXX_COMPILER_ID}")

# Support thread annotations by Clang
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${TINYKVPP_COMMON_C_FLAGS} -Wthread-safety")
set(CMAKE_CXX_FLAGS "${TINYKVPP_COMMON_CXX_FLAGS} -Wthread-safety")
set(CMAKE_C_FLAGS "${TINYKVPP_COMMON_C_FLAGS} -Wthread-safety")
set(CMAKE_CXX_FLAGS "${TINYKVPP_COMMON_CXX_FLAGS} -Wthread-safety")
else()
set(CMAKE_C_FLAGS "${TINYKVPP_COMMON_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${TINYKVPP_COMMON_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${TINYKVPP_COMMON_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${TINYKVPP_COMMON_CXX_FLAGS}")
endif()

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
Expand All @@ -47,22 +48,22 @@ find_package(prometheus-cpp REQUIRED)
find_package(libassert REQUIRED)
find_package(magic_enum REQUIRED)
find_package(liburing REQUIRED)

include_directories(lib)
find_package(Microsoft.GSL REQUIRED)
find_package(libuuid REQUIRED)

add_subdirectory(proto)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(bench)
add_subdirectory(examples)
# add_subdirectory(bench)

# Custom targets to build docker images and run tests
add_custom_target(
GCCReleaseDockerImage
COMMAND sh scripts/build_gcc_release_docker_image.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
GCCReleaseDockerImage
COMMAND sh scripts/build_gcc_release_docker_image.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

add_custom_target(
ClangReleaseDockerImage
COMMAND sh scripts/build_clang_release_docker_image.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
ClangReleaseDockerImage
COMMAND sh scripts/build_clang_release_docker_image.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
57 changes: 29 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ARG BUILD_TYPE=release
RUN apt-get update && \
apt-get -y install \
cmake \
ninja-build \
python3 \
python3-pip \
python3-virtualenv && \
Expand All @@ -33,31 +34,31 @@ RUN conan install . --output-folder=build \
--profile:host=conan/profiles/${BUILD_TYPE}-${COMPILER} \
--build=missing

FROM build-base AS build

# Copy project files after dependencies to maximize caching
COPY . .

# Generate and build the project
RUN cp -f ./build/CMakePresets.json . && \
cmake --preset conan-${BUILD_TYPE} && \
cmake --build ./build -t Main

# Test stage for running tests
FROM build AS test

WORKDIR /workspaces

# Copy binaries directly from the build stage
COPY --from=build /workspaces/build/DBTest build/DBTest
COPY --from=build /workspaces/build/LSMTreeTest build/LSMTreeTest
COPY --from=build /workspaces/build/MemTableTest build/MemTableTest

# Run the database
FROM build AS run

RUN mkdir -p /var/tkvpp
RUN chmod 755 /var/tkvpp

COPY --from=build /workspaces/build/Main /app/tkvpp
ENTRYPOINT [ "/app/tkvpp" ]
# FROM build-base AS build
#
# # Copy project files after dependencies to maximize caching
# COPY . .
#
# # Generate and build the project
# RUN cp -f ./build/CMakePresets.json . && \
# cmake --preset conan-${BUILD_TYPE} && \
# cmake --build ./build -t Main
#
# # Test stage for running tests
# FROM build AS test
#
# WORKDIR /workspaces
#
# # Copy binaries directly from the build stage
# COPY --from=build /workspaces/build/DBTest build/DBTest
# COPY --from=build /workspaces/build/LSMTreeTest build/LSMTreeTest
# COPY --from=build /workspaces/build/MemTableTest build/MemTableTest
#
# # Run the database
# FROM build AS run
#
# RUN mkdir -p /var/tkvpp
# RUN chmod 755 /var/tkvpp
#
# COPY --from=build /workspaces/build/Main /app/tkvpp
# ENTRYPOINT [ "/app/tkvpp" ]
175 changes: 0 additions & 175 deletions assets/database_config_schema.json

This file was deleted.

Loading