Skip to content

Commit

Permalink
feat: adding flowise service, scaffold script
Browse files Browse the repository at this point in the history
  • Loading branch information
av committed Nov 24, 2024
1 parent 1e39a00 commit 21d8972
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 3 deletions.
66 changes: 66 additions & 0 deletions .scripts/scaffold.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// deno run -A ./.scripts/scaffold.ts <handle>

import { parse } from "https://deno.land/std/flags/mod.ts";
import { ensureDir } from "https://deno.land/std/fs/mod.ts";
import { join } from "https://deno.land/std/path/mod.ts";

const composeTemplate = (handle: string) => {
const envPrefix = `HARBOR_${handle.toUpperCase()}_`;

return `
services:
${handle}:
container_name: \${HARBOR_CONTAINER_PREFIX}.${handle}
image: \${${envPrefix}IMAGE}:\${${envPrefix}VERSION}
env_file:
- ./.env
- ${handle}/override.env
networks:
- harbor-network
`;
};

const envTemplate = (handle: string) => `
# This file can be used for additional environment variables
# specifically for the '${handle}' service.
# You can also use the "harbor env" command to set these variables.
`;

async function scaffold(handle: string) {
try {
// Validate handle
if (!handle.match(/^[a-z0-9-]+$/)) {
throw new Error(
"Handle must contain only lowercase letters, numbers, and hyphens"
);
}

// Create directory
const dirPath = join(Deno.cwd(), handle);
await ensureDir(dirPath);

// Create compose file
const composePath = join(Deno.cwd(), `compose.${handle}.yml`);
await Deno.writeTextFile(composePath, composeTemplate(handle));

// Create env file
const envPath = join(dirPath, "override.env");
await Deno.writeTextFile(envPath, envTemplate(handle));

console.log(`Successfully created scaffold for '${handle}'`);
} catch (error) {
console.error("Error:", error.message);
Deno.exit(1);
}
}

// Parse command line arguments
const args = parse(Deno.args);
const handle = args._[0];

if (!handle) {
console.error("Please provide a handle argument");
Deno.exit(1);
}

await scaffold(String(handle));
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ Harbor is a containerized LLM toolkit that allows you to run LLMs and additional
[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)
[OmniParser](https://github.com/av/harbor/wiki/2.3.30-Satellite:-OmniParser) ⦁︎
[Flowise](https://github.com/av/harbor/wiki/2.3.31-Satellite:-Flowise)

See [services documentation](https://github.com/av/harbor/wiki/2.-Services) for a brief overview of each.

## Blitz Tour

Expand Down
5 changes: 4 additions & 1 deletion app/src/serviceMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const serviceMetadata: Record<string, Partial<HarborService>> = {
tags: [HST.satellite],
},
bolt: {
tags: [HST.satellite, HST.partial],
tags: [HST.satellite],
},
pipelines: {
tags: [HST.satellite, HST.api],
Expand All @@ -217,5 +217,8 @@ export const serviceMetadata: Record<string, Partial<HarborService>> = {
},
omniparser: {
tags: [HST.satellite],
},
flowise: {
tags: [HST.satellite],
}
};
15 changes: 15 additions & 0 deletions compose.flowise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

services:
flowise:
container_name: ${HARBOR_CONTAINER_PREFIX}.flowise
image: ${HARBOR_FLOWISE_IMAGE}:${HARBOR_FLOWISE_VERSION}
ports:
- ${HARBOR_FLOWISE_HOST_PORT}:3000
volumes:
# Persistence
- ${HARBOR_FLOWISE_WORKSPACE}:/root/.flowise
env_file:
- ./.env
- flowise/override.env
networks:
- harbor-network
103 changes: 103 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flowise/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data/
4 changes: 4 additions & 0 deletions flowise/override.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# This file can be used for additional environment variables
# specifically for the 'flowise' service.
# You can also use the "harbor env" command to set these variables.
6 changes: 6 additions & 0 deletions profiles/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ HARBOR_PERPLEXIDEEZ_MIGRATE_IMAGE="ghcr.io/brunostjohn/perplexideez/migrate:late
# Omniparser
HARBOR_OMNIPARSER_HOST_PORT=34271

# Flowise
HARBOR_FLOWISE_HOST_PORT=34281
HARBOR_FLOWISE_IMAGE="flowiseai/flowise"
HARBOR_FLOWISE_VERSION="latest"
HARBOR_FLOWISE_WORKSPACE="./flowise/data"

# ============================================
# Service Configuration.
# You can specify any of the service's own environment variables here.
Expand Down
2 changes: 1 addition & 1 deletion searxng/settings.yml.new
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ server:
# If your instance owns a /etc/searxng/settings.yml file, then set the following
# values there.

secret_key: "e77a4285a0681629c9c5f39336850d9b228d4f92580e08584a42b13be03b5bcf" # Is overwritten by ${SEARXNG_SECRET}
secret_key: "ffc7f6143f787621c8d315713d997969f1ae129071aa3eec0d88b38867f3ec19" # Is overwritten by ${SEARXNG_SECRET}
# Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY}
image_proxy: false
# 1.0 and 1.1 are supported
Expand Down

0 comments on commit 21d8972

Please sign in to comment.