Skip to content
Open
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
91 changes: 91 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Integration Tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
node-version:
description: 'Node.js version'
required: true
type: choice
default: 'all'
options:
- 'all'
- '22'
- '24'
- '26'

jobs:
generate-node-version-matrix:
name: Generate Node Version Matrix
runs-on: ubuntu-latest
outputs:
node-versions: ${{ steps.set-node-versions.outputs.node-versions }}

steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Set Node versions
id: set-node-versions
env:
NODE_VER: ${{ github.event.inputs.node-version }}
run: |
# `push` and `pull_request` events carry no workflow input, so NODE_VER
# is empty on every PR run. That empty case MUST expand to the full
# matrix, exactly like an explicit "all" — if it ever fell through to
# the else branch it would emit `[]`, fromJSON() would yield an empty
# matrix, and CI would report green having run zero tests. The guard
# below makes that failure loud instead of silent.
if [ "$NODE_VER" == "all" ] || [ -z "$NODE_VER" ]; then
NODE_VERSIONS="[22, 24, 26]"
else
NODE_VERSIONS="[$NODE_VER]"
fi
if [ "$NODE_VERSIONS" == "[]" ]; then
echo "::error::Refusing to run with an empty Node version matrix (NODE_VER='$NODE_VER')"
exit 1
fi
echo "node-versions=$NODE_VERSIONS" >> $GITHUB_OUTPUT

integration-tests:
name: Integration Tests (Node ${{ matrix.node-version }})
needs: [generate-node-version-matrix]
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.generate-node-version-matrix.outputs.node-versions) }}

steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Run integration tests
run: npm run test:integration
env:
HARPER_INTEGRATION_TEST_LOG_DIR: /tmp/harper-test-logs
FORCE_COLOR: '1'
# AI inference backends (TensorFlow.js, ONNX, Ollama) require external
# model files or services not available in CI. The integration tests
# cover the Harper data layer only; AI inference is intentionally skipped.
MODEL_FETCH_WORKER: 'false'

- name: Upload Harper logs on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: harper-logs-node-${{ matrix.node-version }}
path: /tmp/harper-test-logs/
retention-days: 7
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Update:
- Check existing documentation in `/docs`
- Search issues on GitHub
- Open discussion for questions
- Join HarperDB community Discord
- Join Harper community Discord

## License

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Harper Edge AI

**Production-ready multi-backend ML inference engine for HarperDB.**
**Production-ready multi-backend ML inference engine for Harper.**

Run ONNX, TensorFlow.js, Transformers.js, and Ollama models with unified API, async model fetching, profile-based management, and performance benchmarking.

Expand Down Expand Up @@ -39,7 +39,7 @@ ollama --version
### Installation

```bash
git clone https://github.com/HarperDB/harper-edge-ai-example.git
git clone https://github.com/HarperFast/edge-ai-ops.git
cd harper-edge-ai-example
npm install

Expand Down Expand Up @@ -413,7 +413,7 @@ Apache License 2.0 - See [LICENSE](LICENSE) for details.
## Support

- **Documentation**: [docs/](docs/)
- **Issues**: [GitHub Issues](https://github.com/HarperDB/harper-edge-ai-example/issues)
- **Issues**: [GitHub Issues](https://github.com/HarperFast/edge-ai-ops/issues)
- **Harper Docs**: https://docs.harperdb.io/

---
Expand All @@ -422,7 +422,7 @@ Apache License 2.0 - See [LICENSE](LICENSE) for details.

Built with:

- [HarperDB](https://harperdb.io) - Application and database platform
- [Harper](https://harperdb.io) - Application and database platform
- [ONNX Runtime](https://onnxruntime.ai/) - Optimized inference
- [Transformers.js](https://huggingface.co/docs/transformers.js) - Hugging Face models in JS
- [Ollama](https://ollama.ai/) - Local LLMs
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Harper Edge AI aims to become a complete AI operations platform, providing:

### Core Principles

1. **Harper-Native First** - Leverage HarperDB's built-in capabilities
1. **Harper-Native First** - Leverage Harper's built-in capabilities
2. **Simplicity Over Features** - Only add what's needed
3. **Production-Ready** - Everything must be tested and reliable
4. **Multi-Backend Support** - Don't lock into one framework
Expand Down
12 changes: 6 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ check_prerequisites() {
log_info "Checking prerequisites..."

# Check if Harper CLI is installed
if ! command -v harperdb &> /dev/null; then
log_error "Harper CLI not found. Install with: npm install -g harperdb"
if ! command -v harper &> /dev/null; then
log_error "Harper CLI not found. Install with: npm install -g harper"
exit 1
fi

Expand Down Expand Up @@ -415,7 +415,7 @@ deploy_code() {
log_info " Skip node_modules: ${SKIP_NODE_MODULES}"

# Build deploy command with all parameters
local deploy_cmd="harperdb deploy project=\"${DEPLOY_PROJECT_NAME}\" target=\"${REMOTE_URL}\" username=\"${REMOTE_USERNAME}\" password=\"${REMOTE_PASSWORD}\" replicated=\"${DEPLOY_REPLICATED}\" restart=\"${DEPLOY_RESTART}\""
local deploy_cmd="harper deploy project=\"${DEPLOY_PROJECT_NAME}\" target=\"${REMOTE_URL}\" username=\"${REMOTE_USERNAME}\" password=\"${REMOTE_PASSWORD}\" replicated=\"${DEPLOY_REPLICATED}\" restart=\"${DEPLOY_RESTART}\""

# Add skip_node_modules if enabled
if [[ "${SKIP_NODE_MODULES}" == "true" ]]; then
Expand Down Expand Up @@ -491,7 +491,7 @@ restart_harper() {
export CLI_TARGET_PASSWORD="$REMOTE_PASSWORD"

# Restart using Harper CLI
harperdb restart target="${REMOTE_URL}"
harper restart target="${REMOTE_URL}"

# Unset credentials after use
unset CLI_TARGET_USERNAME
Expand Down Expand Up @@ -538,7 +538,7 @@ check_deployment_status() {
export CLI_TARGET_USERNAME="$REMOTE_USERNAME"
export CLI_TARGET_PASSWORD="$REMOTE_PASSWORD"

harperdb status target="${REMOTE_URL}" || true
harper status target="${REMOTE_URL}" || true

unset CLI_TARGET_USERNAME
unset CLI_TARGET_PASSWORD
Expand Down Expand Up @@ -777,7 +777,7 @@ CONFIGURATION:
MODEL_FETCH_TOKEN=your-token

PREREQUISITES:
- Harper CLI installed: npm install -g harperdb
- Harper CLI installed: npm install -g harper
- Remote Harper instance running
- Valid admin credentials in .env or environment

Expand Down
10 changes: 5 additions & 5 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm run preload:testing # Deploy test models
1. **Harper CLI installed locally**

```bash
npm install -g harperdb
npm install -g harper
```

2. **Remote Harper instance running**
Expand Down Expand Up @@ -174,7 +174,7 @@ harper-ai model test minilm:v1 --input "Hello world"

- Check network connectivity to remote instance
- Verify admin permissions on remote Harper
- Review remote Harper logs: `harperdb logs target=$DEPLOY_REMOTE_URL`
- Review remote Harper logs: `harper logs target=$DEPLOY_REMOTE_URL`

**For script-specific issues**, see [Troubleshooting](SCRIPTS.md#troubleshooting) in SCRIPTS.md.

Expand All @@ -183,7 +183,7 @@ harper-ai model test minilm:v1 --input "Hello world"
**Worker not starting:**

- Verify `MODEL_FETCH_WORKER_ENABLED=true` in remote `.env`
- Check worker logs: `harperdb logs target=$DEPLOY_REMOTE_URL | grep ModelFetchWorker`
- Check worker logs: `harper logs target=$DEPLOY_REMOTE_URL | grep ModelFetchWorker`
- Ensure schema.graphql was deployed

**Jobs failing:**
Expand Down Expand Up @@ -227,10 +227,10 @@ Monitor remote instances:

```bash
# View logs
harperdb logs target=$DEPLOY_REMOTE_URL
harper logs target=$DEPLOY_REMOTE_URL

# Check system resources
harperdb system_information target=$DEPLOY_REMOTE_URL
harper system_information target=$DEPLOY_REMOTE_URL

# Monitor model fetch jobs
export HARPER_URL=$DEPLOY_REMOTE_URL
Expand Down
4 changes: 2 additions & 2 deletions docs/SCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ verify.sh works with three deployment scenarios:
- Target: `http://localhost:9926` (default)
- Example: `./verify.sh --deploy --full`

**2. Local deployed (`harperdb deploy` to localhost)**
**2. Local deployed (`harper deploy` to localhost)**

- App deployed to `~/hdb/components/edge-ai-ops/`
- Models must be fetched from HuggingFace (no local files available)
- Target: `http://localhost:9926` (default)
- Example: `./verify.sh --deploy --full`

**3. Remote deployed (`harperdb deploy` to remote host)**
**3. Remote deployed (`harper deploy` to remote host)**

- App deployed to remote HarperDB instance
- Models must be fetched from HuggingFace
Expand Down
Loading