Skip to content

Commit 047a384

Browse files
committed
Refactor and clean up code across multiple files
- Updated `hotSwap` method in `adapter_registry.h` to suppress unused parameter warning. - Removed unnecessary class export specifier from `KnowledgeGraphReasoner`. - Adjusted `GraphIndexManager` to avoid inconsistent DLL import/export bindings. - Deleted unused `toUpper` function in `aql_autocomplete.cpp`. - Renamed `rebuild_state` parameter to `new_rebuild_state` in `markPublished` method of `ArtifactManifest`. - Suppressed unused parameter warning for `config` in `validateModelInitialization`. - Updated tests in `test_llama_cpp_inference_contract_focused.cpp` to use direct object references instead of pointers. - Added error handling for workspace initialization in `LLMWikiPluginImpl`. - Suppressed unused parameter warnings in various test cases and functions. - Improved error handling in `HissReshaper` tests for mismatched grid sizes. - Cleaned up unused variables and improved readability in several test files.
1 parent 0bfc52e commit 047a384

36 files changed

Lines changed: 252 additions & 146 deletions

‎.github/workflows/build-benchmarks.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
fail-fast: false
135135
matrix:
136136
include:
137-
- os: ubuntu-22.04
137+
- os: ubuntu-latest
138138
compiler: gcc-12
139139
cc: gcc-12
140140
cxx: g++-12
@@ -469,7 +469,7 @@ jobs:
469469
# ─────────────────────────────────────────────────────────────────────────
470470
wave-d-observability-gates:
471471
name: Wave D Observability Gates (Trace, Metrics, Exporter Stress)
472-
runs-on: ubuntu-22.04
472+
runs-on: ubuntu-latest
473473
timeout-minutes: 120
474474
needs: [preflight-build-status]
475475
if: >
@@ -585,7 +585,7 @@ jobs:
585585
# ─────────────────────────────────────────────────────────────────────────
586586
sharding-release-gates:
587587
name: Sharding Release-Gate Benchmarks (SRG-01..06)
588-
runs-on: ubuntu-22.04
588+
runs-on: ubuntu-latest
589589
timeout-minutes: 30
590590
needs: [preflight-build-status]
591591
if: >
@@ -702,7 +702,7 @@ jobs:
702702
# ─────────────────────────────────────────────────────────────────────────
703703
wave-d-soak-tests:
704704
name: Wave D Soak Tests (48-hour Endurance)
705-
runs-on: ubuntu-22.04
705+
runs-on: ubuntu-latest
706706
timeout-minutes: 2880 # 48 hours
707707
needs: [preflight-build-status]
708708
if: >

‎.github/workflows/build-content-regression.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ permissions:
4949
# ──────────────────────────────────────────────────────────────────────────────
5050
env:
5151
APT_PACKAGES: >-
52-
build-essential cmake ninja-build pkg-config sccache
52+
build-essential cmake ninja-build pkg-config ccache
5353
librocksdb-dev libgtest-dev libssl-dev zlib1g-dev libzstd-dev
5454
libfmt-dev libspdlog-dev nlohmann-json3-dev libtbb-dev
5555
libyaml-cpp-dev libmimalloc-dev libcurl4-openssl-dev
@@ -66,7 +66,7 @@ jobs:
6666
# ────────────────────────────────────────────────────────────────────────────
6767
content-regression:
6868
name: Content Regression (ctest --label-include "content")
69-
runs-on: ubuntu-22.04
69+
runs-on: ubuntu-latest
7070
timeout-minutes: 60
7171
if: >
7272
github.event_name == 'push' ||
@@ -110,6 +110,8 @@ jobs:
110110
- name: Configure (content tests only)
111111
run: |
112112
export VCPKG_ROOT="${GITHUB_WORKSPACE}/vcpkg"
113+
ccache_path="$(command -v ccache)"
114+
export THEMIS_COMPILER_CACHE_PROGRAM="${ccache_path}"
113115
cmake -S . -B "${{ env.BUILD_DIR }}" -G Ninja \
114116
-DCMAKE_BUILD_TYPE=Debug \
115117
-DTHEMIS_BUILD_TESTS=ON \
@@ -152,7 +154,7 @@ jobs:
152154
# ────────────────────────────────────────────────────────────────────────────
153155
wave-d-soak:
154156
name: Wave-D Soak (ctest --label-include "soak" --timeout 600)
155-
runs-on: ubuntu-22.04
157+
runs-on: ubuntu-latest
156158
timeout-minutes: 90
157159
if: >
158160
(github.event_name == 'schedule' && github.event.schedule == '30 5 * * 0') ||
@@ -199,6 +201,8 @@ jobs:
199201
- name: Configure (soak tests — Release for endurance realism)
200202
run: |
201203
export VCPKG_ROOT="${GITHUB_WORKSPACE}/vcpkg"
204+
ccache_path="$(command -v ccache)"
205+
export THEMIS_COMPILER_CACHE_PROGRAM="${ccache_path}"
202206
cmake -S . -B "${{ env.BUILD_DIR_SOAK }}" -G Ninja \
203207
-DCMAKE_BUILD_TYPE=Release \
204208
-DTHEMIS_BUILD_TESTS=ON \

‎.github/workflows/build-llm-inference.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
set -euo pipefail
147147
sudo apt-get update -qq
148148
sudo apt-get install -y --no-install-recommends \
149-
build-essential cmake ninja-build pkg-config \
149+
build-essential cmake ninja-build pkg-config ccache \
150150
librocksdb-dev libgtest-dev libssl-dev zlib1g-dev libzstd-dev \
151151
libfmt-dev libspdlog-dev nlohmann-json3-dev libtbb-dev \
152152
libyaml-cpp-dev libcurl4-openssl-dev libboost-system-dev \
@@ -159,6 +159,8 @@ jobs:
159159
- name: Configure CMake (inference tests enabled)
160160
run: |
161161
set -euo pipefail
162+
ccache_path="$(command -v ccache)"
163+
export THEMIS_COMPILER_CACHE_PROGRAM="${ccache_path}"
162164
cmake -S . -B "${{ env.CMAKE_BUILD_DIR }}" \
163165
-DTHEMIS_BUILD_TESTS=ON \
164166
-DTHEMIS_BUILD_BENCHMARKS=OFF \

‎.github/workflows/compliance-supply-chain.yml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ permissions:
7676
jobs:
7777
license-gate:
7878
name: License Policy Gate
79-
runs-on: ubuntu-22.04
79+
runs-on: ubuntu-latest
8080
timeout-minutes: 15
8181
permissions:
8282
contents: read
@@ -136,7 +136,7 @@ jobs:
136136
name: Publish License Release Assets
137137
if: github.event_name == 'release'
138138
needs: license-gate
139-
runs-on: ubuntu-22.04
139+
runs-on: ubuntu-latest
140140
permissions:
141141
contents: write
142142
steps:
@@ -159,7 +159,7 @@ jobs:
159159
# ──────────────────────────────────────────────────────────────────────────
160160
sbom:
161161
name: SBOM Generation & Verification
162-
runs-on: ubuntu-22.04
162+
runs-on: ubuntu-latest
163163
timeout-minutes: 20
164164
permissions:
165165
contents: write
@@ -275,7 +275,7 @@ jobs:
275275
# ──────────────────────────────────────────────────────────────────────────
276276
dependency-freshness:
277277
name: Dependency Freshness Gate
278-
runs-on: ubuntu-22.04
278+
runs-on: ubuntu-latest
279279
timeout-minutes: 20
280280
# Run on monthly schedule (cron '0 4 1 * *'), workflow_dispatch, or release
281281
if: >
@@ -426,7 +426,7 @@ jobs:
426426
# ──────────────────────────────────────────────────────────────────────────
427427
soc2-evidence:
428428
name: SOC 2 Evidence Export
429-
runs-on: ubuntu-22.04
429+
runs-on: ubuntu-latest
430430
timeout-minutes: 30
431431
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
432432
permissions:
@@ -440,8 +440,14 @@ jobs:
440440
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
441441

442442
- name: Start ThemisDB container
443+
env:
444+
DOCKER_BUILDKIT: '0'
445+
COMPOSE_DOCKER_CLI_BUILD: '0'
443446
run: |
444-
docker compose -f docker-compose.yml up -d themis
447+
test -f "${GITHUB_WORKSPACE}/LICENSE" || { echo "::error::Missing ${GITHUB_WORKSPACE}/LICENSE"; exit 1; }
448+
test -d "${GITHUB_WORKSPACE}/internal" || { echo "::error::Missing ${GITHUB_WORKSPACE}/internal"; exit 1; }
449+
docker compose --project-directory "${GITHUB_WORKSPACE}" -f "${GITHUB_WORKSPACE}/docker-compose.yml" build themis
450+
docker compose --project-directory "${GITHUB_WORKSPACE}" -f "${GITHUB_WORKSPACE}/docker-compose.yml" up -d --no-build themis
445451
for _ in $(seq 1 30); do
446452
if curl -sk "${THEMIS_ADMIN_ENDPOINT}/v1/health" | grep -q "ok"; then
447453
echo "ThemisDB ready"; break
@@ -476,4 +482,4 @@ jobs:
476482

477483
- name: Stop ThemisDB container
478484
if: always()
479-
run: docker compose -f docker-compose.yml down --volumes
485+
run: docker compose --project-directory "${GITHUB_WORKSPACE}" -f "${GITHUB_WORKSPACE}/docker-compose.yml" down --volumes

‎.github/workflows/security-consolidated.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
# ────────────────────────────────────────────────────────────────────────────
208208
dast-scan:
209209
name: OWASP ZAP Baseline DAST
210-
runs-on: ubuntu-22.04
210+
runs-on: ubuntu-latest
211211
timeout-minutes: 45
212212
continue-on-error: true
213213
if: >

‎CMakePresets.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@
602602
{
603603
"name": "windows-debug",
604604
"configurePreset": "windows-debug",
605-
"jobs": 4
605+
"jobs": 20
606606
},
607607
{
608608
"name": "hyperscaler-debug-windows",

‎cmake/CompilerOptions.cmake‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ if(MSVC)
226226
/W4 # Warning level 4
227227
/fp:precise # Precise floating point
228228
/Gy # Enable function-level linking
229+
/Zm200 # Increase compiler heap for large Windows translation units
229230
/permissive- # Conformance mode
230231
/EHsc # Exception handling (C++ only, not SEH)
231232
/w14018 # Enable C4018: signed/unsigned mismatch warning

‎docker/Dockerfile.unified‎

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2727
--mount=type=cache,target=/var/lib/apt,sharing=locked \
2828
apt-get update && apt-get install -y --no-install-recommends \
2929
build-essential cmake ninja-build git curl ca-certificates pkg-config \
30-
zip unzip tar wget flex bison aria2 python3 perl nasm autoconf \
30+
zip unzip tar wget flex bison aria2 ccache python3 perl nasm autoconf \
3131
automake libtool && \
3232
if [ -n "${EXTRA_CA_CERT_B64}" ]; then \
3333
echo "${EXTRA_CA_CERT_B64}" | base64 -d > /usr/local/share/ca-certificates/themis-extra-ca.crt && \
@@ -47,7 +47,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
4747
FROM base AS deps
4848

4949
ARG THEMIS_EDITION=COMMUNITY
50-
ARG TARGETARCH=amd64
50+
ARG TARGETARCH
5151
ARG VCPKG_MANIFEST_HASH=""
5252

5353
WORKDIR /build
@@ -65,14 +65,17 @@ RUN set -eux; \
6565
else \
6666
echo "ERROR: vcpkg-${EDITION}.json not found!"; exit 1; \
6767
fi && \
68+
ARCH="${TARGETARCH:-}"; \
69+
if [ -z "${ARCH}" ]; then ARCH="$(uname -m)"; fi; \
6870
TRIPLET="x64-linux"; \
69-
case "${TARGETARCH}" in \
70-
amd64) TRIPLET="x64-linux" ;; \
71-
arm64) TRIPLET="arm64-linux" ;; \
72-
arm) TRIPLET="arm-linux" ;; \
71+
case "${ARCH}" in \
72+
amd64|x86_64) TRIPLET="x64-linux" ;; \
73+
arm64|aarch64) TRIPLET="arm64-linux" ;; \
74+
arm|armv7l) TRIPLET="arm-linux" ;; \
75+
*) echo "WARN: Unknown TARGETARCH='${ARCH}', fallback to x64-linux" ;; \
7376
esac && \
7477
echo "${TRIPLET}" > /tmp/triplet.txt && \
75-
echo "Architecture: ${TRIPLET}"
78+
echo "Architecture: ${ARCH} -> ${TRIPLET}"
7679

7780
# Copy vcpkg configuration and overlay ports
7881
COPY vcpkg-configuration.json ./
@@ -152,7 +155,7 @@ FROM deps AS build
152155

153156
ARG THEMIS_EDITION=COMMUNITY
154157
ARG ENABLE_LLM=ON
155-
ARG TARGETARCH=amd64
158+
ARG TARGETARCH
156159

157160
WORKDIR /src
158161

@@ -163,13 +166,14 @@ COPY include ./include
163166
COPY src ./src
164167
COPY proto ./proto
165168
COPY internal ./internal
169+
COPY ports ./ports
166170

167171
# Copy vcpkg config from deps stage (not from host!)
168172
COPY --from=deps /build/vcpkg.json ./vcpkg.json
169173
COPY --from=deps /build/vcpkg-configuration.json ./vcpkg-configuration.json
170174

171-
# Copy vcpkg installed packages
172-
COPY --from=deps /build/vcpkg_installed /build/vcpkg_installed
175+
# Copy vcpkg installed packages where Dependencies.cmake expects them
176+
COPY --from=deps /build/vcpkg_installed /src/vcpkg_installed
173177

174178
# Copy llama.cpp
175179
COPY --from=llama /opt/llama.cpp /opt/llama.cpp
@@ -188,9 +192,17 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
188192
ARG FORCE_CPU_ONLY=OFF
189193

190194
RUN set -eux; \
191-
TRIPLET=$(cat /tmp/triplet.txt); \
195+
ARCH="${TARGETARCH:-}"; \
196+
if [ -z "${ARCH}" ]; then ARCH="$(uname -m)"; fi; \
197+
TRIPLET="x64-linux"; \
198+
case "${ARCH}" in \
199+
amd64|x86_64) TRIPLET="x64-linux" ;; \
200+
arm64|aarch64) TRIPLET="arm64-linux" ;; \
201+
arm|armv7l) TRIPLET="arm-linux" ;; \
202+
*) echo "WARN: Unknown TARGETARCH='${ARCH}', fallback to x64-linux" ;; \
203+
esac; \
192204
echo "Building ThemisDB ${THEMIS_EDITION} (LLM=${ENABLE_LLM}, FORCE_CPU_ONLY=${FORCE_CPU_ONLY})..."; \
193-
echo "TRIPLET=${TRIPLET}"; \
205+
echo "TARGETARCH=${ARCH} TRIPLET=${TRIPLET}"; \
194206
ls -la /build/vcpkg_installed/${TRIPLET} 2>/dev/null | head -20 || echo "No vcpkg_installed"; \
195207
\
196208
EXTRA_ARGS=""; \
@@ -206,10 +218,12 @@ RUN set -eux; \
206218
cmake --preset linux-release \
207219
-DTHEMIS_EDITION="${THEMIS_EDITION}" \
208220
-DTHEMIS_ENABLE_LLM="${ENABLE_LLM}" \
221+
-DTHEMIS_AUTO_BOOTSTRAP_DEPS=OFF \
209222
-DVCPKG_TARGET_TRIPLET="${TRIPLET}" \
210-
-DCMAKE_PREFIX_PATH="/build/vcpkg_installed/${TRIPLET};/build/vcpkg_installed/${TRIPLET}/share;/build/vcpkg_installed/${TRIPLET}/lib/cmake" \
211-
-DOPENSSL_ROOT_DIR="/build/vcpkg_installed/${TRIPLET}" \
212-
-DOpenSSL_DIR="/build/vcpkg_installed/${TRIPLET}/share/openssl" \
223+
-DVCPKG_INSTALLED_DIR="/src/vcpkg_installed" \
224+
-DCMAKE_PREFIX_PATH="/src/vcpkg_installed/${TRIPLET};/src/vcpkg_installed/${TRIPLET}/share;/src/vcpkg_installed/${TRIPLET}/lib/cmake" \
225+
-DOPENSSL_ROOT_DIR="/src/vcpkg_installed/${TRIPLET}" \
226+
-DOpenSSL_DIR="/src/vcpkg_installed/${TRIPLET}/share/openssl" \
213227
${EXTRA_ARGS} && \
214228
ninja -C build -j$(nproc)
215229

‎include/core/concerns/adapter_registry.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class AdapterRegistry {
220220
* @throws std::invalid_argument if @p new_adapter is nullptr.
221221
*/
222222
template<typename T>
223-
bool hotSwap(std::shared_ptr<T> new_adapter, AdapterMetadata meta = {}) {
223+
bool hotSwap(std::shared_ptr<T> new_adapter, [[maybe_unused]] AdapterMetadata meta = {}) {
224224
if (!new_adapter) {
225225
throw std::invalid_argument(
226226
"[AdapterRegistry] hotSwap: new_adapter must not be nullptr");

‎include/graph/knowledge_graph_reasoner.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class InferenceStore {
266266
* // {"bob","reports_to","carol"} ]
267267
* @endcode
268268
*/
269-
class THEMIS_GRAPH_API KnowledgeGraphReasoner {
269+
class KnowledgeGraphReasoner {
270270
public:
271271
/// Default maximum inference hops per `infer()` call.
272272
static constexpr int kDefaultMaxHops = 5;

0 commit comments

Comments
 (0)