Skip to content

Commit

Permalink
feat: v0.2.17 - promptfoo, omniparser, webtop, failed perplexideez in…
Browse files Browse the repository at this point in the history
…tegration
  • Loading branch information
av committed Nov 17, 2024
1 parent a0d1749 commit b8ef53c
Show file tree
Hide file tree
Showing 33 changed files with 798 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as toml from 'jsr:@std/toml';
import * as path from 'jsr:@std/path';
import * as collections from "jsr:@std/collections/deep-merge";

const VERSION = "0.2.16";
const VERSION = "0.2.17";

type ValueSeed = {
// Path relative to the project root
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ Harbor is a containerized LLM toolkit that allows you to run LLMs and additional
[Bolt.new](https://github.com/av/harbor/wiki/2.3.24-Satellite:-Bolt.new) ⦁︎
[Open WebUI Pipelines](https://github.com/av/harbor/wiki/2.3.25-Satellite:-Open-WebUI-Pipelines) ⦁︎
[Qdrant](https://github.com/av/harbor/wiki/2.3.26-Satellite:-Qdrant) ⦁︎
[K6](https://github.com/av/harbor/wiki/2.3.26-Satellite:-K6)
[K6](https://github.com/av/harbor/wiki/2.3.27-Satellite:-K6) ⦁︎
[Promptfoo](https://github.com/av/harbor/wiki/2.3.28-Satellite:-Promptfoo) ⦁︎
[Webtop](https://github.com/av/harbor/wiki/2.3.29-Satellite:-Webtop) ⦁︎
[OmniParser](https://github.com/av/harbor/wiki/2.3.30-Satellite:-OmniParser) ⦁︎

## Blitz Tour

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@avcodes/harbor-app",
"private": true,
"version": "0.2.16",
"version": "0.2.17",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[package]
name = "harbor-app"
version = "0.2.16"
version = "0.2.17"
description = "A companion app for Harbor LLM toolkit"
authors = ["av"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0-rc",
"productName": "Harbor",
"version": "0.2.16",
"version": "0.2.17",
"identifier": "com.harbor.app",
"build": {
"beforeDevCommand": "bun run dev",
Expand Down
3 changes: 3 additions & 0 deletions app/src/serviceMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,8 @@ export const serviceMetadata: Record<string, Partial<HarborService>> = {
},
k6: {
tags: [HST.satellite, HST.cli],
},
promptfoo: {
tags: [HST.satellite, HST.cli],
}
};
13 changes: 13 additions & 0 deletions compose.omniparser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
omniparser:
build:
context: ./omniparser
dockerfile: Dockerfile
container_name: ${HARBOR_CONTAINER_PREFIX}.omniparser
env_file:
- ./.env
- ./omniparser/override.env
ports:
- ${HARBOR_OMNIPARSER_HOST_PORT}:7861
networks:
- harbor-network
137 changes: 137 additions & 0 deletions compose.perplexideez.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
services:
# Proxy to work around the secure cookies
# and cors for localhost deployment
perplexideez:
container_name: ${HARBOR_CONTAINER_PREFIX}.perplexideez
image: nginx:alpine
ports:
- ${HARBOR_PERPLEXIDEEZ_HOST_PORT}:80
configs:
- source: perplexideez_proxy_config
target: /etc/nginx/conf.d/default.conf
depends_on:
perplexideez-service:
condition: service_healthy
networks:
- harbor-network

perplexideez-service:
container_name: ${HARBOR_CONTAINER_PREFIX}.perplexideez-service
image: ${HARBOR_PERPLEXIDEEZ_IMAGE}:${HARBOR_PERPLEXIDEEZ_VERSION}
env_file:
- ./.env
- ./perplexideez/override.env
healthcheck:
# TODO:
# https://github.com/brunostjohn/perplexideez/issues/12
test: ["CMD", "true"]
interval: 2s
timeout: 60s
retries: 5
start_period: 10s
depends_on:
perplexideez-db:
condition: service_healthy
perplexideez-migrate:
condition: service_completed_successfully
networks:
- harbor-network

perplexideez-db:
container_name: ${HARBOR_CONTAINER_PREFIX}.perplexideez-db
image: postgres:16-alpine
restart: unless-stopped
volumes:
- ./perplexideez/pgdata:/var/lib/postgresql/data
healthcheck:
test: "pg_isready -d postgres -U postgres -h localhost"
interval: 2s
timeout: 60s
retries: 5
env_file:
- ./.env
- ./perplexideez/override.env
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
networks:
- harbor-network

perplexideez-migrate:
container_name: ${HARBOR_CONTAINER_PREFIX}.perplexideez-migrate
image: ${HARBOR_PERPLEXIDEEZ_MIGRATE_IMAGE}
env_file:
- ./.env
- ./perplexideez/override.env
depends_on:
perplexideez-db:
condition: service_healthy
networks:
- harbor-network

configs:
perplexideez_proxy_config:
content: |
server {
listen 80;
gzip_static off;
server_name perplexideez.com;
location / {
proxy_pass http://perplexideez-service:3000;
proxy_set_header Host perplexideez.com;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# Disable CSRF protection in Nginx
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header Origin https://perplexideez.com;
proxy_set_header Referer https://perplexideez.com;
# Rewrite Location header to use localhost
proxy_redirect https://perplexideez.com/ http://localhost:34261/;
proxy_redirect http://perplexideez.com/ http://localhost:34261/;
# Cookie rewriting
proxy_cookie_domain perplexideez.com localhost;
proxy_cookie_path / /;
proxy_cookie_flags ~ -secure;
# Force uncompressed response to allow substitutions
proxy_set_header Accept-Encoding "";
# Rewrite Secure-prefixed cookies
proxy_hide_header set-cookie;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
sub_filter_once off;
sub_filter '__Secure-' '';
sub_filter '; Secure' '';
sub_filter 'perplexideez.com' 'localhost:34261';
sub_filter "https://localhost:34261" "http://localhost:34261";
sub_filter "https%3A%2F%2Flocalhost%3A34261" "http%3A%2F%2Flocalhost%3A34261";
sub_filter 'href="https://localhost:34261' 'href="http://localhost:34261';
sub_filter 'content="https://localhost:34261' 'content="http://localhost:34261';
# CORS headers
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
# Handle OPTIONS method
if ($$request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# Force processing of response
proxy_force_ranges on;
}
}
28 changes: 28 additions & 0 deletions compose.promptfoo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
promptfoo:
container_name: ${HARBOR_CONTAINER_PREFIX}.promptfoo
env_file:
- ./.env
- ./promptfoo/override.env
environment:
- PROMPTFOO_REMOTE_API_BASE_URL=${HARBOR_PROMPTFOO_REMOTE_API_BASE_URL}
- PROMPTFOO_REMOTE_APP_BASE_URL=http://localhost:${HARBOR_PROMPTFOO_REMOTE_APP_BASE_URL}
- PROMPTFOO_DISABLE_TELEMETRY=1
- PROMPTFOO_DISABLE_UPDATE=1
image: ${HARBOR_PROMPTFOO_IMAGE}:${HARBOR_PROMPTFOO_VERSION}
ports:
- ${HARBOR_PROMPTFOO_HOST_PORT}:3000
volumes:
- ${HARBOR_PROMPTFOO_WORKSPACE}:/home/promptfoo/.promptfoo
# Original healthcheck is very
# slow, server starts in ~2s, so overriding
healthcheck:
test: [ "CMD-SHELL", "exit 0" ]
interval: 2s
timeout: 1s
start_period: 1s
retries: 5
# Avoiding issues with SIGTERM in the original
command: ["ash", "-c", "node /app/dist/src/server/index.js"]
networks:
- harbor-network
33 changes: 33 additions & 0 deletions compose.webtop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
webtop:
# We add a few of extra dependencies to the image
build:
context: ./webtop
dockerfile: Dockerfile
args:
HARBOR_WEBTOP_IMAGE: ${HARBOR_WEBTOP_IMAGE}
HARBOR_WEBTOP_VERSION: ${HARBOR_WEBTOP_VERSION}
container_name: ${HARBOR_CONTAINER_PREFIX}.webtop
env_file:
- ./.env
- ./webtop/override.env
environment:
- HARBOR_HOME=/harbor
- PUID=${HARBOR_USER_ID}
volumes:
# Mount Host's Harbor home, very important for the interop
- .:/harbor
# Webtop homedir, can be cleared with "harbor webtop reset"
- ${HARBOR_WEBTOP_WORKSPACE}:/config
# Docker access
- /var/run/docker.sock:/var/run/docker.sock
# Pre-provision docker groups
- ./webtop/init:/custom-cont-init.d:ro
ports:
- ${HARBOR_WEBTOP_HOST_PORT}:3000
# There's also HTTPS port, but we're not using it
# - ${HARBOR_WEBTOP_HOST_PORT}:3001
# Avoid crashes in modern browsers
shm_size: "1gb"
networks:
- harbor-network
5 changes: 5 additions & 0 deletions compose.x.perplexideez.ollama.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
perplexideez:
environment:
- LLM_MODE="ollama"
- OLLAMA_URL=${HARBOR_OLLAMA_INTERNAL_URL}
4 changes: 4 additions & 0 deletions compose.x.perplexideez.searxng.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
perplexideez:
environment:
- SEARXNG_URL=http://searxng:8080
5 changes: 5 additions & 0 deletions compose.x.promptfoo.ollama.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
promptfoo:
environment:
- OLLAMA_BASE_URL=${HARBOR_OLLAMA_INTERNAL_URL}
- OLLAMA_API_KEY=sk-ollama
Loading

0 comments on commit b8ef53c

Please sign in to comment.