Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 100
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.git
**/node_modules
**/.next
**/build
**/.venv
**/__pycache__
**/dist
**/coverage
**/.test-data
.runtime
.cache
.tools
**/.env*
**/*.db*
**/*.log
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and verify
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
native-and-app:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
OPENBLAS_NUM_THREADS: '2'
OMP_NUM_THREADS: '2'
NEXT_TELEMETRY_DISABLED: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: npm run setup
- run: npm run build
- run: npm test
- run: npm run test:ui
- run: npm audit --prefix api --omit=dev --audit-level=high
- run: npm audit --prefix frontend --omit=dev --audit-level=high
docker:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
COMPOSE_PARALLEL_LIMIT: '1'
steps:
- uses: actions/checkout@v4
- run: docker compose -p verify -f docker/docker-compose.yml build
- run: docker compose -p verify -f docker/docker-compose.yml up -d --wait --wait-timeout 120
- run: node scripts/docker-smoke.mjs
- if: always()
run: docker compose -p verify -f docker/docker-compose.yml logs --tail 50
- if: always()
run: docker compose -p verify -f docker/docker-compose.yml down --volumes
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ AGENTS.md

start-local.bat
stop-local.bat
scripts/

# Runtime data and local verification artifacts
.runtime/
.tools/
*.db-wal
*.db-shm
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "singleQuote": true, "trailingComma": "all", "printWidth": 100 }
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.18)
project(log_pipeline VERSION 2.0 LANGUAGES C CXX)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif()
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
foreach(config DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${config} ${CMAKE_BINARY_DIR}/bin)
endforeach()
include(FetchContent)
find_package(Threads REQUIRED)
FetchContent_Declare(json URL https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz)
FetchContent_Declare(httplib URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.18.7.tar.gz SOURCE_SUBDIR unused)
FetchContent_Declare(sha2 URL https://github.com/okdshin/PicoSHA2/archive/161cb3fc4170fa7a3eca9e582cebd27cc4d1fe29.tar.gz SOURCE_SUBDIR unused)
FetchContent_MakeAvailable(json httplib sha2)
if(NOT LOG_SQLITE_DIR)
FetchContent_Declare(sqlite_source URL https://github.com/SRombauts/SQLiteCpp/archive/refs/tags/3.3.3.tar.gz SOURCE_SUBDIR unused)
FetchContent_MakeAvailable(sqlite_source)
set(LOG_SQLITE_DIR ${sqlite_source_SOURCE_DIR}/sqlite3)
endif()
add_library(log_sqlite STATIC ${LOG_SQLITE_DIR}/sqlite3.c)
target_include_directories(log_sqlite PUBLIC ${LOG_SQLITE_DIR})
target_compile_definitions(log_sqlite PRIVATE SQLITE_THREADSAFE=1 SQLITE_DEFAULT_WAL_SYNCHRONOUS=2)
target_link_libraries(log_sqlite PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
add_executable(log_queue queue/src/main.cpp queue/src/sqlite_queue.cpp)
add_executable(log_agent agent/src/main.cpp agent/src/log_parser.cpp)
target_include_directories(log_agent PRIVATE agent/include)
foreach(target log_queue log_agent)
target_include_directories(${target} PRIVATE native/include ${httplib_SOURCE_DIR} ${sha2_SOURCE_DIR})
target_link_libraries(${target} PRIVATE nlohmann_json::nlohmann_json Threads::Threads)
if(WIN32)
target_link_libraries(${target} PRIVATE ws2_32)
target_compile_definitions(${target} PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
endif()
if(MSVC)
target_compile_options(${target} PRIVATE /W4 /EHsc /utf-8)
else()
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
endif()
endforeach()
target_link_libraries(log_queue PRIVATE log_sqlite)
Loading
Loading