mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-13 14:53:14 +01:00
Add chroma (ct)
This commit is contained in:
1 parent
c9ba40bfdb
commit
8a7e004bf4
2 files changed
+125
No files matched your search
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
||||
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/chroma-core/chroma
|
||||
|
||||
APP="Chroma"
|
||||
var_tags="${var_tags:-database;vector;ai}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/chroma ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
CURRENT=$(cat ~/.chroma)
|
||||
RELEASE=$(curl -fsSL https://pypi.org/pypi/chromadb/json | jq -r '.info.version')
|
||||
if [[ "$CURRENT" == "$RELEASE" ]]; then
|
||||
msg_ok "No update available: Chroma (${CURRENT})"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Stopping Chroma"
|
||||
systemctl stop chroma
|
||||
msg_ok "Stopped Chroma"
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Updating Chroma to ${RELEASE}"
|
||||
$STD uv pip install --upgrade --python /opt/chroma/.venv/bin/python "chromadb==${RELEASE}"
|
||||
cat <<EOF >~/.chroma
|
||||
${RELEASE}
|
||||
EOF
|
||||
msg_ok "Updated Chroma to ${RELEASE}"
|
||||
|
||||
msg_info "Starting Chroma"
|
||||
systemctl start chroma
|
||||
msg_ok "Started Chroma"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:8000/docs${CL}"
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/chroma-core/chroma
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
CHROMA_VERSION="${var_appversion:-$(curl -fsSL https://pypi.org/pypi/chromadb/json | jq -r '.info.version')}"
|
||||
msg_info "Installing Chroma ${CHROMA_VERSION}"
|
||||
$STD uv venv --python 3.12 /opt/chroma/.venv
|
||||
$STD uv pip install --python /opt/chroma/.venv/bin/python "chromadb==${CHROMA_VERSION}"
|
||||
cat <<EOF >~/.chroma
|
||||
${CHROMA_VERSION}
|
||||
EOF
|
||||
msg_ok "Installed Chroma ${CHROMA_VERSION}"
|
||||
|
||||
msg_info "Configuring Chroma"
|
||||
mkdir -p /opt/chroma_data
|
||||
cat <<EOF >/opt/chroma_data/config.yaml
|
||||
persist_path: "/opt/chroma_data"
|
||||
listen_address: "0.0.0.0"
|
||||
port: 8000
|
||||
EOF
|
||||
msg_ok "Configured Chroma"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/chroma.service
|
||||
[Unit]
|
||||
Description=Chroma
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/chroma_data
|
||||
ExecStart=/opt/chroma/.venv/bin/chroma run /opt/chroma_data/config.yaml
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now chroma
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in new issue
Block a user