diff --git a/BadAI/badai b/BadAI/badai index 68d8d25..716dced 100644 --- a/BadAI/badai +++ b/BadAI/badai @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# DuckAI command-line tool -# Usage: duckai restart [--sleep N] +# BadAI command-line tool +# Usage: badai restart [--sleep N] set -e # Exit on error @@ -124,10 +124,10 @@ if [[ "$1" == "restart" ]]; then fi elif [[ "$1" == "help" || -z "$1" ]]; then cat <<'EOF' -D U C K A I - C O M M A N D L I N E +B A D A I - C O M M A N D L I N E -------------------------------------------------------------------------------- -Usage: duckai [options] +Usage: badai [options] Commands: restart [--sleep N] [name] Restart all quadlet containers and networks, or a specific one by name (without prefix), reload systemd user daemon @@ -138,5 +138,5 @@ Options: EOF else echo "Unknown command: $1" - echo "Use 'duckai help' for usage." + echo "Use 'badai help' for usage." fi \ No newline at end of file diff --git a/BadAI/banner.sh b/BadAI/banner.sh index 0701a39..5fc30b9 100644 --- a/BadAI/banner.sh +++ b/BadAI/banner.sh @@ -96,5 +96,5 @@ printf ' - %-24s → %s\n' "podman logs " "View container logs" printf ' - %-24s → %s\n' "podman exec -it bash" "Access container shell" printf ' - %-24s → %s\n' "radentop" "Monitor AMD GPU usage (if installed)" printf ' - %-24s → %s\n' "htop" "Monitor system processes and resources" -printf ' - %-24s → %s\n' "duckai restart" "Restart all services" -printf ' - %-24s → %s\n' "duckai help" "Show DuckAI commands" \ No newline at end of file +printf ' - %-24s → %s\n' "badai restart" "Restart all services" +printf ' - %-24s → %s\n' "badai help" "Show BadAI commands" \ No newline at end of file diff --git a/BadAI/issue b/BadAI/issue new file mode 100644 index 0000000..8fa374c --- /dev/null +++ b/BadAI/issue @@ -0,0 +1,9 @@ +__________ .___ _____ .___ +\______ \_____ __| _/ / _ \ | | + | | _/\__ \ / __ | / /_\ \| | + | | \ / __ \_/ /_/ | / | \ | + |______ /(____ /\____ | \____|__ /___| + \/ \/ \/ \/ + + +B A D A I - H O S T ( U B U N T U , A M D G P U ) diff --git a/README.md b/README.md index 68881b2..f29ff95 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# Guida Installazione Container Rootless - Ubuntu +__________ .___ _____ .___ +\______ \_____ __| _/ / _ \ | | + | | _/\__ \ / __ | / /_\ \| | + | | \ / __ \_/ /_/ | / | \ | + |______ /(____ /\____ | \____|__ /___| + \/ \/ \/ \/ + Guida completa per configurare un'infrastruttura AI containerizzata con Podman rootless su Ubuntu. diff --git a/Services/llamacpp/llamacpp.container b/Services/llamacpp/llamacpp.container index 60f9964..cfcc4ea 100644 --- a/Services/llamacpp/llamacpp.container +++ b/Services/llamacpp/llamacpp.container @@ -3,10 +3,10 @@ Name=llamacpp [Container] ContainerName=llamacpp -Image=localhost/llamacpp:rocm-amd64 +Image=localhost/llamacpp:vulkan-amd64 Network=internal.network -#PublishPort=8080:8080 +PublishPort=8080:8080 # ROCm AddDevice=/dev/kfd @@ -42,8 +42,8 @@ Environment=CODER_GPU_LAYERS=99 Environment=CODER_MAX_TOKENS=512 # Mount points -Volume=/srv/containers/aitools/models/llamacpp:/home/ubuntu/.cache/llama.cpp -Volume=/srv/containers/aitools/models/llamacpp:/app/models +Volume=/srv/containers/aitools/.cache:/home/ubuntu/.cache +Volume=/srv/containers/aitools/models:/app/models Volume=/srv/containers/aitools/llamacpp_config.yaml:/app/config.yaml [Service] diff --git a/install.sh b/install.sh index ecf9e38..dfc4b14 100644 --- a/install.sh +++ b/install.sh @@ -17,7 +17,7 @@ sudo usermod -a -G render,video $LOGNAME # 3. Installare podman echo "Installando podman..." -sudo apt install -y podman +sudo apt install -y podman htop radeontop curl # 4. Creare cartelle per systemd containers echo "Creando cartelle per containers systemd..." @@ -25,7 +25,7 @@ mkdir -p ~/.config/containers/systemd # 5. Scaricare e copiare internal.network echo "Scaricando internal.network..." -curl -fL $REPO_URL/internal.network -o ~/.config/containers/systemd/internal.network +curl -fsSL $REPO_URL/internal.network -o ~/.config/containers/systemd/internal.network # 6. Aggiungere registri a /etc/containers/registries.conf echo "Aggiungendo registri a registries.conf..." @@ -46,28 +46,53 @@ touch /srv/containers/aitools/llamacpp_config.yaml # 10. Aggiornare GRUB echo "Aggiornando GRUB..." -sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="amdgpu.gttsize=24576 amdttm.pages_limit=27648000"/' /etc/default/grub +echo "Seleziona la quantità di RAM (24, 32, 48 GB):" +read ram_gb +case $ram_gb in + 24) + gttsize=24576 + pages_limit=27648000 + ;; + 32) + gttsize=32768 + pages_limit=36864000 + ;; + 48) + gttsize=49152 + pages_limit=55296000 + ;; + *) + echo "Valore non valido, usando default 24GB" + gttsize=24576 + pages_limit=27648000 + ;; +esac +sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"amdgpu.gttsize=${gttsize} amdttm.pages_limit=${pages_limit}\"/" /etc/default/grub sudo update-grub # 11. Scaricare e installare banner.sh echo "Scaricando e installando banner MOTD..." -sudo curl -fL $REPO_URL/BadAI/banner.sh -o /etc/update-motd.d/99-duckai-banner -sudo chmod +x /etc/update-motd.d/99-duckai-banner +sudo curl -fsSL $REPO_URL/BadAI/banner.sh -o /etc/update-motd.d/99-badai-banner +sudo chmod +x /etc/update-motd.d/99-badai-banner # 12. Disabilitare altri script MOTD echo "Disabilitando altri script MOTD..." -sudo bash -c 'for f in /etc/update-motd.d/*; do if [[ "$f" != "/etc/update-motd.d/99-duckai-banner" && ! -f "${f}.disabled" ]]; then mv "$f" "${f}.disabled"; fi; done' +sudo bash -c 'for f in /etc/update-motd.d/*; do if [[ "$f" != "/etc/update-motd.d/99-badai-banner" && ! -f "${f}.disabled" ]]; then mv "$f" "${f}.disabled"; fi; done' -# 13. Scaricare e installare badai +# 13. Sostituire /etc/issue +echo "Sostituendo /etc/issue..." +sudo curl -fsSL $REPO_URL/BadAI/issue -o /etc/issue + +# 14. Scaricare e installare badai echo "Scaricando e installando badai..." -sudo curl -fL $REPO_URL/BadAI/badai -o /usr/local/bin/badai +sudo curl -fsSL $REPO_URL/BadAI/badai -o /usr/local/bin/badai sudo chmod +x /usr/local/bin/badai -# 14. Scaricare container files +# 15. Scaricare container files echo "Scaricando file container..." -curl -fL $REPO_URL/Services/llamacpp/llamacpp.container -o ~/.config/containers/systemd/llamacpp.container -curl -fL $REPO_URL/Services/nginx/nginx.container -o ~/.config/containers/systemd/nginx.container +curl -fsSL $REPO_URL/Services/llamacpp/llamacpp.container -o ~/.config/containers/systemd/llamacpp.container +curl -fsSL $REPO_URL/Services/nginx/nginx.container -o ~/.config/containers/systemd/nginx.container -# 15. Riavviare il sistema +# 16. Riavviare il sistema echo "Installazione completata. Riavviando il sistema..." sudo reboot \ No newline at end of file