From 1c498ee2d2c1ab41800d1f5b36a57f26a2f1628e Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Thu, 12 Dec 2024 12:02:09 -0500 Subject: [PATCH 1/3] fix(setup/validate): arm64 build fixes, improved validation --- .../settings/servers/validate-server.tsx | 29 +++++++++---- packages/server/src/setup/server-setup.ts | 42 ++++++++++++------- packages/server/src/setup/server-validate.ts | 16 +++++-- 3 files changed, 61 insertions(+), 26 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/servers/validate-server.tsx b/apps/dokploy/components/dashboard/settings/servers/validate-server.tsx index 9a8f14c0..db4f17b7 100644 --- a/apps/dokploy/components/dashboard/settings/servers/validate-server.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/validate-server.tsx @@ -1,4 +1,5 @@ import { AlertBlock } from "@/components/shared/alert-block"; +import { Button } from "@/components/ui/button"; import { Card, CardContent, @@ -8,9 +9,8 @@ import { } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Loader2, PcCase, RefreshCw } from "lucide-react"; -import { StatusRow } from "./gpu-support"; -import { Button } from "@/components/ui/button"; import { useState } from "react"; +import { StatusRow } from "./gpu-support"; interface Props { serverId: string; @@ -66,7 +66,7 @@ export const ValidateServer = ({ serverId }: Props) => { {isLoading ? (
- Checking Server Configuration + Checking Server configuration
) : (
@@ -113,16 +113,31 @@ export const ValidateServer = ({ serverId }: Props) => { } />
diff --git a/packages/server/src/setup/server-setup.ts b/packages/server/src/setup/server-setup.ts index 55ebdc6b..7f6e3a4d 100644 --- a/packages/server/src/setup/server-setup.ts +++ b/packages/server/src/setup/server-setup.ts @@ -79,6 +79,7 @@ const installRequirements = async (serverId: string, logPath: string) => { DOCKER_VERSION=27.0.3 OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') + SYS_ARCH=$(uname -m) CURRENT_USER=$USER echo "Installing requirements for: OS: $OS_TYPE" @@ -127,6 +128,7 @@ const installRequirements = async (serverId: string, logPath: string) => { esac echo -e "---------------------------------------------" + echo "| CPU Architecture | $SYS_ARCH" echo "| Operating System | $OS_TYPE $OS_VERSION" echo "| Docker | $DOCKER_VERSION" echo -e "---------------------------------------------\n" @@ -489,7 +491,8 @@ export const installRClone = () => ` echo "RClone already installed ✅" else curl https://rclone.org/install.sh | sudo bash - echo "RClone installed successfully ✅" + RCLONE_VERSION=$(rclone --version | head -n 1 | awk '{print $2}' | sed 's/^v//') + echo "RClone version $RCLONE_VERSION installed ✅" fi `; @@ -500,18 +503,20 @@ export const createTraefikInstance = () => { echo "Traefik already exists ✅" else # Create the dokploy-traefik service - docker service create \ - --name dokploy-traefik \ - --replicas 1 \ - --constraint 'node.role==manager' \ - --network dokploy-network \ - --mount type=bind,src=/etc/dokploy/traefik/traefik.yml,dst=/etc/traefik/traefik.yml \ - --mount type=bind,src=/etc/dokploy/traefik/dynamic,dst=/etc/dokploy/traefik/dynamic \ - --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ - --label traefik.enable=true \ - --publish mode=host,target=443,published=443 \ - --publish mode=host,target=80,published=80 \ - traefik:v3.1.2 + TRAEFIK_VERSION=3.1.2 + docker service create \ + --name dokploy-traefik \ + --replicas 1 \ + --constraint 'node.role==manager' \ + --network dokploy-network \ + --mount type=bind,src=/etc/dokploy/traefik/traefik.yml,dst=/etc/traefik/traefik.yml \ + --mount type=bind,src=/etc/dokploy/traefik/dynamic,dst=/etc/dokploy/traefik/dynamic \ + --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ + --label traefik.enable=true \ + --publish mode=host,target=443,published=443 \ + --publish mode=host,target=80,published=80 \ + traefik:v$TRAEFIK_VERSION + echo "Traefik version $TRAEFIK_VERSION installed ✅" fi `; @@ -524,15 +529,20 @@ const installNixpacks = () => ` else export NIXPACKS_VERSION=1.29.1 bash -c "$(curl -fsSL https://nixpacks.com/install.sh)" - echo "Nixpacks version 1.28.1 installed ✅" + echo "Nixpacks version $NIXPACKS_VERSION installed ✅" fi `; const installBuildpacks = () => ` + SUFFIX="" + if [ "$SYS_ARCH" = "aarch64" ] || [ "$SYS_ARCH" = "arm64" ]; then + SUFFIX="-arm64" + fi if command_exists pack; then echo "Buildpacks already installed ✅" else - curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.35.0/pack-v0.35.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack - echo "Buildpacks version 0.35.0 installed ✅" + BUILDPACKS_VERSION=0.35.0 + curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.35.0/pack-v$BUILDPACKS_VERSION-linux$SUFFIX.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack + echo "Buildpacks version $BUILDPACKS_VERSION installed ✅" fi `; diff --git a/packages/server/src/setup/server-validate.ts b/packages/server/src/setup/server-validate.ts index 0729feed..34268f24 100644 --- a/packages/server/src/setup/server-validate.ts +++ b/packages/server/src/setup/server-validate.ts @@ -11,7 +11,7 @@ export const validateDocker = () => ` export const validateRClone = () => ` if command_exists rclone; then - echo "$(rclone --version | head -n 1 | awk '{print $2}') true" + echo "$(rclone --version | head -n 1 | awk '{print $2}' | sed 's/^v//') true" else echo "0.0.0 false" fi @@ -27,7 +27,12 @@ export const validateSwarm = () => ` export const validateNixpacks = () => ` if command_exists nixpacks; then - echo "$(nixpacks --version | awk '{print $2}') true" + version=$(nixpacks --version | awk '{print $2}') + if [ -n "$version" ]; then + echo "$version true" + else + echo "0.0.0 false" + fi else echo "0.0.0 false" fi @@ -35,7 +40,12 @@ export const validateNixpacks = () => ` export const validateBuildpacks = () => ` if command_exists pack; then - echo "$(pack --version | awk '{print $1}') true" + version=$(pack --version | awk '{print $1}') + if [ -n "$version" ]; then + echo "$version true" + else + echo "0.0.0 false" + fi else echo "0.0.0 false" fi From 5ba19686c8254c24f199067ace42372efafbffd4 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Thu, 12 Dec 2024 23:57:54 -0500 Subject: [PATCH 2/3] feat(setup): align pass/fail icons at the end --- .../dashboard/settings/servers/gpu-support.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx b/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx index b398fe74..3cda7e80 100644 --- a/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/gpu-support.tsx @@ -262,16 +262,16 @@ export function StatusRow({
{showIcon ? ( <> - {isEnabled ? ( - - ) : ( - - )} {description || (isEnabled ? "Installed" : "Not Installed")} + {isEnabled ? ( + + ) : ( + + )} ) : ( {value} From a51a7a82d2e9a6d067a22488c60df8bcc7e66e65 Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Thu, 12 Dec 2024 23:58:56 -0500 Subject: [PATCH 3/3] feat(setup): remove debconf warnings during setup --- packages/server/src/setup/server-setup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/setup/server-setup.ts b/packages/server/src/setup/server-setup.ts index 7f6e3a4d..8141cf15 100644 --- a/packages/server/src/setup/server-setup.ts +++ b/packages/server/src/setup/server-setup.ts @@ -320,8 +320,8 @@ const installUtilities = () => ` apk add curl wget git jq openssl >/dev/null ;; ubuntu | debian | raspbian) - apt-get update -y >/dev/null - apt-get install -y curl wget git jq openssl >/dev/null + DEBIAN_FRONTEND=noninteractive apt-get update -y >/dev/null + DEBIAN_FRONTEND=noninteractive apt-get install -y curl wget git jq openssl >/dev/null ;; centos | fedora | rhel | ol | rocky | almalinux | amzn) if [ "$OS_TYPE" = "amzn" ]; then