-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
7,237 additions
and
1,886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = [ | ||
"-C", "target-feature=-crt-static", | ||
"-C", "link-args=/NODEFAULTLIB:libcmt.lib" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# Check if the CN_API_KEY is set or throw an error | ||
if [ -z "$CN_API_KEY" ]; then | ||
echo "Error: CN_API_KEY is not set" | ||
exit 1 | ||
fi | ||
|
||
# Extract the current version from Cargo.toml | ||
current_version=$(sed -n 's/^version = "\(.*\)"/\1/p' examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml | head -n 1) | ||
|
||
# Get the version to purge up to from the first argument | ||
purge_up_to=${1:-$current_version} | ||
|
||
echo "Current version: $current_version" | ||
echo "Purging versions up to: $purge_up_to" | ||
|
||
# Check if current_version is empty | ||
if [ -z "$current_version" ]; then | ||
echo "Error: Could not extract version from Cargo.toml" | ||
exit 1 | ||
fi | ||
|
||
# Generate versions dynamically | ||
major=$(echo $current_version | cut -d. -f1) | ||
minor=$(echo $current_version | cut -d. -f2) | ||
patch=$(echo $current_version | cut -d. -f3) | ||
|
||
# Check if we got valid numbers | ||
if ! [[ "$major" =~ ^[0-9]+$ ]] || ! [[ "$minor" =~ ^[0-9]+$ ]] || ! [[ "$patch" =~ ^[0-9]+$ ]]; then | ||
echo "Error: Invalid version format in Cargo.toml" | ||
exit 1 | ||
fi | ||
|
||
for ((m=0; m<=$minor; m++)); do | ||
for ((p=0; p<=70; p++)); do | ||
version="$major.$m.$p" | ||
if [[ "$(echo -e "$version\n$purge_up_to" | sort -V | head -n1)" == "$version" && "$version" != "$purge_up_to" ]]; then | ||
echo "Purging version $version" | ||
cn release purge screenpipe "$version" | ||
else | ||
echo "Skipping version $version" | ||
fi | ||
done | ||
done | ||
|
||
echo "Purge complete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Linux Memory Test | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-ubuntu: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y tesseract-ocr libtesseract-dev libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev xvfb pulseaudio gnuplot | ||
- name: Set up virtual display | ||
run: | | ||
Xvfb :99 -ac & | ||
echo "DISPLAY=:99" >> $GITHUB_ENV | ||
- name: Set up virtual audio | ||
run: | | ||
pulseaudio --start | ||
pacmd load-module module-null-sink sink_name=virtual_speaker | ||
pacmd load-module module-virtual-source source_name=virtual_mic | ||
pacmd set-default-sink virtual_speaker | ||
pacmd set-default-source virtual_mic | ||
- name: Build screenpipe | ||
run: cargo build --release | ||
|
||
- name: Run screenpipe and monitor memory | ||
run: | | ||
export DISPLAY=:99 | ||
export PULSE_SERVER=unix:/tmp/pulse-socket | ||
./target/release/screenpipe --debug & | ||
SCREENPIPE_PID=$! | ||
echo "Timestamp,RSS (KB),VSZ (KB)" > memory_usage.csv | ||
for i in {1..90}; do | ||
RSS=$(ps -o rss= -p $SCREENPIPE_PID) | ||
VSZ=$(ps -o vsz= -p $SCREENPIPE_PID) | ||
echo "$(date +%s),$RSS,$VSZ" >> memory_usage.csv | ||
sleep 10 | ||
done | ||
kill $SCREENPIPE_PID | ||
- name: Generate memory usage graph | ||
run: | | ||
gnuplot <<EOF | ||
set terminal png size 800,600 | ||
set output 'memory_usage_graph.png' | ||
set title 'Screenpipe Memory Usage Over Time' | ||
set xlabel 'Time (seconds)' | ||
set ylabel 'Memory Usage (KB)' | ||
set key outside | ||
plot 'memory_usage.csv' using 1:2 with lines title 'RSS', \ | ||
'' using 1:3 with lines title 'VSZ' | ||
EOF | ||
- name: Upload memory usage data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: memory-usage-data | ||
path: memory_usage.csv | ||
|
||
- name: Upload memory usage graph | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: memory-usage-graph | ||
path: memory_usage_graph.png | ||
|
||
- name: Check logs and data | ||
run: | | ||
echo "Checking logs..." | ||
tail -n 100 ~/.screenpipe/logs/screenpipe.log | ||
echo "Checking database..." | ||
sqlite3 ~/.screenpipe/db.sqlite ".tables" | ||
sqlite3 ~/.screenpipe/db.sqlite "SELECT COUNT(*) FROM ocr_text;" | ||
sqlite3 ~/.screenpipe/db.sqlite "SELECT COUNT(*) FROM audio_transcriptions;" | ||
- name: Upload screenpipe data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: screenpipe-data | ||
path: | | ||
~/.screenpipe/logs | ||
~/.screenpipe/db.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.