Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Remove duplicate environment variable settings in Windows workflow #558

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7d50dd6
Add Redis cache implementation
devin-ai-integration[bot] Nov 22, 2024
225f17e
fix: Add Redis availability check in tests
devin-ai-integration[bot] Nov 22, 2024
d218f4d
fix: Improve Redis cache implementation
devin-ai-integration[bot] Nov 22, 2024
ddafc20
fix: Implement ResetAllDB for LevelDbCache
devin-ai-integration[bot] Nov 22, 2024
6aac455
fix: Move ResetAllDB implementation inside OPENMIND_STORAGE_LEVELDB g…
devin-ai-integration[bot] Nov 22, 2024
277426c
fix: Reorder LevelDbCache implementation to match header declaration
devin-ai-integration[bot] Nov 22, 2024
2ae0c0f
fix: Use explicit CacheBase::path_str_t type in ResetAllDB implementa…
devin-ai-integration[bot] Nov 22, 2024
e24e615
fix: Use fully qualified path_str_t type in ResetAllDB implementation
devin-ai-integration[bot] Nov 22, 2024
1ab81f1
fix: Reorder method implementations to match header declaration order
devin-ai-integration[bot] Nov 22, 2024
8dc800f
fix: Add explicit CacheBase header inclusion in test file
devin-ai-integration[bot] Nov 22, 2024
cc64aed
fix: Use fully qualified CacheBase::path_str_t in ResetAllDB implemen…
devin-ai-integration[bot] Nov 22, 2024
4019c7c
fix: Use fully qualified CacheBase::path_str_t in ResetAllDB declaration
devin-ai-integration[bot] Nov 22, 2024
9cccbbc
fix: Update Redis cache test structure for proper test registration
devin-ai-integration[bot] Nov 22, 2024
12ee664
fix: Update Redis cache test module name for better clarity
devin-ai-integration[bot] Nov 22, 2024
3319ec1
fix: Explicitly add Redis cache test in CMakeLists.txt
devin-ai-integration[bot] Nov 22, 2024
8c928f3
fix: Update Boost test framework linking configuration
devin-ai-integration[bot] Nov 22, 2024
8059c96
ci: Add Redis dependencies and service configuration
devin-ai-integration[bot] Nov 22, 2024
d6f7b53
feat: Add Redis connection retry logic for improved reliability in CI
devin-ai-integration[bot] Nov 22, 2024
511300f
test: Add retry logic to Redis availability check in tests
devin-ai-integration[bot] Nov 22, 2024
4ef569f
fix: Update Redis test CMake configuration for proper Boost Test linking
devin-ai-integration[bot] Nov 22, 2024
44c2e49
ci: Update Windows Redis service configuration for improved reliability
devin-ai-integration[bot] Nov 22, 2024
edc92e3
ci: Update Windows Redis service configuration for improved path hand…
devin-ai-integration[bot] Nov 22, 2024
0f845cd
ci: Switch to Memurai Developer for Windows Redis implementation
devin-ai-integration[bot] Nov 22, 2024
183f425
build: Add Memurai detection in CMake for Windows Redis support
devin-ai-integration[bot] Nov 22, 2024
d072151
feat: Add Memurai port configuration support for Windows
devin-ai-integration[bot] Nov 22, 2024
6a9f2c0
test: Update Redis tests to support Memurai on Windows
devin-ai-integration[bot] Nov 22, 2024
4693447
feat: Improve Redis/Memurai connection handling and error messages
devin-ai-integration[bot] Nov 22, 2024
0e9736d
fix: Make WSAStartup initialization thread-safe on Windows
devin-ai-integration[bot] Nov 22, 2024
735f65b
ci: Enhance Memurai service handling in Windows workflow
devin-ai-integration[bot] Nov 22, 2024
6639de2
test: Add extended timeouts and retry settings for Redis tests
devin-ai-integration[bot] Nov 22, 2024
8583752
test: Improve Redis/Memurai test retry logic with configurable settings
devin-ai-integration[bot] Nov 22, 2024
92b7fed
ci: Improve Memurai service configuration and test retry settings
devin-ai-integration[bot] Nov 22, 2024
2ebf033
ci: Improve Memurai service installation and path handling
devin-ai-integration[bot] Nov 22, 2024
4803e8c
ci: Enhance Memurai service installation with improved error handling
devin-ai-integration[bot] Nov 22, 2024
ea2ef57
ci: Add retry logic for Memurai executable detection
devin-ai-integration[bot] Nov 22, 2024
d1d70b4
ci: Remove duplicate environment variable settings in Windows workflow
devin-ai-integration[bot] Nov 22, 2024
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
161 changes: 161 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: C/C++ CI MSVC

on: [push]

jobs:
build-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Cache Boost dependencies
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/build/CMakeFiles
C:/Boost
${{ github.workspace }}/build/bin/Db*.solutions
key: ${{ runner.os }}-boost-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-boost-

- name: Create Build Dir
run: cmake -E make_directory ${{github.workspace}}/build

- name: Install Redis Dependencies
run: |
vcpkg install hiredis:x64-windows
choco install memurai-developer.install --no-progress --params="'/Port:6379'"

# Refresh environment variables and verify installation paths
$env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
refreshenv

# Wait for Memurai installation to complete and verify executable
$memuraiPath = "C:\Program Files\Memurai\memurai-developer.exe"
$memuraiCli = "C:\Program Files\Memurai\memurai-cli.exe"
$maxAttempts = 5
$attempt = 0
$success = $false

do {
$attempt++
Write-Host "Attempt $attempt of $maxAttempts to locate Memurai executable..."

if (Test-Path $memuraiPath) {
Write-Host "Found Memurai executable at: $memuraiPath"
$success = $true
break
}

Start-Sleep -Seconds 5
$env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
refreshenv
} while ($attempt -lt $maxAttempts)

if (-not $success) {
Write-Error "Failed to locate Memurai executable after $maxAttempts attempts"
Get-ChildItem "C:\Program Files\Memurai\" -Recurse
exit 1
}

Write-Host "Configuring Memurai service..."
if (Get-Service -Name "memurai" -ErrorAction SilentlyContinue) {
Write-Host "Stopping existing Memurai service..."
Stop-Service -Name "memurai" -Force
Start-Sleep -s 5
}

Write-Host "Installing Memurai service..."
Start-Process -FilePath $memuraiPath -ArgumentList "--service-install", "--port", "6379" -Wait -NoNewWindow -PassThru | ForEach-Object {
if ($_.ExitCode -ne 0) {
Write-Error "Failed to install Memurai service (Exit code: $($_.ExitCode))"
exit 1
}
}

Write-Host "Starting Memurai service..."
Start-Service -Name "memurai"
Start-Sleep -s 10

Write-Host "Verifying Memurai service..."
$maxRetries = 10
$retryDelay = 3
$success = $false

for ($i = 1; $i -le $maxRetries; $i++) {
Write-Host "Verification attempt $i of $maxRetries..."
try {
$status = Get-Service -Name "memurai" -ErrorAction Stop
if ($status.Status -eq "Running") {
$ping = & $memuraiCli ping
if ($ping -eq "PONG") {
Write-Host "Memurai service verified and responding!"
$success = $true
break
}
}
} catch {
Write-Warning "Service check failed: $_"
}
Start-Sleep -s $retryDelay
}

if (-not $success) {
Write-Error "Failed to verify Memurai service after $maxRetries attempts"
Get-Service -Name "memurai" | Format-List *
Get-EventLog -LogName Application -Source "Memurai" -Newest 10
exit 1
}

# Set environment variables for tests
echo "OPENMIND_TEST_REDIS_RETRY_COUNT=10" >> $env:GITHUB_ENV
echo "OPENMIND_TEST_REDIS_RETRY_DELAY=3000" >> $env:GITHUB_ENV

if (-not $success) {
Write-Error "Failed to verify Memurai service after $maxRetries attempts"
Get-Service -Name "memurai" | Format-List *
Get-EventLog -LogName Application -Source "Memurai" -Newest 10
exit 1
}

- name: Configure
working-directory: ${{github.workspace}}/build
env:
CC: cl
run: cmake ${{github.workspace}} -DOPENMIND_USE_VCPKG=NO -DOPENMIND_BUILD_SAMPLES=OFF -DOPENMIND_BUILD_TESTS=ON -G "Ninja Multi-Config" -D CMAKE_C_COMPILER="cl.exe" -D CMAKE_CXX_COMPILER="cl.exe" -Dleveldb_TAG:STRING="1.23" -DOPENMIND_MATH_USE_LEVELDB_CACHE=NO -DOPENMIND_STORAGE_LEVELDB=NO -DOPENMIND_STORAGE_REDIS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Install prerequisites
run: cmake --build ${{github.workspace}}/build --target prerequisites --config Release

- name: Reconfigure to detect newly installed prerequisites
working-directory: ${{github.workspace}}/build
run: cmake .

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Build Debug
run: cmake --build ${{github.workspace}}/build --config Debug

- name: Build Release
run: cmake --build ${{github.workspace}}/build --config Release

- name: make check Release
working-directory: ${{github.workspace}}/build
env:
OPENMIND_TEST_REDIS_RETRY_COUNT: 10
OPENMIND_TEST_REDIS_RETRY_DELAY: 3000
run: ctest --timeout 1024 -C Release -j ${{steps.cpu-cores.outputs.count}} -E "ts" --output-on-failure

- name: make check Debug
working-directory: ${{github.workspace}}/build
env:
OPENMIND_TEST_REDIS_RETRY_COUNT: 10
OPENMIND_TEST_REDIS_RETRY_DELAY: 3000
run: ctest --timeout 2048 -C Debug -j ${{steps.cpu-cores.outputs.count}} -E "ts" --output-on-failure

- name: Install
working-directory: ${{github.workspace}}/build
run: cmake --build ${{github.workspace}}/build --target install --config Release
6 changes: 4 additions & 2 deletions .github/workflows/vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build autoconf automake autoconf-archive
sudo apt-get install -y build-essential cmake ninja-build autoconf automake autoconf-archive redis-server
sudo systemctl start redis-server
cmake --version
ninja --version
gcc --version
Expand All @@ -43,7 +44,8 @@ jobs:
run: |
echo "VCPKG_PYTHON3=$VCPKG_PYTHON3" >> $GITHUB_ENV
brew update
brew install cmake ninja autoconf automake autoconf-archive
brew install cmake ninja autoconf automake autoconf-archive redis
brew services start redis
cmake --version
ninja --version
clang --version
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,45 @@ jobs:
- name: Create Build Dir
run: cmake -E make_directory ${{github.workspace}}/build

- name: Install Redis Dependencies
run: |
vcpkg install hiredis:x64-windows
choco install memurai-developer.install --no-progress
$env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine")
$memuraiPath = "C:\Program Files\Memurai\memurai-developer.exe"
Write-Host "Stopping any existing Memurai service..."
& $memuraiPath --service-stop 2>&1 | Out-Null
Write-Host "Installing Memurai service..."
& $memuraiPath --service-install
Write-Host "Starting Memurai service..."
& $memuraiPath --service-start
Write-Host "Waiting for service to be ready..."
Start-Sleep -s 15 # Increased wait time for service startup
$retryCount = 0
do {
try {
$ping = & "C:\Program Files\Memurai\memurai-cli.exe" ping
if ($ping -eq "PONG") {
Write-Host "Memurai service is responding!"
break
}
} catch {
Write-Warning "Ping attempt failed: $_"
}
Start-Sleep -s 3
$retryCount++
Write-Host "Retry attempt $retryCount..."
} while ($retryCount -lt 5)
if ($ping -ne "PONG") {
Write-Error "Memurai server failed to respond after multiple attempts"
exit 1
}

- name: Configure
working-directory: ${{github.workspace}}/build
env:
CC: cl
run: cmake ${{github.workspace}} -DOPENMIND_USE_VCPKG=NO -DOPENMIND_BUILD_SAMPLES=OFF -DOPENMIND_BUILD_TESTS=ON -G "Ninja Multi-Config" -D CMAKE_C_COMPILER="cl.exe" -D CMAKE_CXX_COMPILER="cl.exe" -Dleveldb_TAG:STRING="1.23" -DOPENMIND_MATH_USE_LEVELDB_CACHE=NO -DOPENMIND_STORAGE_LEVELDB=NO
run: cmake ${{github.workspace}} -DOPENMIND_USE_VCPKG=NO -DOPENMIND_BUILD_SAMPLES=OFF -DOPENMIND_BUILD_TESTS=ON -G "Ninja Multi-Config" -D CMAKE_C_COMPILER="cl.exe" -D CMAKE_CXX_COMPILER="cl.exe" -Dleveldb_TAG:STRING="1.23" -DOPENMIND_MATH_USE_LEVELDB_CACHE=NO -DOPENMIND_STORAGE_LEVELDB=NO -DOPENMIND_STORAGE_REDIS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Install prerequisites
run: cmake --build ${{github.workspace}}/build --target prerequisites --config Release
Expand Down
27 changes: 27 additions & 0 deletions omnn/rt/storage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Storage module CMake configuration
set(DEPENDENCIES
rt
)

# Add Redis dependency
if(OPENMIND_STORAGE_REDIS)
find_package(hiredis REQUIRED)
list(APPEND DEPENDENCIES hiredis::hiredis)
add_definitions(-DOPENMIND_STORAGE_REDIS)
if(WIN32)
add_definitions(-DOPENMIND_STORAGE_REDIS_MEMURAI)
endif()
endif()

# Add LevelDB dependency
if(OPENMIND_STORAGE_LEVELDB)
find_package(leveldb REQUIRED)
list(APPEND DEPENDENCIES leveldb)
add_definitions(-DOPENMIND_STORAGE_LEVELDB)
endif()

lib(${DEPENDENCIES})

if(OPENMIND_BUILD_TESTS)
add_subdirectory(tests)
endif()
Loading
Loading