diff --git a/docs/CODE-AUDIT.md b/.github/CONTRIBUTOR_AND_GUIDES/CODE-AUDIT.md similarity index 100% rename from docs/CODE-AUDIT.md rename to .github/CONTRIBUTOR_AND_GUIDES/CODE-AUDIT.md diff --git a/docs/CONTRIBUTING.md b/.github/CONTRIBUTOR_AND_GUIDES/CONTRIBUTING.md similarity index 100% rename from docs/CONTRIBUTING.md rename to .github/CONTRIBUTOR_AND_GUIDES/CONTRIBUTING.md diff --git a/docs/USER_SUBMITTED_GUIDES.md b/.github/CONTRIBUTOR_AND_GUIDES/USER_SUBMITTED_GUIDES.md similarity index 100% rename from docs/USER_SUBMITTED_GUIDES.md rename to .github/CONTRIBUTOR_AND_GUIDES/USER_SUBMITTED_GUIDES.md diff --git a/docs/ct/AppName.md b/.github/CONTRIBUTOR_AND_GUIDES/ct/AppName.md similarity index 100% rename from docs/ct/AppName.md rename to .github/CONTRIBUTOR_AND_GUIDES/ct/AppName.md diff --git a/docs/ct/AppName.sh b/.github/CONTRIBUTOR_AND_GUIDES/ct/AppName.sh similarity index 100% rename from docs/ct/AppName.sh rename to .github/CONTRIBUTOR_AND_GUIDES/ct/AppName.sh diff --git a/docs/install/AppName-install.md b/.github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.md similarity index 100% rename from docs/install/AppName-install.md rename to .github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.md diff --git a/docs/install/AppName-install.sh b/.github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.sh similarity index 100% rename from docs/install/AppName-install.sh rename to .github/CONTRIBUTOR_AND_GUIDES/install/AppName-install.sh diff --git a/docs/json/AppName.json b/.github/CONTRIBUTOR_AND_GUIDES/json/AppName.json similarity index 100% rename from docs/json/AppName.json rename to .github/CONTRIBUTOR_AND_GUIDES/json/AppName.json diff --git a/docs/json/AppName.md b/.github/CONTRIBUTOR_AND_GUIDES/json/AppName.md similarity index 100% rename from docs/json/AppName.md rename to .github/CONTRIBUTOR_AND_GUIDES/json/AppName.md diff --git a/docs/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from docs/CODE_OF_CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/core/api/.env.example b/api/.env.example similarity index 100% rename from core/api/.env.example rename to api/.env.example diff --git a/core/api/go.mod b/api/go.mod similarity index 100% rename from core/api/go.mod rename to api/go.mod diff --git a/core/api/go.sum b/api/go.sum similarity index 100% rename from core/api/go.sum rename to api/go.sum diff --git a/core/api/main.go b/api/main.go similarity index 100% rename from core/api/main.go rename to api/main.go diff --git a/ct/ollama.sh b/ct/ollama.sh new file mode 100644 index 0000000..8a2c4b4 --- /dev/null +++ b/ct/ollama.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: tteck | Co-Author: havardthom +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://ollama.com/ + +APP="Ollama" +var_tags="${var_tags:-ai}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-24}" +var_os="${var_os:-ubuntu}" +var_version="${var_version:-22.04}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/ollama ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP}" + $STD apt-get update + $STD apt-get -y upgrade + 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 "${TAB}${GATEWAY}${BGN}http://${IP}:14434${CL}" \ No newline at end of file diff --git a/install/ollama-install.sh b/install/ollama-install.sh new file mode 100644 index 0000000..fd0baac --- /dev/null +++ b/install/ollama-install.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 tteck +# Author: tteck +# Co-Author: havardthom +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://ollama.com/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + gpg \ + git \ + build-essential \ + pkg-config \ + cmake +msg_ok "Installed Dependencies" + +msg_info "Installing Golang" +set +o pipefail +temp_file=$(mktemp) +golang_tarball=$(curl -fsSL https://go.dev/dl/ | grep -oP 'go[\d\.]+\.linux-amd64\.tar\.gz' | head -n 1) +curl -fsSL "https://golang.org/dl/${golang_tarball}" -o "$temp_file" +tar -C /usr/local -xzf "$temp_file" +ln -sf /usr/local/go/bin/go /usr/local/bin/go +rm -f "$temp_file" +set -o pipefail +msg_ok "Installed Golang" + +msg_info "Setting up Intel® Repositories" +mkdir -p /etc/apt/keyrings +curl -fsSL https://repositories.intel.com/gpu/intel-graphics.key | gpg --dearmor -o /etc/apt/keyrings/intel-graphics.gpg +echo "deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" >/etc/apt/sources.list.d/intel-gpu-jammy.list +curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /etc/apt/keyrings/oneapi-archive-keyring.gpg +echo "deb [signed-by=/etc/apt/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" >/etc/apt/sources.list.d/oneAPI.list +$STD apt-get update +msg_ok "Set up Intel® Repositories" + +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools,intel-level-zero-gpu,level-zero,level-zero-dev} +if [[ "$CTTYPE" == "0" ]]; then + chgrp video /dev/dri + chmod 755 /dev/dri + chmod 660 /dev/dri/* + $STD adduser $(id -u -n) video + $STD adduser $(id -u -n) render +fi +msg_ok "Set Up Hardware Acceleration" + +msg_info "Installing Intel® oneAPI Base Toolkit (Patience)" +$STD apt-get install -y --no-install-recommends intel-basekit-2024.1 +msg_ok "Installed Intel® oneAPI Base Toolkit" + +msg_info "Installing Ollama (Patience)" +$STD git clone https://github.com/ollama/ollama.git /opt/ollama +cd /opt/ollama +$STD go generate ./... +$STD go build . +msg_ok "Installed Ollama" + +msg_info "Creating Service" +cat </etc/systemd/system/ollama.service +[Unit] +Description=Ollama Service +After=network-online.target + +[Service] +Type=exec +ExecStart=/opt/ollama/ollama serve +Environment=HOME=$HOME +Environment=OLLAMA_INTEL_GPU=true +Environment=OLLAMA_HOST=0.0.0.0 +Environment=OLLAMA_NUM_GPU=999 +Environment=SYCL_CACHE_PERSISTENT=1 +Environment=ZES_ENABLE_SYSMAN=1 +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now ollama +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/vms/debian-vm-test-helper.sh b/vm/debian-vm-test-helper.sh similarity index 100% rename from vms/debian-vm-test-helper.sh rename to vm/debian-vm-test-helper.sh diff --git a/vms/debian-vm.sh b/vm/debian-vm.sh similarity index 100% rename from vms/debian-vm.sh rename to vm/debian-vm.sh