Skip to content

Commit

Permalink
Merge branch 'mediar-ai:main' into test-cli-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
onyedikachi-david committed Sep 17, 2024
2 parents 5528f60 + 248f714 commit f2e1df3
Show file tree
Hide file tree
Showing 250 changed files with 8,539 additions and 2,792 deletions.
17 changes: 17 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[target.x86_64-pc-windows-msvc]
rustflags = [
"-C",
"target-feature=+crt-static",
"-C",
"link-args=/DEFAULTLIB:ucrt.lib /DEFAULTLIB:libvcruntime.lib libcmt.lib",
"-C",
"link-args=/NODEFAULTLIB:libvcruntimed.lib /NODEFAULTLIB:vcruntime.lib /NODEFAULTLIB:vcruntimed.lib",
"-C",
"link-args=/NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib",
"-C",
"link-args=/NODEFAULTLIB:libucrt.lib /NODEFAULTLIB:libucrtd.lib /NODEFAULTLIB:ucrtd.lib",

]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-Wl,--allow-multiple-definition"]
2 changes: 1 addition & 1 deletion .github/scripts/purge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ -z "$CN_API_KEY" ]; then
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)
current_version=$(sed -n 's/^version = "\(.*\)"/\1/p' 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}
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ jobs:
fail-on-alert: true
alert-comment-cc-users: "@louis030195"

- name: Analyze STT benchmarks
uses: benchmark-action/github-action-benchmark@v1
with:
name: STT Benchmarks
tool: "cargo"
output-file-path: ./cache/stt/stt_output.txt
github-token: ${{ secrets.GH_PAGES_TOKEN }}
auto-push: true
alert-threshold: "200%"
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: "@louis030195"
# todo broken
# - name: Analyze STT benchmarks
# uses: benchmark-action/github-action-benchmark@v1
# with:
# name: STT Benchmarks
# tool: "cargo"
# output-file-path: ./cache/stt/stt_output.txt
# github-token: ${{ secrets.GH_PAGES_TOKEN }}
# auto-push: true
# alert-threshold: "200%"
# comment-on-alert: true
# fail-on-alert: true
# alert-comment-cc-users: "@louis030195"
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
jobs:
test-ubuntu:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C link-arg=-Wl,--allow-multiple-definition"
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
Expand All @@ -27,6 +29,7 @@ jobs:
with:
profile: minimal
toolchain: stable
override: true

- name: Install dependencies
run: |
Expand Down Expand Up @@ -64,10 +67,7 @@ jobs:
- name: Run pre_build.js on
shell: bash
run: bun ./scripts/pre_build.js
working-directory: ./examples/apps/screenpipe-app-tauri

# - name: Run tests
# run: cargo test
working-directory: ./screenpipe-app-tauri

- name: Copy test image
shell: bash
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
env:
SKIP_SCREENPIPE_SETUP: true # avoid trying to copy screenpipe binaries, not yet built (next step)
run: bun ./scripts/pre_build.js
working-directory: ./examples/apps/screenpipe-app-tauri
working-directory: ./screenpipe-app-tauri

- name: Copy test image
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/perf-long-running-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ jobs:
EOF
- name: Upload memory usage data
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: memory-usage-data
path: memory_usage.csv

- name: Upload memory usage graph
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: memory-usage-graph
path: memory_usage_graph.png
Expand All @@ -101,7 +101,7 @@ jobs:
sqlite3 ~/.screenpipe/db.sqlite "SELECT COUNT(*) FROM audio_transcriptions;"
- name: Upload screenpipe data
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: screenpipe-data
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
with:
command: release publish ${{ secrets.CN_APP_SLUG }} --framework tauri
api-key: ${{ secrets.CN_API_KEY }}
path: ./examples/apps/screenpipe-app-tauri/src-tauri
path: ./screenpipe-app-tauri/src-tauri
58 changes: 43 additions & 15 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
name: Release App

on:
# push:
# tags:
# - "v*"
push:
tags:
- "v*"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -40,9 +40,9 @@ jobs:
args: "--target x86_64-apple-darwin --features metal"
target: x86_64-apple-darwin
- platform: "ubuntu-22.04" # Ubuntu x86_64
args: "" # TODO CUDA
args: "" # TODO CUDA, mkl
- platform: "windows-latest" # Windows x86_64
args: "--target x86_64-pc-windows-msvc" # TODO CUDA? --features "openblas"
args: "--target x86_64-pc-windows-msvc" # TODO CUDA, mkl? --features "openblas"
pre-build-args: "" # --openblas
# windows arm: https://github.com/ahqsoftwares/tauri-ahq-store/blob/2fbc2103c222662b3c6ee0cd71fcde664824f0ef/.github/workflows/publish.yml#L136

Expand Down Expand Up @@ -86,10 +86,10 @@ jobs:
uses: actions/cache@v4
with:
path: |
examples/apps/screenpipe-app-tauri/src-tauri/openblas
examples/apps/screenpipe-app-tauri/src-tauri/clblast
examples/apps/screenpipe-app-tauri/src-tauri/ffmpeg
examples/apps/screenpipe-app-tauri/src-tauri/tesseract-*
screenpipe-app-tauri/src-tauri/openblas
screenpipe-app-tauri/src-tauri/clblast
screenpipe-app-tauri/src-tauri/ffmpeg
screenpipe-app-tauri/src-tauri/tesseract-*
key: ${{ matrix.platform }}-${{ matrix.args }}-pre-build

- uses: actions/cache@v3
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Install frontend dependencies
shell: bash
working-directory: ./examples/apps/screenpipe-app-tauri
working-directory: ./screenpipe-app-tauri
run: |
ls .
bun install
Expand All @@ -130,13 +130,13 @@ jobs:
run: |
bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
ls -R .
working-directory: ./examples/apps/screenpipe-app-tauri
working-directory: ./screenpipe-app-tauri

- name: Verify Tesseract Installation
if: matrix.platform == 'windows-latest'
shell: pwsh
run: |
$env:PATH += ";${{ github.workspace }}\examples\apps\screenpipe-app-tauri\src-tauri\tesseract"
$env:PATH += ";${{ github.workspace }}\screenpipe-app-tauri\src-tauri\tesseract"
tesseract --version
if ($LASTEXITCODE -ne 0) {
Write-Error "Tesseract is not properly installed or not in PATH"
Expand All @@ -161,7 +161,34 @@ jobs:
- name: Run pre_build.js on ${{ matrix.platform }}
shell: bash
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ./examples/apps/screenpipe-app-tauri
working-directory: ./screenpipe-app-tauri

- name: Identify esaxx usage (Windows)
if: matrix.platform == 'windows-latest'
run: |
cargo tree > cargo_tree_output.txt
findstr /i "esaxx" cargo_tree_output.txt
continue-on-error: true

- name: Install vcpkg
if: matrix.platform == 'windows-latest'
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "5b1214315250939257ef5d62ecdcbca18cf4fb1c"

# - name: Install ONNX Runtime
# if: matrix.platform == 'windows-latest'
# run: vcpkg install onnxruntime:x64-windows

- name: Set up MSVC
if: matrix.platform == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1

- name: Install LLVM and Clang
if: matrix.platform == 'windows-latest'
uses: KyleMayes/install-llvm-action@v2
with:
version: "10.0"

- name: Build
uses: tauri-apps/tauri-action@v0
Expand All @@ -180,22 +207,23 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# https://tauri.app/v1/guides/distribution/sign-macos
CI: true
# RUSTFLAGS: "-C link-arg=-Wl,--allow-multiple-definition"
with:
tagName: app-v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
releaseName: "App v__VERSION__"
releaseBody: "What's new? 🎉📣"
releaseDraft: true
prerelease: true
args: ${{ matrix.args }}
projectPath: "./examples/apps/screenpipe-app-tauri"
projectPath: "./screenpipe-app-tauri"
tauriScript: bunx tauri -v

- name: Upload Assets to CrabNebula Cloud
uses: crabnebula-dev/cloud-release@v0
with:
command: release upload ${{ secrets.CN_APP_SLUG }} --framework tauri
api-key: ${{ secrets.CN_API_KEY }}
path: ./examples/apps/screenpipe-app-tauri/src-tauri
path: ./screenpipe-app-tauri/src-tauri

# basically wait for macos manual add sset
#publish:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
gh pr create --base main --head update-formula-${{ matrix.target }}-${{ github.sha }} --title "Update Homebrew formula for ${{ matrix.target }}" --body "Automated PR to update Homebrew formula for ${{ matrix.target }}"
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: screenpipe-macos-${{ matrix.target }}
path: screenpipe-*.tar.gz
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
# tar -czvf screenpipe-linux.tar.gz screenpipe-linux

# - name: Upload Artifact
# uses: actions/upload-artifact@v2
# uses: actions/upload-artifact@v3
# with:
# name: screenpipe-linux
# path: screenpipe-linux.tar.gz
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
echo "Set version to: $VERSION"
- name: Download macOS Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: artifacts

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ examples/typescript/vercel-ai-chatbot/package-lock.json
tauri_key_louis.key
pnpm-lock.yaml

.DS_Store
.DS_Store

# Ignore onnxruntime-win-x64-gpu libraries
onnxruntime-win-x64-gpu*/
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ We follow [this](https://doc.rust-lang.org/cargo/guide/project-layout.html) fold

## Additional Notes

### AI system prompt

i use cursor with this prompt to help me with the code:

```
Rules:
- Coding: always use lower case for logging stuff or UI
- Coding: Rust: always use anyhow error, tokio instead of std stuff, avoid mutex if you can, prefer channels, write code easy to read for humans, fast for machines
- Coding: when i ask to give me the full code it means FULL, no fucking // rest of the code comments GIVE ME THE FULL CODE
- Coding: if it seems like you lack some context about a niche lib just ask me to provide the source code and i will (instead of providing a bad answer)
- Coding: NextJS: make sure to use tailwind, typescript, shadcn, lucide, magicui, and framer-motion to make UIs amazing
- Coding: Make sure to escape html thing like quotes etc properly. Only when necessary
- Coding: When writing react or html code make sure to use thing like ' instead of ". Only when necessary (e.g inside quote themselves)
```


### Principles

- **User fanatic: focus on building what people want and making users happy.**
Expand Down Expand Up @@ -97,6 +113,43 @@ You can add env var to `.vscode/settings.json`:
}
```

This is @louis030195 whole `.vscode/settings.json` file:

```json
{
"rust-analyzer.server.extraEnv": {
"PKG_CONFIG_ALLOW_SYSTEM_LIBS": "1",
"PKG_CONFIG_ALLOW_SYSTEM_CFLAGS": "1",
"PKG_CONFIG_PATH": "/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig",
"PATH": "/usr/bin:/opt/homebrew/bin:${env:PATH}",
"DYLD_LIBRARY_PATH": "${workspaceFolder}/screenpipe-vision/lib:${env:DYLD_LIBRARY_PATH}"
},
"rust-analyzer.cargo.extraEnv": {
"PKG_CONFIG_ALLOW_SYSTEM_LIBS": "1",
"PKG_CONFIG_ALLOW_SYSTEM_CFLAGS": "1",
"PKG_CONFIG_PATH": "/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig",
"PATH": "/usr/bin:/opt/homebrew/bin:${env:PATH}",
"DYLD_LIBRARY_PATH": "${workspaceFolder}/screenpipe-vision/lib:${env:DYLD_LIBRARY_PATH}"
},
// add env to integrated terminal
"terminal.integrated.env.osx": {
"DYLD_LIBRARY_PATH": "${workspaceFolder}/screenpipe-vision/lib:${env:DYLD_LIBRARY_PATH}",
"SCREENPIPE_APP_DEV": "true",
},
"rust-analyzer.cargo.features": [
"pipes"
],
"rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.checkOnSave.extraArgs": [
"--features",
"pipes"
],
"rust-analyzer.cargo.allFeatures": false,
"rust-analyzer.cargo.noDefaultFeatures": false
}
```


## Other hacks

Expand Down
11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ members = [
"screenpipe-integrations",
]
exclude = [
"examples/apps/screenpipe-app-tauri/src-tauri",
"screenpipe-app-tauri/src-tauri",
]
resolver = "2"


[workspace.package]
version = "0.1.78"
version = "0.1.84"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/mediar-ai/screenpipe"
Expand All @@ -33,10 +33,13 @@ hf-hub = "0.3.0"
crossbeam = "0.8.4"
image = "0.25"
reqwest = { version = "0.11", features = ["blocking", "multipart", "json"] }

# dev
criterion = { version = "0.5.1", features = ["async_tokio"] }
vcpkg = "0.2"

[workspace.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
rev = "2023.04.15"
dynamic = true



Loading

0 comments on commit f2e1df3

Please sign in to comment.