Skip to content

Commit

Permalink
feat: container name prefix
Browse files Browse the repository at this point in the history
fix: linking harbor instead of harbor.sh
  • Loading branch information
av committed Aug 2, 2024
1 parent 7b11377 commit 4ea7ed0
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 31 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ HARBOR_ASSISTANTS_KEY=""
HARBOR_UI_MAIN="webui"
HARBOR_UI_AUTOOPEN=false
HARBOR_SERVICES_DEFAULT="ollama;webui"
HARBOR_CONTAINER_PREFIX="harbor"

# OpenAI
# ---------------------
Expand Down
2 changes: 1 addition & 1 deletion compose.aphrodite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
aphrodite:
image: alpindale/aphrodite-engine
container_name: aphrodite
container_name: ${HARBOR_CONTAINER_PREFIX}.aphrodite
env_file: ./.env
ipc: host
ports:
Expand Down
18 changes: 9 additions & 9 deletions compose.bionicgpt.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
bionicgpt:
container_name: bionicgpt
container_name: ${HARBOR_CONTAINER_PREFIX}.bionicgpt
image: ghcr.io/bionic-gpt/bionicgpt-envoy:1.7.41
ports:
- ${HARBOR_BIONICGPT_HOST_PORT}:7700
Expand All @@ -12,7 +12,7 @@ services:

bi-app:
image: ghcr.io/bionic-gpt/bionicgpt:1.7.41
container_name: bi-app
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-app
environment:
SIGNOUT_URL: /auth/sign_out
ENABLE_BARRICADE: 1
Expand All @@ -26,25 +26,25 @@ services:
- harbor-network

bi-llm-api:
container_name: bi-llm-api
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-llm-api
image: ghcr.io/bionic-gpt/llama-3-8b-chat:1.1.1
networks:
- harbor-network

bi-embeddings-api:
container_name: bi-embeddings-api
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-embeddings-api
image: ghcr.io/bionic-gpt/bionicgpt-embeddings-api:cpu-0.6
networks:
- harbor-network

bi-chunking-engine:
container_name: bi-chunking-engine
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-chunking-engine
image: downloads.unstructured.io/unstructured-io/unstructured-api:4ffd8bc
networks:
- harbor-network

bi-postgres:
container_name: bi-postgres
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-postgres
image: ankane/pgvector
platform: linux/amd64
environment:
Expand All @@ -62,7 +62,7 @@ services:
- ./bionicgpt/db:/var/lib/postgresql/data

bi-barricade:
container_name: bi-barricade
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-barricade
image: purtontech/barricade:1.2.10
environment:
# This secret key is used to encrypt cookies.
Expand All @@ -80,7 +80,7 @@ services:

# Sets up our database tables
bi-migrations:
container_name: bi-migrations
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-migrations
image: ghcr.io/bionic-gpt/bionicgpt-db-migrations:1.7.41
environment:
DATABASE_URL: postgresql://postgres:testpassword@bi-postgres:5432/bionic-gpt?sslmode=disable
Expand All @@ -92,7 +92,7 @@ services:

# Parses documents into chunks and creates embeddings.
bi-pipeline-job:
container_name: bi-pipeline-job
container_name: ${HARBOR_CONTAINER_PREFIX}.bi-pipeline-job
image: ghcr.io/bionic-gpt/bionicgpt-pipeline-job:1.7.41
environment:
APP_DATABASE_URL: postgresql://bionic_application:testpassword@bi-postgres:5432/bionic-gpt?sslmode=disable
Expand Down
2 changes: 1 addition & 1 deletion compose.hollama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
hollama:
image: ghcr.io/fmaclen/hollama:latest
env_file: ./.env
container_name: hollama
container_name: ${HARBOR_CONTAINER_PREFIX}.hollama
ports:
- ${HARBOR_HOLLAMA_HOST_PORT}:4173
networks:
Expand Down
4 changes: 2 additions & 2 deletions compose.langfuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
langfuse:
image: langfuse/langfuse
env_file: ./.env
container_name: langfuse
container_name: ${HARBOR_CONTAINER_PREFIX}.langfuse
ports:
- ${HARBOR_LANGFUSE_HOST_PORT}:3000
depends_on:
Expand All @@ -19,7 +19,7 @@ services:
langfusedb:
image: postgres
restart: always
container_name: langfusedb
container_name: ${HARBOR_CONTAINER_PREFIX}.langfusedb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
Expand Down
10 changes: 5 additions & 5 deletions compose.librechat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
librechat:
container_name: librechat
container_name: ${HARBOR_CONTAINER_PREFIX}.librechat
ports:
- "${HARBOR_LIBRECHAT_HOST_PORT}:${HARBOR_LIBRECHAT_HOST_PORT}"
depends_on:
Expand Down Expand Up @@ -42,7 +42,7 @@ services:
- ./librechat/logs:/app/api/logs

lcdb:
container_name: lcdb
container_name: ${HARBOR_CONTAINER_PREFIX}.lcdb
image: mongo
volumes:
- ./librechat/data:/data/db
Expand All @@ -51,7 +51,7 @@ services:
- harbor-network

lcsearch:
container_name: lcsearch
container_name: ${HARBOR_CONTAINER_PREFIX}.lcsearch
image: getmeili/meilisearch:v1.7.3
environment:
- MEILI_HOST=http://lcsearch:7700
Expand All @@ -62,7 +62,7 @@ services:
- harbor-network

lcvector:
container_name: lcvector
container_name: ${HARBOR_CONTAINER_PREFIX}.lcvector
image: ankane/pgvector:latest
environment:
POSTGRES_DB: mydatabase
Expand All @@ -74,7 +74,7 @@ services:
- harbor-network

lcrag:
container_name: lcrag
container_name: ${HARBOR_CONTAINER_PREFIX}.lcrag
image: ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest
environment:
- DB_HOST=lcvector
Expand Down
4 changes: 2 additions & 2 deletions compose.litellm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
litellm:
image: ghcr.io/berriai/litellm:main-stable
env_file: ./.env
container_name: litellm
container_name: ${HARBOR_CONTAINER_PREFIX}.litellm
volumes:
# Additional config file volumes will be appended when
# LiteLLM is combined with other services
Expand Down Expand Up @@ -31,7 +31,7 @@ services:
litellmdb:
image: postgres
restart: always
container_name: litellmdb
container_name: ${HARBOR_CONTAINER_PREFIX}.litellmdb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
Expand Down
2 changes: 1 addition & 1 deletion compose.llamacpp.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
llamacpp:
image: ghcr.io/ggerganov/llama.cpp:full-cuda
container_name: llamacpp
container_name: ${HARBOR_CONTAINER_PREFIX}.llamacpp
volumes:
- ${HARBOR_HF_CACHE}:/app/models
- ${HARBOR_LLAMACPP_CACHE}:/root/.cache/llama.cpp
Expand Down
2 changes: 1 addition & 1 deletion compose.lmdeploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
lmdeploy:
image: openmmlab/lmdeploy:latest
container_name: lmdeploy
container_name: ${HARBOR_CONTAINER_PREFIX}.lmdeploy
volumes:
- ${HARBOR_HF_CACHE}:/root/.cache/huggingface
ports:
Expand Down
2 changes: 1 addition & 1 deletion compose.ollama.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
ollama:
container_name: ollama
container_name: ${HARBOR_CONTAINER_PREFIX}.ollama
env_file: ./.env
volumes:
- ${HARBOR_OLLAMA_CACHE}:/root/.ollama
Expand Down
2 changes: 1 addition & 1 deletion compose.searxng.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
searxng:
container_name: searxng
container_name: ${HARBOR_CONTAINER_PREFIX}.searxng
env_file: ./.env
image: searxng/searxng
environment:
Expand Down
2 changes: 1 addition & 1 deletion compose.tgi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
tgi:
container_name: tgi
container_name: ${HARBOR_CONTAINER_PREFIX}.tgi
env_file: ./.env
image: ghcr.io/huggingface/text-generation-inference:2.2.0
command: ${HARBOR_TGI_MODEL_SPECIFIER} ${HARBOR_TGI_EXTRA_ARGS}
Expand Down
2 changes: 1 addition & 1 deletion compose.tts.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
tts:
image: ghcr.io/matatonic/openedai-speech
container_name: tts
container_name: ${HARBOR_CONTAINER_PREFIX}.tts
env_file: ./.env
ports:
- ${HARBOR_TTS_HOST_PORT}:8000
Expand Down
2 changes: 1 addition & 1 deletion compose.vllm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
vllm:
container_name: vllm
container_name: ${HARBOR_CONTAINER_PREFIX}.vllm
env_file: ./.env
image: vllm/vllm-openai:latest
ports:
Expand Down
2 changes: 1 addition & 1 deletion compose.webui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
image: ghcr.io/open-webui/open-webui:main
env_file:
- ./.env
container_name: webui
container_name: ${HARBOR_CONTAINER_PREFIX}.webui
volumes:
- ./open-webui:/app/backend/data
- ./open-webui/start_webui.sh:/app/start_webui.sh
Expand Down
8 changes: 6 additions & 2 deletions harbor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ run_dive() {

link_cli() {
local target_dir="$HOME/.local/bin"
local script_name="harbor"
local script_path="$harbor_home/harbor.sh"

# Check if target directory exists in PATH
Expand Down Expand Up @@ -216,16 +217,18 @@ get_service_url() {
return 0
fi

local target_name="$default_container_prefix.$1"

# Check if the specified service is running
if ! echo "$services" | grep -q "^$1$"; then
if ! echo "$services" | grep -q "^$target_name$"; then
echo "Service '$1' is not currently running."
echo "Available services:"
echo "$services"
return 1
fi

# Get the port mapping for the service
port=$(docker port "$1" | grep -oP '0.0.0.0:\K\d+' | head -n 1)
port=$(docker port "$target_name" | grep -oP '0.0.0.0:\K\d+' | head -n 1)

if [ -z "$port" ]; then
echo "No port mapping found for service '$1'."
Expand Down Expand Up @@ -848,6 +851,7 @@ cd $harbor_home
default_options=($(env_manager get services.default | tr ';' ' '))
default_open=$(env_manager get ui.main)
default_autoopen=$(env_manager get ui.autoopen)
default_container_prefix=$(env_manager get container.prefix)

# Main script logic
case "$1" in
Expand Down
8 changes: 7 additions & 1 deletion open-webui/config.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{}
{
"ollama": {
"base_urls": [
"http://ollama:11434"
]
}
}

0 comments on commit 4ea7ed0

Please sign in to comment.